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 computationWed, 21 Dec 2016 17:01:37 +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/21/t1482336728b9mdph8c3df37si.htm/, Retrieved Mon, 06 May 2024 16:09:10 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302410, Retrieved Mon, 06 May 2024 16:09:10 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact62
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [qdfs] [2016-12-21 13:53:59] [1079278829d32116c208b17b704dd29b]
- RMP     [ARIMA Forecasting] [dgq] [2016-12-21 16:01:37] [6db9e6f0306aa16a744aea8c8a65c446] [Current]
Feedback Forum

Post a new message
Dataseries X:
2850
2360
2880
3000
3120
2910
3380
3730
2960
4070
4660
3880
4190
4140
4060
4250
4380
4780
4460
4820
4580
4630
5030
4370
4240
4220
4070
4290
4340
4250
4520
4680
4200
4490
4840
3840
3940
3510
3240
3410
3290
3190
3790
4090
4180
5020
5910
5850
6660
6950
6850
6360
5600
5290
5630
5410
5020
5070
5370
4860
4440
4220
3720
3650
3650
3040
3530
3520
3030
2920
3530
2920
3520
3380
2920
3000
2860
2760
2810
3400
2730
2670
2900
2240
2920
2650
2370
2560
2430
1930
2360
2470
2720
2750
3010
2610
3440
3540
2790
3060
3050
3000
3200
3530
3640
3830
4460
3420
5180
5310
4870
4550
4510
4380
5260
5270
4610
4840
5050
4760
5210
5540
4830
5210
5320
5150




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302410&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]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302410&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302410&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 time2 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[114])
1023000-------
1033200-------
1043530-------
1053640-------
1063830-------
1074460-------
1083420-------
1095180-------
1105310-------
1114870-------
1124550-------
1134510-------
1144380-------
11552604658.61923936.13055428.99640.0630.76080.99990.7608
11652704901.80323872.22666026.21580.26050.26620.99160.8185
11746104819.02933580.7876200.06060.38340.26110.95290.7334
11848404922.8543492.93866542.40170.46010.64750.9070.7444
11950505353.67293707.66087232.82080.37570.70390.82440.8451
12047604672.80732989.18386644.08520.46550.35380.89360.6145
12152105628.10543663.11677916.38990.36010.77140.64940.8575
12255405616.29113530.25338072.06840.47570.62710.59660.8381
12348305171.88333054.17017712.69760.3960.38820.59210.7294
12452105167.09192948.69177855.83910.48750.59710.67360.7169
12553205094.91472796.4927912.36950.43780.46810.6580.6905
12651504899.88962556.39177814.33050.43320.38880.63670.6367

\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[114]) \tabularnewline
102 & 3000 & - & - & - & - & - & - & - \tabularnewline
103 & 3200 & - & - & - & - & - & - & - \tabularnewline
104 & 3530 & - & - & - & - & - & - & - \tabularnewline
105 & 3640 & - & - & - & - & - & - & - \tabularnewline
106 & 3830 & - & - & - & - & - & - & - \tabularnewline
107 & 4460 & - & - & - & - & - & - & - \tabularnewline
108 & 3420 & - & - & - & - & - & - & - \tabularnewline
109 & 5180 & - & - & - & - & - & - & - \tabularnewline
110 & 5310 & - & - & - & - & - & - & - \tabularnewline
111 & 4870 & - & - & - & - & - & - & - \tabularnewline
112 & 4550 & - & - & - & - & - & - & - \tabularnewline
113 & 4510 & - & - & - & - & - & - & - \tabularnewline
114 & 4380 & - & - & - & - & - & - & - \tabularnewline
115 & 5260 & 4658.6192 & 3936.1305 & 5428.9964 & 0.063 & 0.7608 & 0.9999 & 0.7608 \tabularnewline
116 & 5270 & 4901.8032 & 3872.2266 & 6026.2158 & 0.2605 & 0.2662 & 0.9916 & 0.8185 \tabularnewline
117 & 4610 & 4819.0293 & 3580.787 & 6200.0606 & 0.3834 & 0.2611 & 0.9529 & 0.7334 \tabularnewline
118 & 4840 & 4922.854 & 3492.9386 & 6542.4017 & 0.4601 & 0.6475 & 0.907 & 0.7444 \tabularnewline
119 & 5050 & 5353.6729 & 3707.6608 & 7232.8208 & 0.3757 & 0.7039 & 0.8244 & 0.8451 \tabularnewline
120 & 4760 & 4672.8073 & 2989.1838 & 6644.0852 & 0.4655 & 0.3538 & 0.8936 & 0.6145 \tabularnewline
121 & 5210 & 5628.1054 & 3663.1167 & 7916.3899 & 0.3601 & 0.7714 & 0.6494 & 0.8575 \tabularnewline
122 & 5540 & 5616.2911 & 3530.2533 & 8072.0684 & 0.4757 & 0.6271 & 0.5966 & 0.8381 \tabularnewline
123 & 4830 & 5171.8833 & 3054.1701 & 7712.6976 & 0.396 & 0.3882 & 0.5921 & 0.7294 \tabularnewline
124 & 5210 & 5167.0919 & 2948.6917 & 7855.8391 & 0.4875 & 0.5971 & 0.6736 & 0.7169 \tabularnewline
125 & 5320 & 5094.9147 & 2796.492 & 7912.3695 & 0.4378 & 0.4681 & 0.658 & 0.6905 \tabularnewline
126 & 5150 & 4899.8896 & 2556.3917 & 7814.3305 & 0.4332 & 0.3888 & 0.6367 & 0.6367 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302410&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[114])[/C][/ROW]
[ROW][C]102[/C][C]3000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]3200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]3530[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]3640[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]3830[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]4460[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]3420[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]5180[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]5310[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]4870[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]4550[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]4510[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]4380[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]5260[/C][C]4658.6192[/C][C]3936.1305[/C][C]5428.9964[/C][C]0.063[/C][C]0.7608[/C][C]0.9999[/C][C]0.7608[/C][/ROW]
[ROW][C]116[/C][C]5270[/C][C]4901.8032[/C][C]3872.2266[/C][C]6026.2158[/C][C]0.2605[/C][C]0.2662[/C][C]0.9916[/C][C]0.8185[/C][/ROW]
[ROW][C]117[/C][C]4610[/C][C]4819.0293[/C][C]3580.787[/C][C]6200.0606[/C][C]0.3834[/C][C]0.2611[/C][C]0.9529[/C][C]0.7334[/C][/ROW]
[ROW][C]118[/C][C]4840[/C][C]4922.854[/C][C]3492.9386[/C][C]6542.4017[/C][C]0.4601[/C][C]0.6475[/C][C]0.907[/C][C]0.7444[/C][/ROW]
[ROW][C]119[/C][C]5050[/C][C]5353.6729[/C][C]3707.6608[/C][C]7232.8208[/C][C]0.3757[/C][C]0.7039[/C][C]0.8244[/C][C]0.8451[/C][/ROW]
[ROW][C]120[/C][C]4760[/C][C]4672.8073[/C][C]2989.1838[/C][C]6644.0852[/C][C]0.4655[/C][C]0.3538[/C][C]0.8936[/C][C]0.6145[/C][/ROW]
[ROW][C]121[/C][C]5210[/C][C]5628.1054[/C][C]3663.1167[/C][C]7916.3899[/C][C]0.3601[/C][C]0.7714[/C][C]0.6494[/C][C]0.8575[/C][/ROW]
[ROW][C]122[/C][C]5540[/C][C]5616.2911[/C][C]3530.2533[/C][C]8072.0684[/C][C]0.4757[/C][C]0.6271[/C][C]0.5966[/C][C]0.8381[/C][/ROW]
[ROW][C]123[/C][C]4830[/C][C]5171.8833[/C][C]3054.1701[/C][C]7712.6976[/C][C]0.396[/C][C]0.3882[/C][C]0.5921[/C][C]0.7294[/C][/ROW]
[ROW][C]124[/C][C]5210[/C][C]5167.0919[/C][C]2948.6917[/C][C]7855.8391[/C][C]0.4875[/C][C]0.5971[/C][C]0.6736[/C][C]0.7169[/C][/ROW]
[ROW][C]125[/C][C]5320[/C][C]5094.9147[/C][C]2796.492[/C][C]7912.3695[/C][C]0.4378[/C][C]0.4681[/C][C]0.658[/C][C]0.6905[/C][/ROW]
[ROW][C]126[/C][C]5150[/C][C]4899.8896[/C][C]2556.3917[/C][C]7814.3305[/C][C]0.4332[/C][C]0.3888[/C][C]0.6367[/C][C]0.6367[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302410&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302410&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[114])
1023000-------
1033200-------
1043530-------
1053640-------
1063830-------
1074460-------
1083420-------
1095180-------
1105310-------
1114870-------
1124550-------
1134510-------
1144380-------
11552604658.61923936.13055428.99640.0630.76080.99990.7608
11652704901.80323872.22666026.21580.26050.26620.99160.8185
11746104819.02933580.7876200.06060.38340.26110.95290.7334
11848404922.8543492.93866542.40170.46010.64750.9070.7444
11950505353.67293707.66087232.82080.37570.70390.82440.8451
12047604672.80732989.18386644.08520.46550.35380.89360.6145
12152105628.10543663.11677916.38990.36010.77140.64940.8575
12255405616.29113530.25338072.06840.47570.62710.59660.8381
12348305171.88333054.17017712.69760.3960.38820.59210.7294
12452105167.09192948.69177855.83910.48750.59710.67360.7169
12553205094.91472796.4927912.36950.43780.46810.6580.6905
12651504899.88962556.39177814.33050.43320.38880.63670.6367







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.08440.11430.11430.1213361658.8899001.86341.8634
1160.1170.06990.09210.0968135568.9133248613.9016498.6121.14091.5022
1170.1462-0.04530.07650.079343693.2515180307.0182424.6257-0.64771.2173
1180.1678-0.01710.06170.06376864.7931136946.4619370.0628-0.25670.9772
1190.1791-0.06010.06140.062792217.2312128000.6158357.7717-0.9410.9699
1200.21520.01830.05420.05537602.5693107934.2747328.53350.27020.8533
1210.2074-0.08030.05790.0584174812.1461117488.2563342.7656-1.29550.9165
1220.2231-0.01380.05240.05285820.329103529.7654321.7604-0.23640.8315
1230.2507-0.07080.05440.0546116884.185105013.5898324.058-1.05940.8568
1240.26550.00820.04980.04991841.102294696.3411307.72770.1330.7844
1250.28210.04230.04910.049350663.38790693.3452301.15340.69740.7765
1260.30350.04860.04910.049462555.196588348.4995297.23480.7750.7764

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
115 & 0.0844 & 0.1143 & 0.1143 & 0.1213 & 361658.8899 & 0 & 0 & 1.8634 & 1.8634 \tabularnewline
116 & 0.117 & 0.0699 & 0.0921 & 0.0968 & 135568.9133 & 248613.9016 & 498.612 & 1.1409 & 1.5022 \tabularnewline
117 & 0.1462 & -0.0453 & 0.0765 & 0.0793 & 43693.2515 & 180307.0182 & 424.6257 & -0.6477 & 1.2173 \tabularnewline
118 & 0.1678 & -0.0171 & 0.0617 & 0.0637 & 6864.7931 & 136946.4619 & 370.0628 & -0.2567 & 0.9772 \tabularnewline
119 & 0.1791 & -0.0601 & 0.0614 & 0.0627 & 92217.2312 & 128000.6158 & 357.7717 & -0.941 & 0.9699 \tabularnewline
120 & 0.2152 & 0.0183 & 0.0542 & 0.0553 & 7602.5693 & 107934.2747 & 328.5335 & 0.2702 & 0.8533 \tabularnewline
121 & 0.2074 & -0.0803 & 0.0579 & 0.0584 & 174812.1461 & 117488.2563 & 342.7656 & -1.2955 & 0.9165 \tabularnewline
122 & 0.2231 & -0.0138 & 0.0524 & 0.0528 & 5820.329 & 103529.7654 & 321.7604 & -0.2364 & 0.8315 \tabularnewline
123 & 0.2507 & -0.0708 & 0.0544 & 0.0546 & 116884.185 & 105013.5898 & 324.058 & -1.0594 & 0.8568 \tabularnewline
124 & 0.2655 & 0.0082 & 0.0498 & 0.0499 & 1841.1022 & 94696.3411 & 307.7277 & 0.133 & 0.7844 \tabularnewline
125 & 0.2821 & 0.0423 & 0.0491 & 0.0493 & 50663.387 & 90693.3452 & 301.1534 & 0.6974 & 0.7765 \tabularnewline
126 & 0.3035 & 0.0486 & 0.0491 & 0.0494 & 62555.1965 & 88348.4995 & 297.2348 & 0.775 & 0.7764 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302410&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]115[/C][C]0.0844[/C][C]0.1143[/C][C]0.1143[/C][C]0.1213[/C][C]361658.8899[/C][C]0[/C][C]0[/C][C]1.8634[/C][C]1.8634[/C][/ROW]
[ROW][C]116[/C][C]0.117[/C][C]0.0699[/C][C]0.0921[/C][C]0.0968[/C][C]135568.9133[/C][C]248613.9016[/C][C]498.612[/C][C]1.1409[/C][C]1.5022[/C][/ROW]
[ROW][C]117[/C][C]0.1462[/C][C]-0.0453[/C][C]0.0765[/C][C]0.0793[/C][C]43693.2515[/C][C]180307.0182[/C][C]424.6257[/C][C]-0.6477[/C][C]1.2173[/C][/ROW]
[ROW][C]118[/C][C]0.1678[/C][C]-0.0171[/C][C]0.0617[/C][C]0.0637[/C][C]6864.7931[/C][C]136946.4619[/C][C]370.0628[/C][C]-0.2567[/C][C]0.9772[/C][/ROW]
[ROW][C]119[/C][C]0.1791[/C][C]-0.0601[/C][C]0.0614[/C][C]0.0627[/C][C]92217.2312[/C][C]128000.6158[/C][C]357.7717[/C][C]-0.941[/C][C]0.9699[/C][/ROW]
[ROW][C]120[/C][C]0.2152[/C][C]0.0183[/C][C]0.0542[/C][C]0.0553[/C][C]7602.5693[/C][C]107934.2747[/C][C]328.5335[/C][C]0.2702[/C][C]0.8533[/C][/ROW]
[ROW][C]121[/C][C]0.2074[/C][C]-0.0803[/C][C]0.0579[/C][C]0.0584[/C][C]174812.1461[/C][C]117488.2563[/C][C]342.7656[/C][C]-1.2955[/C][C]0.9165[/C][/ROW]
[ROW][C]122[/C][C]0.2231[/C][C]-0.0138[/C][C]0.0524[/C][C]0.0528[/C][C]5820.329[/C][C]103529.7654[/C][C]321.7604[/C][C]-0.2364[/C][C]0.8315[/C][/ROW]
[ROW][C]123[/C][C]0.2507[/C][C]-0.0708[/C][C]0.0544[/C][C]0.0546[/C][C]116884.185[/C][C]105013.5898[/C][C]324.058[/C][C]-1.0594[/C][C]0.8568[/C][/ROW]
[ROW][C]124[/C][C]0.2655[/C][C]0.0082[/C][C]0.0498[/C][C]0.0499[/C][C]1841.1022[/C][C]94696.3411[/C][C]307.7277[/C][C]0.133[/C][C]0.7844[/C][/ROW]
[ROW][C]125[/C][C]0.2821[/C][C]0.0423[/C][C]0.0491[/C][C]0.0493[/C][C]50663.387[/C][C]90693.3452[/C][C]301.1534[/C][C]0.6974[/C][C]0.7765[/C][/ROW]
[ROW][C]126[/C][C]0.3035[/C][C]0.0486[/C][C]0.0491[/C][C]0.0494[/C][C]62555.1965[/C][C]88348.4995[/C][C]297.2348[/C][C]0.775[/C][C]0.7764[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302410&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302410&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
1150.08440.11430.11430.1213361658.8899001.86341.8634
1160.1170.06990.09210.0968135568.9133248613.9016498.6121.14091.5022
1170.1462-0.04530.07650.079343693.2515180307.0182424.6257-0.64771.2173
1180.1678-0.01710.06170.06376864.7931136946.4619370.0628-0.25670.9772
1190.1791-0.06010.06140.062792217.2312128000.6158357.7717-0.9410.9699
1200.21520.01830.05420.05537602.5693107934.2747328.53350.27020.8533
1210.2074-0.08030.05790.0584174812.1461117488.2563342.7656-1.29550.9165
1220.2231-0.01380.05240.05285820.329103529.7654321.7604-0.23640.8315
1230.2507-0.07080.05440.0546116884.185105013.5898324.058-1.05940.8568
1240.26550.00820.04980.04991841.102294696.3411307.72770.1330.7844
1250.28210.04230.04910.049350663.38790693.3452301.15340.69740.7765
1260.30350.04860.04910.049462555.196588348.4995297.23480.7750.7764



Parameters (Session):
par1 = 12 ; par2 = 0.6 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 0.6 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
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')