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, 08 Dec 2017 16:16:25 +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/08/t15127465409n0o95j3wczf2pk.htm/, Retrieved Tue, 14 May 2024 16:37:12 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=308817, Retrieved Tue, 14 May 2024 16:37:12 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsFood industry Belgium
Estimated Impact51
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2017-12-08 15:16:25] [97ca58e32232a99e44a6c848c7facc09] [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 time5 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 time5 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308817&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]5 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=308817&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308817&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 time5 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.6136110.4258120.80150.18090.94430.82890.9443
202112.9118.6152113.4028123.82750.01580.97910.3840.9967
203114.2118.1076112.7639123.45130.07590.97190.96110.9931
204115.6116.2304110.0905122.37040.42030.74160.65280.9385
205107.1110.2829104.0503116.51550.15840.04730.96040.3627
206102.3108.9998102.5666115.43310.02060.71860.70830.2323
207117.9116.5445109.7426123.34650.348110.49360.9309
208105.8111.7394104.7897118.68910.0470.04120.54930.5381
209114.3113.864106.706121.0220.45250.98640.75010.7501
210113.1113.1818105.7754120.58820.49140.38360.31520.6814
211102.9108.0276100.4518115.60340.09230.09470.92730.1915
212112.2114.0349106.2623121.80750.32180.99750.74680.7468

\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.6136 & 110.4258 & 120.8015 & 0.1809 & 0.9443 & 0.8289 & 0.9443 \tabularnewline
202 & 112.9 & 118.6152 & 113.4028 & 123.8275 & 0.0158 & 0.9791 & 0.384 & 0.9967 \tabularnewline
203 & 114.2 & 118.1076 & 112.7639 & 123.4513 & 0.0759 & 0.9719 & 0.9611 & 0.9931 \tabularnewline
204 & 115.6 & 116.2304 & 110.0905 & 122.3704 & 0.4203 & 0.7416 & 0.6528 & 0.9385 \tabularnewline
205 & 107.1 & 110.2829 & 104.0503 & 116.5155 & 0.1584 & 0.0473 & 0.9604 & 0.3627 \tabularnewline
206 & 102.3 & 108.9998 & 102.5666 & 115.4331 & 0.0206 & 0.7186 & 0.7083 & 0.2323 \tabularnewline
207 & 117.9 & 116.5445 & 109.7426 & 123.3465 & 0.3481 & 1 & 0.4936 & 0.9309 \tabularnewline
208 & 105.8 & 111.7394 & 104.7897 & 118.6891 & 0.047 & 0.0412 & 0.5493 & 0.5381 \tabularnewline
209 & 114.3 & 113.864 & 106.706 & 121.022 & 0.4525 & 0.9864 & 0.7501 & 0.7501 \tabularnewline
210 & 113.1 & 113.1818 & 105.7754 & 120.5882 & 0.4914 & 0.3836 & 0.3152 & 0.6814 \tabularnewline
211 & 102.9 & 108.0276 & 100.4518 & 115.6034 & 0.0923 & 0.0947 & 0.9273 & 0.1915 \tabularnewline
212 & 112.2 & 114.0349 & 106.2623 & 121.8075 & 0.3218 & 0.9975 & 0.7468 & 0.7468 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308817&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.6136[/C][C]110.4258[/C][C]120.8015[/C][C]0.1809[/C][C]0.9443[/C][C]0.8289[/C][C]0.9443[/C][/ROW]
[ROW][C]202[/C][C]112.9[/C][C]118.6152[/C][C]113.4028[/C][C]123.8275[/C][C]0.0158[/C][C]0.9791[/C][C]0.384[/C][C]0.9967[/C][/ROW]
[ROW][C]203[/C][C]114.2[/C][C]118.1076[/C][C]112.7639[/C][C]123.4513[/C][C]0.0759[/C][C]0.9719[/C][C]0.9611[/C][C]0.9931[/C][/ROW]
[ROW][C]204[/C][C]115.6[/C][C]116.2304[/C][C]110.0905[/C][C]122.3704[/C][C]0.4203[/C][C]0.7416[/C][C]0.6528[/C][C]0.9385[/C][/ROW]
[ROW][C]205[/C][C]107.1[/C][C]110.2829[/C][C]104.0503[/C][C]116.5155[/C][C]0.1584[/C][C]0.0473[/C][C]0.9604[/C][C]0.3627[/C][/ROW]
[ROW][C]206[/C][C]102.3[/C][C]108.9998[/C][C]102.5666[/C][C]115.4331[/C][C]0.0206[/C][C]0.7186[/C][C]0.7083[/C][C]0.2323[/C][/ROW]
[ROW][C]207[/C][C]117.9[/C][C]116.5445[/C][C]109.7426[/C][C]123.3465[/C][C]0.3481[/C][C]1[/C][C]0.4936[/C][C]0.9309[/C][/ROW]
[ROW][C]208[/C][C]105.8[/C][C]111.7394[/C][C]104.7897[/C][C]118.6891[/C][C]0.047[/C][C]0.0412[/C][C]0.5493[/C][C]0.5381[/C][/ROW]
[ROW][C]209[/C][C]114.3[/C][C]113.864[/C][C]106.706[/C][C]121.022[/C][C]0.4525[/C][C]0.9864[/C][C]0.7501[/C][C]0.7501[/C][/ROW]
[ROW][C]210[/C][C]113.1[/C][C]113.1818[/C][C]105.7754[/C][C]120.5882[/C][C]0.4914[/C][C]0.3836[/C][C]0.3152[/C][C]0.6814[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]108.0276[/C][C]100.4518[/C][C]115.6034[/C][C]0.0923[/C][C]0.0947[/C][C]0.9273[/C][C]0.1915[/C][/ROW]
[ROW][C]212[/C][C]112.2[/C][C]114.0349[/C][C]106.2623[/C][C]121.8075[/C][C]0.3218[/C][C]0.9975[/C][C]0.7468[/C][C]0.7468[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308817&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308817&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.6136110.4258120.80150.18090.94430.82890.9443
202112.9118.6152113.4028123.82750.01580.97910.3840.9967
203114.2118.1076112.7639123.45130.07590.97190.96110.9931
204115.6116.2304110.0905122.37040.42030.74160.65280.9385
205107.1110.2829104.0503116.51550.15840.04730.96040.3627
206102.3108.9998102.5666115.43310.02060.71860.70830.2323
207117.9116.5445109.7426123.34650.348110.49360.9309
208105.8111.7394104.7897118.68910.0470.04120.54930.5381
209114.3113.864106.706121.0220.45250.98640.75010.7501
210113.1113.1818105.7754120.58820.49140.38360.31520.6814
211102.9108.0276100.4518115.60340.09230.09470.92730.1915
212112.2114.0349106.2623121.80750.32180.99750.74680.7468







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0229-0.02130.02130.02115.825700-0.36270.3627
2020.0224-0.05060.0360.035232.663219.24454.3869-0.85880.6108
2030.0231-0.03420.03540.034715.269517.91954.2331-0.58720.6029
2040.027-0.00550.02790.02740.397513.5393.6795-0.09470.4759
2050.0288-0.02970.02830.027810.130912.85743.5857-0.47830.4764
2060.0301-0.06550.03450.033744.887818.19584.2657-1.00680.5648
2070.02980.01150.03120.03051.837315.85883.98230.20370.5132
2080.0317-0.05610.03430.033635.276418.2864.2762-0.89250.5606
2090.03210.00380.03090.03020.190116.27544.03430.06550.5056
2100.0334-7e-040.02790.02730.006714.64853.8273-0.01230.4563
2110.0358-0.04980.02990.029226.292515.70713.9632-0.77050.4848
2120.0348-0.01640.02880.02823.366914.67873.8313-0.27570.4674

\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.0229 & -0.0213 & 0.0213 & 0.0211 & 5.8257 & 0 & 0 & -0.3627 & 0.3627 \tabularnewline
202 & 0.0224 & -0.0506 & 0.036 & 0.0352 & 32.6632 & 19.2445 & 4.3869 & -0.8588 & 0.6108 \tabularnewline
203 & 0.0231 & -0.0342 & 0.0354 & 0.0347 & 15.2695 & 17.9195 & 4.2331 & -0.5872 & 0.6029 \tabularnewline
204 & 0.027 & -0.0055 & 0.0279 & 0.0274 & 0.3975 & 13.539 & 3.6795 & -0.0947 & 0.4759 \tabularnewline
205 & 0.0288 & -0.0297 & 0.0283 & 0.0278 & 10.1309 & 12.8574 & 3.5857 & -0.4783 & 0.4764 \tabularnewline
206 & 0.0301 & -0.0655 & 0.0345 & 0.0337 & 44.8878 & 18.1958 & 4.2657 & -1.0068 & 0.5648 \tabularnewline
207 & 0.0298 & 0.0115 & 0.0312 & 0.0305 & 1.8373 & 15.8588 & 3.9823 & 0.2037 & 0.5132 \tabularnewline
208 & 0.0317 & -0.0561 & 0.0343 & 0.0336 & 35.2764 & 18.286 & 4.2762 & -0.8925 & 0.5606 \tabularnewline
209 & 0.0321 & 0.0038 & 0.0309 & 0.0302 & 0.1901 & 16.2754 & 4.0343 & 0.0655 & 0.5056 \tabularnewline
210 & 0.0334 & -7e-04 & 0.0279 & 0.0273 & 0.0067 & 14.6485 & 3.8273 & -0.0123 & 0.4563 \tabularnewline
211 & 0.0358 & -0.0498 & 0.0299 & 0.0292 & 26.2925 & 15.7071 & 3.9632 & -0.7705 & 0.4848 \tabularnewline
212 & 0.0348 & -0.0164 & 0.0288 & 0.0282 & 3.3669 & 14.6787 & 3.8313 & -0.2757 & 0.4674 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308817&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.0229[/C][C]-0.0213[/C][C]0.0213[/C][C]0.0211[/C][C]5.8257[/C][C]0[/C][C]0[/C][C]-0.3627[/C][C]0.3627[/C][/ROW]
[ROW][C]202[/C][C]0.0224[/C][C]-0.0506[/C][C]0.036[/C][C]0.0352[/C][C]32.6632[/C][C]19.2445[/C][C]4.3869[/C][C]-0.8588[/C][C]0.6108[/C][/ROW]
[ROW][C]203[/C][C]0.0231[/C][C]-0.0342[/C][C]0.0354[/C][C]0.0347[/C][C]15.2695[/C][C]17.9195[/C][C]4.2331[/C][C]-0.5872[/C][C]0.6029[/C][/ROW]
[ROW][C]204[/C][C]0.027[/C][C]-0.0055[/C][C]0.0279[/C][C]0.0274[/C][C]0.3975[/C][C]13.539[/C][C]3.6795[/C][C]-0.0947[/C][C]0.4759[/C][/ROW]
[ROW][C]205[/C][C]0.0288[/C][C]-0.0297[/C][C]0.0283[/C][C]0.0278[/C][C]10.1309[/C][C]12.8574[/C][C]3.5857[/C][C]-0.4783[/C][C]0.4764[/C][/ROW]
[ROW][C]206[/C][C]0.0301[/C][C]-0.0655[/C][C]0.0345[/C][C]0.0337[/C][C]44.8878[/C][C]18.1958[/C][C]4.2657[/C][C]-1.0068[/C][C]0.5648[/C][/ROW]
[ROW][C]207[/C][C]0.0298[/C][C]0.0115[/C][C]0.0312[/C][C]0.0305[/C][C]1.8373[/C][C]15.8588[/C][C]3.9823[/C][C]0.2037[/C][C]0.5132[/C][/ROW]
[ROW][C]208[/C][C]0.0317[/C][C]-0.0561[/C][C]0.0343[/C][C]0.0336[/C][C]35.2764[/C][C]18.286[/C][C]4.2762[/C][C]-0.8925[/C][C]0.5606[/C][/ROW]
[ROW][C]209[/C][C]0.0321[/C][C]0.0038[/C][C]0.0309[/C][C]0.0302[/C][C]0.1901[/C][C]16.2754[/C][C]4.0343[/C][C]0.0655[/C][C]0.5056[/C][/ROW]
[ROW][C]210[/C][C]0.0334[/C][C]-7e-04[/C][C]0.0279[/C][C]0.0273[/C][C]0.0067[/C][C]14.6485[/C][C]3.8273[/C][C]-0.0123[/C][C]0.4563[/C][/ROW]
[ROW][C]211[/C][C]0.0358[/C][C]-0.0498[/C][C]0.0299[/C][C]0.0292[/C][C]26.2925[/C][C]15.7071[/C][C]3.9632[/C][C]-0.7705[/C][C]0.4848[/C][/ROW]
[ROW][C]212[/C][C]0.0348[/C][C]-0.0164[/C][C]0.0288[/C][C]0.0282[/C][C]3.3669[/C][C]14.6787[/C][C]3.8313[/C][C]-0.2757[/C][C]0.4674[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308817&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308817&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.0229-0.02130.02130.02115.825700-0.36270.3627
2020.0224-0.05060.0360.035232.663219.24454.3869-0.85880.6108
2030.0231-0.03420.03540.034715.269517.91954.2331-0.58720.6029
2040.027-0.00550.02790.02740.397513.5393.6795-0.09470.4759
2050.0288-0.02970.02830.027810.130912.85743.5857-0.47830.4764
2060.0301-0.06550.03450.033744.887818.19584.2657-1.00680.5648
2070.02980.01150.03120.03051.837315.85883.98230.20370.5132
2080.0317-0.05610.03430.033635.276418.2864.2762-0.89250.5606
2090.03210.00380.03090.03020.190116.27544.03430.06550.5056
2100.0334-7e-040.02790.02730.006714.64853.8273-0.01230.4563
2110.0358-0.04980.02990.029226.292515.70713.9632-0.77050.4848
2120.0348-0.01640.02880.02823.366914.67873.8313-0.27570.4674



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