Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 23 Dec 2016 08:53:54 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/23/t1482479800fbuegkrb5q01ey7.htm/, Retrieved Tue, 07 May 2024 07:25:21 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302764, Retrieved Tue, 07 May 2024 07:25:21 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact113
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecast] [2016-12-23 07:53:54] [6f830dc7e8de22be3233942ffbe3aaba] [Current]
Feedback Forum

Post a new message
Dataseries X:
4526.1
4616.8
4558
4736.8
4771.1
4611.3
4687.1
4718.3
4731.6
4755.4
4849.8
4697.8
4720.2
4741.1
4794.2
4807.4
4836.9
4853
4902.9
4938
4910.4
4954.6
4937.3
5003.8
5005.6
4984.4
5050
5017.7
4984.8
5036.3
5093.6
5111.2
5090.7
5063.7
5007.5
5122.5
5172.3
5232.8
5183.3
5204.6
5255.4
5294.5
5308.9
5281.3
5413.9
5462.4
5568.7
5579.1
5590.3
5703.2
5717.7
5772.3
5876.6
6134.6
6155.6
6259.5
6180.7
6120.3
6097
6167.5
6207.1
6181.7
6196.2
6183.9
6184
6271.1
6204.9
6284.5
6293.9
6377.9
6400.2
6456.2
6372.8
6368.8
6497.8
6599.4
6696.9
6676.3
6731.7
6732.3
6760.2
6841.4
6917.5
6899.3
6972.9
6969.2
6941.6
6905.5
6971.3
6968.4
7012.2
7049.5
7095.6
7237.5
7230.5
7253.5
7289.4
7364.6
7428.1
7390.2
7279.9
7426.5
7480.1




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302764&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302764&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302764&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[91])
796731.7-------
806732.3-------
816760.2-------
826841.4-------
836917.5-------
846899.3-------
856972.90000000001-------
866969.2-------
876941.59999999999-------
886905.49999999999-------
896971.3-------
906968.4-------
917012.2-------
927049.57005.10346834.86227179.5850.3090.46820.99890.4682
937095.67005.56756761.4037258.54920.24270.36680.97130.4795
947237.57000.9916701.48757313.880.06920.27670.84130.472
957230.57002.56746656.76087366.33810.10970.10280.67660.4793
967253.56995.88296610.07277404.21160.10810.130.67850.4688
977289.47008.20926585.45697458.10.11030.14260.56110.4931
987364.67008.43836552.53437496.06250.07610.12940.56270.494
997428.16993.78366508.22657515.56660.05140.08180.57770.4724
1007390.26981.71536468.44627535.7120.07420.05710.60630.4571
1017279.96975.3676435.71387560.27160.15370.08230.50540.4509
1027426.56977.25166412.02017592.30930.07610.16740.51130.4557
1037480.16973.99876384.84287617.51840.06160.08410.45370.4537

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast \tabularnewline
time & Y[t] & F[t] & 95% LB & 95% UB & p-value(H0: Y[t] = F[t]) & P(F[t]>Y[t-1]) & P(F[t]>Y[t-s]) & P(F[t]>Y[91]) \tabularnewline
79 & 6731.7 & - & - & - & - & - & - & - \tabularnewline
80 & 6732.3 & - & - & - & - & - & - & - \tabularnewline
81 & 6760.2 & - & - & - & - & - & - & - \tabularnewline
82 & 6841.4 & - & - & - & - & - & - & - \tabularnewline
83 & 6917.5 & - & - & - & - & - & - & - \tabularnewline
84 & 6899.3 & - & - & - & - & - & - & - \tabularnewline
85 & 6972.90000000001 & - & - & - & - & - & - & - \tabularnewline
86 & 6969.2 & - & - & - & - & - & - & - \tabularnewline
87 & 6941.59999999999 & - & - & - & - & - & - & - \tabularnewline
88 & 6905.49999999999 & - & - & - & - & - & - & - \tabularnewline
89 & 6971.3 & - & - & - & - & - & - & - \tabularnewline
90 & 6968.4 & - & - & - & - & - & - & - \tabularnewline
91 & 7012.2 & - & - & - & - & - & - & - \tabularnewline
92 & 7049.5 & 7005.1034 & 6834.8622 & 7179.585 & 0.309 & 0.4682 & 0.9989 & 0.4682 \tabularnewline
93 & 7095.6 & 7005.5675 & 6761.403 & 7258.5492 & 0.2427 & 0.3668 & 0.9713 & 0.4795 \tabularnewline
94 & 7237.5 & 7000.991 & 6701.4875 & 7313.88 & 0.0692 & 0.2767 & 0.8413 & 0.472 \tabularnewline
95 & 7230.5 & 7002.5674 & 6656.7608 & 7366.3381 & 0.1097 & 0.1028 & 0.6766 & 0.4793 \tabularnewline
96 & 7253.5 & 6995.8829 & 6610.0727 & 7404.2116 & 0.1081 & 0.13 & 0.6785 & 0.4688 \tabularnewline
97 & 7289.4 & 7008.2092 & 6585.4569 & 7458.1 & 0.1103 & 0.1426 & 0.5611 & 0.4931 \tabularnewline
98 & 7364.6 & 7008.4383 & 6552.5343 & 7496.0625 & 0.0761 & 0.1294 & 0.5627 & 0.494 \tabularnewline
99 & 7428.1 & 6993.7836 & 6508.2265 & 7515.5666 & 0.0514 & 0.0818 & 0.5777 & 0.4724 \tabularnewline
100 & 7390.2 & 6981.7153 & 6468.4462 & 7535.712 & 0.0742 & 0.0571 & 0.6063 & 0.4571 \tabularnewline
101 & 7279.9 & 6975.367 & 6435.7138 & 7560.2716 & 0.1537 & 0.0823 & 0.5054 & 0.4509 \tabularnewline
102 & 7426.5 & 6977.2516 & 6412.0201 & 7592.3093 & 0.0761 & 0.1674 & 0.5113 & 0.4557 \tabularnewline
103 & 7480.1 & 6973.9987 & 6384.8428 & 7617.5184 & 0.0616 & 0.0841 & 0.4537 & 0.4537 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302764&T=1

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast[/C][/ROW]
[ROW][C]time[/C][C]Y[t][/C][C]F[t][/C][C]95% LB[/C][C]95% UB[/C][C]p-value(H0: Y[t] = F[t])[/C][C]P(F[t]>Y[t-1])[/C][C]P(F[t]>Y[t-s])[/C][C]P(F[t]>Y[91])[/C][/ROW]
[ROW][C]79[/C][C]6731.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]6732.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]6760.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]6841.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]6917.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]6899.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]6972.90000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]6969.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]6941.59999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]6905.49999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]6971.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]6968.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]7012.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]7049.5[/C][C]7005.1034[/C][C]6834.8622[/C][C]7179.585[/C][C]0.309[/C][C]0.4682[/C][C]0.9989[/C][C]0.4682[/C][/ROW]
[ROW][C]93[/C][C]7095.6[/C][C]7005.5675[/C][C]6761.403[/C][C]7258.5492[/C][C]0.2427[/C][C]0.3668[/C][C]0.9713[/C][C]0.4795[/C][/ROW]
[ROW][C]94[/C][C]7237.5[/C][C]7000.991[/C][C]6701.4875[/C][C]7313.88[/C][C]0.0692[/C][C]0.2767[/C][C]0.8413[/C][C]0.472[/C][/ROW]
[ROW][C]95[/C][C]7230.5[/C][C]7002.5674[/C][C]6656.7608[/C][C]7366.3381[/C][C]0.1097[/C][C]0.1028[/C][C]0.6766[/C][C]0.4793[/C][/ROW]
[ROW][C]96[/C][C]7253.5[/C][C]6995.8829[/C][C]6610.0727[/C][C]7404.2116[/C][C]0.1081[/C][C]0.13[/C][C]0.6785[/C][C]0.4688[/C][/ROW]
[ROW][C]97[/C][C]7289.4[/C][C]7008.2092[/C][C]6585.4569[/C][C]7458.1[/C][C]0.1103[/C][C]0.1426[/C][C]0.5611[/C][C]0.4931[/C][/ROW]
[ROW][C]98[/C][C]7364.6[/C][C]7008.4383[/C][C]6552.5343[/C][C]7496.0625[/C][C]0.0761[/C][C]0.1294[/C][C]0.5627[/C][C]0.494[/C][/ROW]
[ROW][C]99[/C][C]7428.1[/C][C]6993.7836[/C][C]6508.2265[/C][C]7515.5666[/C][C]0.0514[/C][C]0.0818[/C][C]0.5777[/C][C]0.4724[/C][/ROW]
[ROW][C]100[/C][C]7390.2[/C][C]6981.7153[/C][C]6468.4462[/C][C]7535.712[/C][C]0.0742[/C][C]0.0571[/C][C]0.6063[/C][C]0.4571[/C][/ROW]
[ROW][C]101[/C][C]7279.9[/C][C]6975.367[/C][C]6435.7138[/C][C]7560.2716[/C][C]0.1537[/C][C]0.0823[/C][C]0.5054[/C][C]0.4509[/C][/ROW]
[ROW][C]102[/C][C]7426.5[/C][C]6977.2516[/C][C]6412.0201[/C][C]7592.3093[/C][C]0.0761[/C][C]0.1674[/C][C]0.5113[/C][C]0.4557[/C][/ROW]
[ROW][C]103[/C][C]7480.1[/C][C]6973.9987[/C][C]6384.8428[/C][C]7617.5184[/C][C]0.0616[/C][C]0.0841[/C][C]0.4537[/C][C]0.4537[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302764&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302764&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[91])
796731.7-------
806732.3-------
816760.2-------
826841.4-------
836917.5-------
846899.3-------
856972.90000000001-------
866969.2-------
876941.59999999999-------
886905.49999999999-------
896971.3-------
906968.4-------
917012.2-------
927049.57005.10346834.86227179.5850.3090.46820.99890.4682
937095.67005.56756761.4037258.54920.24270.36680.97130.4795
947237.57000.9916701.48757313.880.06920.27670.84130.472
957230.57002.56746656.76087366.33810.10970.10280.67660.4793
967253.56995.88296610.07277404.21160.10810.130.67850.4688
977289.47008.20926585.45697458.10.11030.14260.56110.4931
987364.67008.43836552.53437496.06250.07610.12940.56270.494
997428.16993.78366508.22657515.56660.05140.08180.57770.4724
1007390.26981.71536468.44627535.7120.07420.05710.60630.4571
1017279.96975.3676435.71387560.27160.15370.08230.50540.4509
1027426.56977.25166412.02017592.30930.07610.16740.51130.4557
1037480.16973.99876384.84287617.51840.06160.08410.45370.4537







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
920.01270.00630.00630.00631971.0564000.65910.6591
930.01840.01270.00950.00958105.84895038.452670.98211.33650.9978
940.02280.03270.01720.017455936.49422004.4664148.3393.51091.8355
950.02650.03150.02080.021151953.267529491.6667171.73143.38362.2225
960.02980.03550.02370.024166366.586136866.6506192.00693.82432.5429
970.03280.03860.02620.026679068.262843900.2526209.52394.17422.8148
980.03550.04840.02940.0299126851.169155750.3835236.11525.28723.168
990.03810.05850.0330.0337188630.727472360.4265268.99896.44733.5779
1000.04050.05530.03550.0363166859.7982860.3558287.85476.06393.8541
1010.04280.04180.03610.036992740.354283848.3556289.56584.52073.9208
1020.0450.06050.03830.0392201824.140894573.427307.52796.6694.1706
1030.04710.06770.04080.0418256138.509108037.1838328.69017.5134.4491

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
92 & 0.0127 & 0.0063 & 0.0063 & 0.0063 & 1971.0564 & 0 & 0 & 0.6591 & 0.6591 \tabularnewline
93 & 0.0184 & 0.0127 & 0.0095 & 0.0095 & 8105.8489 & 5038.4526 & 70.9821 & 1.3365 & 0.9978 \tabularnewline
94 & 0.0228 & 0.0327 & 0.0172 & 0.0174 & 55936.494 & 22004.4664 & 148.339 & 3.5109 & 1.8355 \tabularnewline
95 & 0.0265 & 0.0315 & 0.0208 & 0.0211 & 51953.2675 & 29491.6667 & 171.7314 & 3.3836 & 2.2225 \tabularnewline
96 & 0.0298 & 0.0355 & 0.0237 & 0.0241 & 66366.5861 & 36866.6506 & 192.0069 & 3.8243 & 2.5429 \tabularnewline
97 & 0.0328 & 0.0386 & 0.0262 & 0.0266 & 79068.2628 & 43900.2526 & 209.5239 & 4.1742 & 2.8148 \tabularnewline
98 & 0.0355 & 0.0484 & 0.0294 & 0.0299 & 126851.1691 & 55750.3835 & 236.1152 & 5.2872 & 3.168 \tabularnewline
99 & 0.0381 & 0.0585 & 0.033 & 0.0337 & 188630.7274 & 72360.4265 & 268.9989 & 6.4473 & 3.5779 \tabularnewline
100 & 0.0405 & 0.0553 & 0.0355 & 0.0363 & 166859.79 & 82860.3558 & 287.8547 & 6.0639 & 3.8541 \tabularnewline
101 & 0.0428 & 0.0418 & 0.0361 & 0.0369 & 92740.3542 & 83848.3556 & 289.5658 & 4.5207 & 3.9208 \tabularnewline
102 & 0.045 & 0.0605 & 0.0383 & 0.0392 & 201824.1408 & 94573.427 & 307.5279 & 6.669 & 4.1706 \tabularnewline
103 & 0.0471 & 0.0677 & 0.0408 & 0.0418 & 256138.509 & 108037.1838 & 328.6901 & 7.513 & 4.4491 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302764&T=2

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast Performance[/C][/ROW]
[ROW][C]time[/C][C]% S.E.[/C][C]PE[/C][C]MAPE[/C][C]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]92[/C][C]0.0127[/C][C]0.0063[/C][C]0.0063[/C][C]0.0063[/C][C]1971.0564[/C][C]0[/C][C]0[/C][C]0.6591[/C][C]0.6591[/C][/ROW]
[ROW][C]93[/C][C]0.0184[/C][C]0.0127[/C][C]0.0095[/C][C]0.0095[/C][C]8105.8489[/C][C]5038.4526[/C][C]70.9821[/C][C]1.3365[/C][C]0.9978[/C][/ROW]
[ROW][C]94[/C][C]0.0228[/C][C]0.0327[/C][C]0.0172[/C][C]0.0174[/C][C]55936.494[/C][C]22004.4664[/C][C]148.339[/C][C]3.5109[/C][C]1.8355[/C][/ROW]
[ROW][C]95[/C][C]0.0265[/C][C]0.0315[/C][C]0.0208[/C][C]0.0211[/C][C]51953.2675[/C][C]29491.6667[/C][C]171.7314[/C][C]3.3836[/C][C]2.2225[/C][/ROW]
[ROW][C]96[/C][C]0.0298[/C][C]0.0355[/C][C]0.0237[/C][C]0.0241[/C][C]66366.5861[/C][C]36866.6506[/C][C]192.0069[/C][C]3.8243[/C][C]2.5429[/C][/ROW]
[ROW][C]97[/C][C]0.0328[/C][C]0.0386[/C][C]0.0262[/C][C]0.0266[/C][C]79068.2628[/C][C]43900.2526[/C][C]209.5239[/C][C]4.1742[/C][C]2.8148[/C][/ROW]
[ROW][C]98[/C][C]0.0355[/C][C]0.0484[/C][C]0.0294[/C][C]0.0299[/C][C]126851.1691[/C][C]55750.3835[/C][C]236.1152[/C][C]5.2872[/C][C]3.168[/C][/ROW]
[ROW][C]99[/C][C]0.0381[/C][C]0.0585[/C][C]0.033[/C][C]0.0337[/C][C]188630.7274[/C][C]72360.4265[/C][C]268.9989[/C][C]6.4473[/C][C]3.5779[/C][/ROW]
[ROW][C]100[/C][C]0.0405[/C][C]0.0553[/C][C]0.0355[/C][C]0.0363[/C][C]166859.79[/C][C]82860.3558[/C][C]287.8547[/C][C]6.0639[/C][C]3.8541[/C][/ROW]
[ROW][C]101[/C][C]0.0428[/C][C]0.0418[/C][C]0.0361[/C][C]0.0369[/C][C]92740.3542[/C][C]83848.3556[/C][C]289.5658[/C][C]4.5207[/C][C]3.9208[/C][/ROW]
[ROW][C]102[/C][C]0.045[/C][C]0.0605[/C][C]0.0383[/C][C]0.0392[/C][C]201824.1408[/C][C]94573.427[/C][C]307.5279[/C][C]6.669[/C][C]4.1706[/C][/ROW]
[ROW][C]103[/C][C]0.0471[/C][C]0.0677[/C][C]0.0408[/C][C]0.0418[/C][C]256138.509[/C][C]108037.1838[/C][C]328.6901[/C][C]7.513[/C][C]4.4491[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302764&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302764&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
920.01270.00630.00630.00631971.0564000.65910.6591
930.01840.01270.00950.00958105.84895038.452670.98211.33650.9978
940.02280.03270.01720.017455936.49422004.4664148.3393.51091.8355
950.02650.03150.02080.021151953.267529491.6667171.73143.38362.2225
960.02980.03550.02370.024166366.586136866.6506192.00693.82432.5429
970.03280.03860.02620.026679068.262843900.2526209.52394.17422.8148
980.03550.04840.02940.0299126851.169155750.3835236.11525.28723.168
990.03810.05850.0330.0337188630.727472360.4265268.99896.44733.5779
1000.04050.05530.03550.0363166859.7982860.3558287.85476.06393.8541
1010.04280.04180.03610.036992740.354283848.3556289.56584.52073.9208
1020.0450.06050.03830.0392201824.140894573.427307.52796.6694.1706
1030.04710.06770.04080.0418256138.509108037.1838328.69017.5134.4491



Parameters (Session):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 2 ; par9 = 0 ; par10 = TRUE ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 2 ; par9 = 0 ; par10 = TRUE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '2'
par7 <- '1'
par6 <- '0'
par5 <- '12'
par4 <- '0'
par3 <- '1'
par2 <- '1'
par1 <- '12'
par1 <- as.numeric(par1) #cut off periods
par2 <- as.numeric(par2) #lambda
par3 <- as.numeric(par3) #degree of non-seasonal differencing
par4 <- as.numeric(par4) #degree of seasonal differencing
par5 <- as.numeric(par5) #seasonal period
par6 <- as.numeric(par6) #p
par7 <- as.numeric(par7) #q
par8 <- as.numeric(par8) #P
par9 <- as.numeric(par9) #Q
if (par10 == 'TRUE') par10 <- TRUE
if (par10 == 'FALSE') par10 <- FALSE
if (par2 == 0) x <- log(x)
if (par2 != 0) x <- x^par2
lx <- length(x)
first <- lx - 2*par1
nx <- lx - par1
nx1 <- nx + 1
fx <- lx - nx
if (fx < 1) {
fx <- par5*2
nx1 <- lx + fx - 1
first <- lx - 2*fx
}
first <- 1
if (fx < 3) fx <- round(lx/10,0)
(arima.out <- arima(x[1:nx], order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5), include.mean=par10, method='ML'))
(forecast <- predict(arima.out,fx))
(lb <- forecast$pred - 1.96 * forecast$se)
(ub <- forecast$pred + 1.96 * forecast$se)
if (par2 == 0) {
x <- exp(x)
forecast$pred <- exp(forecast$pred)
lb <- exp(lb)
ub <- exp(ub)
}
if (par2 != 0) {
x <- x^(1/par2)
forecast$pred <- forecast$pred^(1/par2)
lb <- lb^(1/par2)
ub <- ub^(1/par2)
}
if (par2 < 0) {
olb <- lb
lb <- ub
ub <- olb
}
(actandfor <- c(x[1:nx], forecast$pred))
(perc.se <- (ub-forecast$pred)/1.96/forecast$pred)
bitmap(file='test1.png')
opar <- par(mar=c(4,4,2,2),las=1)
ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub))
plot(x,ylim=ylim,type='n',xlim=c(first,lx))
usr <- par('usr')
rect(usr[1],usr[3],nx+1,usr[4],border=NA,col='lemonchiffon')
rect(nx1,usr[3],usr[2],usr[4],border=NA,col='lavender')
abline(h= (-3:3)*2 , col ='gray', lty =3)
polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = 'orange', lty=2,border=NA)
lines(nx1:lx, lb , lty=2)
lines(nx1:lx, ub , lty=2)
lines(x, lwd=2)
lines(nx1:lx, forecast$pred , lwd=2 , col ='white')
box()
par(opar)
dev.off()
prob.dec <- array(NA, dim=fx)
prob.sdec <- array(NA, dim=fx)
prob.ldec <- array(NA, dim=fx)
prob.pval <- array(NA, dim=fx)
perf.pe <- array(0, dim=fx)
perf.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- array(0,dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+i] + forecast$pred[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD)
prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD)
prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD)
prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD)
}
perf.mape[1] = abs(perf.pe[1])
perf.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[1]
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[i] / i
}
perf.rmse = sqrt(perf.mse1)
bitmap(file='test2.png')
plot(forecast$pred, pch=19, type='b',main='ARIMA Extrapolation Forecast', ylab='Forecast and 95% CI', xlab='time',ylim=c(min(lb),max(ub)))
dum <- forecast$pred
dum[1:par1] <- x[(nx+1):lx]
lines(dum, lty=1)
lines(ub,lty=3)
lines(lb,lty=3)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast',9,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'Y[t]',1,header=TRUE)
a<-table.element(a,'F[t]',1,header=TRUE)
a<-table.element(a,'95% LB',1,header=TRUE)
a<-table.element(a,'95% UB',1,header=TRUE)
a<-table.element(a,'p-value
(H0: Y[t] = F[t])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-1])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-s])',1,header=TRUE)
mylab <- paste('P(F[t]>Y[',nx,sep='')
mylab <- paste(mylab,'])',sep='')
a<-table.element(a,mylab,1,header=TRUE)
a<-table.row.end(a)
for (i in (nx-par5):nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.row.end(a)
}
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(x[nx+i],4))
a<-table.element(a,round(forecast$pred[i],4))
a<-table.element(a,round(lb[i],4))
a<-table.element(a,round(ub[i],4))
a<-table.element(a,round((1-prob.pval[i]),4))
a<-table.element(a,round((1-prob.dec[i]),4))
a<-table.element(a,round((1-prob.sdec[i]),4))
a<-table.element(a,round((1-prob.ldec[i]),4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast Performance',10,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'% S.E.',1,header=TRUE)
a<-table.element(a,'PE',1,header=TRUE)
a<-table.element(a,'MAPE',1,header=TRUE)
a<-table.element(a,'sMAPE',1,header=TRUE)
a<-table.element(a,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',1,header=TRUE)
a<-table.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',1,header=TRUE)
a<-table.row.end(a)
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(perc.se[i],4))
a<-table.element(a,round(perf.pe[i],4))
a<-table.element(a,round(perf.mape1[i],4))
a<-table.element(a,round(perf.smape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')