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 computationThu, 21 Dec 2017 11:01: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/2017/Dec/21/t1513850935g9qbfg0e6zntetn.htm/, Retrieved Tue, 14 May 2024 19:16:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310599, Retrieved Tue, 14 May 2024 19:16:23 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact99
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA] [2017-12-21 10:01:54] [bd83e7d2022b632a928e3cc7dd68d98c] [Current]
Feedback Forum

Post a new message
Dataseries X:
58.5
59.8
64.6
62.2
68
64.3
58.9
64.8
67.5
76.2
73.7
70.4
67.7
63.7
72.4
66
70.1
70.4
66.6
72.6
74
79
76.1
72.3
71.6
67.2
73.8
70.8
71.4
70.4
70.7
70.6
75.5
82.1
74.3
76.3
74.5
71.1
73.3
73.8
69
71.1
71.9
69
77.3
82.8
74
77.6
72.3
70.7
81
76.4
72.3
79.5
73.3
74.5
82.7
83.8
81.6
85.5
76.7
71.8
80.2
76.8
76.1
80.7
71.3
80.9
85
84.5
87.7
87.7
80.2
74.4
85.8
77
84.5
83.6
77.7
85.7
87.9
93.7
92.3
87
89.1
81.3
92.7
83.9
87.3
89.1
86.9
91.7
93
105.3
101.6
94.2
100.5
95.8
95.8
102.1
96
96.8
98.9
93.4
105.5
110.9
98.6
102.6
93.5
90.8
99.7
97.8
91.1
98.1
96
93.5
101.2
105.2
98.9
101.3
92.1
90.6
105.4
98.4
92.7
101.2
93.4
98.3
104.3
107
107.7
108.9
99.6
96.1
109
99.5
104.6
99.9
94.1
105.3
110.4
110.5
110
108.5
104.3
101.2
109.2
99.6
105.6
106.2
102.2
107.5
105.8
120.5
113.2
104.3
107.7
99.2
105.1
104.3
106.1
100.8
106.7
101.6
104.4
114.8
105.4
104
102
96.5
102.3
105.3
101.9
102.2
102.8
100.4
110.7
116.4
106
109.2
103
99.8
109.8
107.3
101.2
111.8
106.9
103.5
113.1
119.4
113.3
115
104.7
107.2
116.6
111.3
111.4
115
102.4
111.4
113.2
112.9
114.2
115.6
107.1
102.3
117.9
105.8
114.3
113.1
102.9
112.2




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310599&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 time4 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[200])
188103.5-------
189113.1-------
190119.4-------
191113.3-------
192115-------
193104.7-------
194107.2-------
195116.6-------
196111.3-------
197111.4-------
198115-------
199102.4-------
200111.4-------
201113.2115.8384109.1304122.74650.22710.8960.78140.896
202112.9122.8766115.9643129.98890.0030.99620.8310.9992
203114.2117.275110.1298124.64480.20670.87770.85480.9409
204115.6116.7757109.4772124.30970.37990.74860.67790.919
205107.1111.8646104.509119.47040.10980.16790.96760.5477
206102.3107.8236100.4155115.49530.07910.57330.56330.1804
207117.9117.0675109.1443125.26830.42110.99980.54450.9122
208105.8112.7562104.7954121.00830.04920.11090.63530.6263
209114.3112.6303104.4908121.07510.34920.94350.61240.6124
210113.1114.6813106.2861123.39550.3610.53420.47140.7697
211102.9110.6031102.1882119.35090.04220.28790.9670.4291
212112.2113.6181104.9153122.66770.37940.98990.68450.6845

\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[200]) \tabularnewline
188 & 103.5 & - & - & - & - & - & - & - \tabularnewline
189 & 113.1 & - & - & - & - & - & - & - \tabularnewline
190 & 119.4 & - & - & - & - & - & - & - \tabularnewline
191 & 113.3 & - & - & - & - & - & - & - \tabularnewline
192 & 115 & - & - & - & - & - & - & - \tabularnewline
193 & 104.7 & - & - & - & - & - & - & - \tabularnewline
194 & 107.2 & - & - & - & - & - & - & - \tabularnewline
195 & 116.6 & - & - & - & - & - & - & - \tabularnewline
196 & 111.3 & - & - & - & - & - & - & - \tabularnewline
197 & 111.4 & - & - & - & - & - & - & - \tabularnewline
198 & 115 & - & - & - & - & - & - & - \tabularnewline
199 & 102.4 & - & - & - & - & - & - & - \tabularnewline
200 & 111.4 & - & - & - & - & - & - & - \tabularnewline
201 & 113.2 & 115.8384 & 109.1304 & 122.7465 & 0.2271 & 0.896 & 0.7814 & 0.896 \tabularnewline
202 & 112.9 & 122.8766 & 115.9643 & 129.9889 & 0.003 & 0.9962 & 0.831 & 0.9992 \tabularnewline
203 & 114.2 & 117.275 & 110.1298 & 124.6448 & 0.2067 & 0.8777 & 0.8548 & 0.9409 \tabularnewline
204 & 115.6 & 116.7757 & 109.4772 & 124.3097 & 0.3799 & 0.7486 & 0.6779 & 0.919 \tabularnewline
205 & 107.1 & 111.8646 & 104.509 & 119.4704 & 0.1098 & 0.1679 & 0.9676 & 0.5477 \tabularnewline
206 & 102.3 & 107.8236 & 100.4155 & 115.4953 & 0.0791 & 0.5733 & 0.5633 & 0.1804 \tabularnewline
207 & 117.9 & 117.0675 & 109.1443 & 125.2683 & 0.4211 & 0.9998 & 0.5445 & 0.9122 \tabularnewline
208 & 105.8 & 112.7562 & 104.7954 & 121.0083 & 0.0492 & 0.1109 & 0.6353 & 0.6263 \tabularnewline
209 & 114.3 & 112.6303 & 104.4908 & 121.0751 & 0.3492 & 0.9435 & 0.6124 & 0.6124 \tabularnewline
210 & 113.1 & 114.6813 & 106.2861 & 123.3955 & 0.361 & 0.5342 & 0.4714 & 0.7697 \tabularnewline
211 & 102.9 & 110.6031 & 102.1882 & 119.3509 & 0.0422 & 0.2879 & 0.967 & 0.4291 \tabularnewline
212 & 112.2 & 113.6181 & 104.9153 & 122.6677 & 0.3794 & 0.9899 & 0.6845 & 0.6845 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310599&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[200])[/C][/ROW]
[ROW][C]188[/C][C]103.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]113.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]119.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]113.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]104.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]107.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]116.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]111.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]111.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]102.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]111.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]113.2[/C][C]115.8384[/C][C]109.1304[/C][C]122.7465[/C][C]0.2271[/C][C]0.896[/C][C]0.7814[/C][C]0.896[/C][/ROW]
[ROW][C]202[/C][C]112.9[/C][C]122.8766[/C][C]115.9643[/C][C]129.9889[/C][C]0.003[/C][C]0.9962[/C][C]0.831[/C][C]0.9992[/C][/ROW]
[ROW][C]203[/C][C]114.2[/C][C]117.275[/C][C]110.1298[/C][C]124.6448[/C][C]0.2067[/C][C]0.8777[/C][C]0.8548[/C][C]0.9409[/C][/ROW]
[ROW][C]204[/C][C]115.6[/C][C]116.7757[/C][C]109.4772[/C][C]124.3097[/C][C]0.3799[/C][C]0.7486[/C][C]0.6779[/C][C]0.919[/C][/ROW]
[ROW][C]205[/C][C]107.1[/C][C]111.8646[/C][C]104.509[/C][C]119.4704[/C][C]0.1098[/C][C]0.1679[/C][C]0.9676[/C][C]0.5477[/C][/ROW]
[ROW][C]206[/C][C]102.3[/C][C]107.8236[/C][C]100.4155[/C][C]115.4953[/C][C]0.0791[/C][C]0.5733[/C][C]0.5633[/C][C]0.1804[/C][/ROW]
[ROW][C]207[/C][C]117.9[/C][C]117.0675[/C][C]109.1443[/C][C]125.2683[/C][C]0.4211[/C][C]0.9998[/C][C]0.5445[/C][C]0.9122[/C][/ROW]
[ROW][C]208[/C][C]105.8[/C][C]112.7562[/C][C]104.7954[/C][C]121.0083[/C][C]0.0492[/C][C]0.1109[/C][C]0.6353[/C][C]0.6263[/C][/ROW]
[ROW][C]209[/C][C]114.3[/C][C]112.6303[/C][C]104.4908[/C][C]121.0751[/C][C]0.3492[/C][C]0.9435[/C][C]0.6124[/C][C]0.6124[/C][/ROW]
[ROW][C]210[/C][C]113.1[/C][C]114.6813[/C][C]106.2861[/C][C]123.3955[/C][C]0.361[/C][C]0.5342[/C][C]0.4714[/C][C]0.7697[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]110.6031[/C][C]102.1882[/C][C]119.3509[/C][C]0.0422[/C][C]0.2879[/C][C]0.967[/C][C]0.4291[/C][/ROW]
[ROW][C]212[/C][C]112.2[/C][C]113.6181[/C][C]104.9153[/C][C]122.6677[/C][C]0.3794[/C][C]0.9899[/C][C]0.6845[/C][C]0.6845[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310599&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310599&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[200])
188103.5-------
189113.1-------
190119.4-------
191113.3-------
192115-------
193104.7-------
194107.2-------
195116.6-------
196111.3-------
197111.4-------
198115-------
199102.4-------
200111.4-------
201113.2115.8384109.1304122.74650.22710.8960.78140.896
202112.9122.8766115.9643129.98890.0030.99620.8310.9992
203114.2117.275110.1298124.64480.20670.87770.85480.9409
204115.6116.7757109.4772124.30970.37990.74860.67790.919
205107.1111.8646104.509119.47040.10980.16790.96760.5477
206102.3107.8236100.4155115.49530.07910.57330.56330.1804
207117.9117.0675109.1443125.26830.42110.99980.54450.9122
208105.8112.7562104.7954121.00830.04920.11090.63530.6263
209114.3112.6303104.4908121.07510.34920.94350.61240.6124
210113.1114.6813106.2861123.39550.3610.53420.47140.7697
211102.9110.6031102.1882119.35090.04220.28790.9670.4291
212112.2113.6181104.9153122.66770.37940.98990.68450.6845







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0304-0.02330.02330.0236.961100-0.39650.3965
2020.0295-0.08840.05580.053899.531853.24647.297-1.49920.9478
2030.0321-0.02690.04620.04479.455738.64956.2169-0.46210.7859
2040.0329-0.01020.03720.03611.382229.33275.416-0.17670.6336
2050.0347-0.04450.03870.037622.701628.00655.2921-0.7160.6501
2060.0363-0.0540.04120.040130.510228.42385.3314-0.830.6801
2070.03570.00710.03630.03540.693124.46224.94590.12510.6008
2080.0373-0.06570.040.038948.38827.4535.2396-1.04530.6564
2090.03830.01460.03720.03622.787824.71244.97120.25090.6113
2100.0388-0.0140.03490.0342.500422.49124.7425-0.23760.5739
2110.0404-0.07490.03850.037459.338325.84095.0834-1.15760.627
2120.0406-0.01260.03630.03542.011123.85514.8842-0.21310.5925

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
201 & 0.0304 & -0.0233 & 0.0233 & 0.023 & 6.9611 & 0 & 0 & -0.3965 & 0.3965 \tabularnewline
202 & 0.0295 & -0.0884 & 0.0558 & 0.0538 & 99.5318 & 53.2464 & 7.297 & -1.4992 & 0.9478 \tabularnewline
203 & 0.0321 & -0.0269 & 0.0462 & 0.0447 & 9.4557 & 38.6495 & 6.2169 & -0.4621 & 0.7859 \tabularnewline
204 & 0.0329 & -0.0102 & 0.0372 & 0.0361 & 1.3822 & 29.3327 & 5.416 & -0.1767 & 0.6336 \tabularnewline
205 & 0.0347 & -0.0445 & 0.0387 & 0.0376 & 22.7016 & 28.0065 & 5.2921 & -0.716 & 0.6501 \tabularnewline
206 & 0.0363 & -0.054 & 0.0412 & 0.0401 & 30.5102 & 28.4238 & 5.3314 & -0.83 & 0.6801 \tabularnewline
207 & 0.0357 & 0.0071 & 0.0363 & 0.0354 & 0.6931 & 24.4622 & 4.9459 & 0.1251 & 0.6008 \tabularnewline
208 & 0.0373 & -0.0657 & 0.04 & 0.0389 & 48.388 & 27.453 & 5.2396 & -1.0453 & 0.6564 \tabularnewline
209 & 0.0383 & 0.0146 & 0.0372 & 0.0362 & 2.7878 & 24.7124 & 4.9712 & 0.2509 & 0.6113 \tabularnewline
210 & 0.0388 & -0.014 & 0.0349 & 0.034 & 2.5004 & 22.4912 & 4.7425 & -0.2376 & 0.5739 \tabularnewline
211 & 0.0404 & -0.0749 & 0.0385 & 0.0374 & 59.3383 & 25.8409 & 5.0834 & -1.1576 & 0.627 \tabularnewline
212 & 0.0406 & -0.0126 & 0.0363 & 0.0354 & 2.0111 & 23.8551 & 4.8842 & -0.2131 & 0.5925 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310599&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]201[/C][C]0.0304[/C][C]-0.0233[/C][C]0.0233[/C][C]0.023[/C][C]6.9611[/C][C]0[/C][C]0[/C][C]-0.3965[/C][C]0.3965[/C][/ROW]
[ROW][C]202[/C][C]0.0295[/C][C]-0.0884[/C][C]0.0558[/C][C]0.0538[/C][C]99.5318[/C][C]53.2464[/C][C]7.297[/C][C]-1.4992[/C][C]0.9478[/C][/ROW]
[ROW][C]203[/C][C]0.0321[/C][C]-0.0269[/C][C]0.0462[/C][C]0.0447[/C][C]9.4557[/C][C]38.6495[/C][C]6.2169[/C][C]-0.4621[/C][C]0.7859[/C][/ROW]
[ROW][C]204[/C][C]0.0329[/C][C]-0.0102[/C][C]0.0372[/C][C]0.0361[/C][C]1.3822[/C][C]29.3327[/C][C]5.416[/C][C]-0.1767[/C][C]0.6336[/C][/ROW]
[ROW][C]205[/C][C]0.0347[/C][C]-0.0445[/C][C]0.0387[/C][C]0.0376[/C][C]22.7016[/C][C]28.0065[/C][C]5.2921[/C][C]-0.716[/C][C]0.6501[/C][/ROW]
[ROW][C]206[/C][C]0.0363[/C][C]-0.054[/C][C]0.0412[/C][C]0.0401[/C][C]30.5102[/C][C]28.4238[/C][C]5.3314[/C][C]-0.83[/C][C]0.6801[/C][/ROW]
[ROW][C]207[/C][C]0.0357[/C][C]0.0071[/C][C]0.0363[/C][C]0.0354[/C][C]0.6931[/C][C]24.4622[/C][C]4.9459[/C][C]0.1251[/C][C]0.6008[/C][/ROW]
[ROW][C]208[/C][C]0.0373[/C][C]-0.0657[/C][C]0.04[/C][C]0.0389[/C][C]48.388[/C][C]27.453[/C][C]5.2396[/C][C]-1.0453[/C][C]0.6564[/C][/ROW]
[ROW][C]209[/C][C]0.0383[/C][C]0.0146[/C][C]0.0372[/C][C]0.0362[/C][C]2.7878[/C][C]24.7124[/C][C]4.9712[/C][C]0.2509[/C][C]0.6113[/C][/ROW]
[ROW][C]210[/C][C]0.0388[/C][C]-0.014[/C][C]0.0349[/C][C]0.034[/C][C]2.5004[/C][C]22.4912[/C][C]4.7425[/C][C]-0.2376[/C][C]0.5739[/C][/ROW]
[ROW][C]211[/C][C]0.0404[/C][C]-0.0749[/C][C]0.0385[/C][C]0.0374[/C][C]59.3383[/C][C]25.8409[/C][C]5.0834[/C][C]-1.1576[/C][C]0.627[/C][/ROW]
[ROW][C]212[/C][C]0.0406[/C][C]-0.0126[/C][C]0.0363[/C][C]0.0354[/C][C]2.0111[/C][C]23.8551[/C][C]4.8842[/C][C]-0.2131[/C][C]0.5925[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310599&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310599&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
2010.0304-0.02330.02330.0236.961100-0.39650.3965
2020.0295-0.08840.05580.053899.531853.24647.297-1.49920.9478
2030.0321-0.02690.04620.04479.455738.64956.2169-0.46210.7859
2040.0329-0.01020.03720.03611.382229.33275.416-0.17670.6336
2050.0347-0.04450.03870.037622.701628.00655.2921-0.7160.6501
2060.0363-0.0540.04120.040130.510228.42385.3314-0.830.6801
2070.03570.00710.03630.03540.693124.46224.94590.12510.6008
2080.0373-0.06570.040.038948.38827.4535.2396-1.04530.6564
2090.03830.01460.03720.03622.787824.71244.97120.25090.6113
2100.0388-0.0140.03490.0342.500422.49124.7425-0.23760.5739
2110.0404-0.07490.03850.037459.338325.84095.0834-1.15760.627
2120.0406-0.01260.03630.03542.011123.85514.8842-0.21310.5925



Parameters (Session):
par1 = 12 ; par2 = 0.5 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 0.5 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 1 ; par8 = 0 ; 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')