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 15:08:34 +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/t1513865361lb6skj923gcsncz.htm/, Retrieved Mon, 13 May 2024 23:27:01 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310646, Retrieved Mon, 13 May 2024 23:27:01 +0000
QR Codes:

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

Post a new message
Dataseries X:
57.7
60.1
66.5
63.4
71.4
68.5
61.6
68.3
69.3
76.1
73.3
69.7
67.4
63.7
73
67.5
74.4
72.9
71.7
75.6
72.5
80
75.4
71
70.6
67.5
74.1
73.2
74
73
74
73
76
81.7
73.5
77
73.6
70.4
74.7
76.8
72.7
76
77.5
73.6
78.5
84.3
74.4
78.5
72.7
71.3
84.4
79.1
76.2
84.9
77.1
78.7
84.7
83.7
82.5
85.2
76
72.2
83.2
80.2
81.1
86
76
83.9
87.9
85
88.1
87.4
79.5
75.2
87.3
79.5
87.6
89.1
83
88.3
88.9
93.9
91.7
87.2
87.8
81
93.7
87.5
91.4
93.8
89.5
93.3
92.8
104.1
99.9
93.4
99
93.2
95.7
102.6
98.8
98
101.5
94.9
104.7
108.4
97
102.3
90.8
89.6
99.9
99.2
94
103
99.8
94.9
102
103.2
98
101.1
88.2
90.3
105.5
99.4
94.3
105.9
98
99
103.9
104.3
105.7
105.5
97.4
95.4
110.5
102.8
110
104.3
96.5
105.6
111.3
108.5
109.1
107.7
102.3
102.4
110.8
101.7
108.9
111.5
104
109.9
106.8
118.4
111.8
105
104.9
96.5
106.3
105.6
109.3
105.1
111.5
103.1
106.5
114.4
104.7
105.5
100.5
96.4
105.1
108.4
105.7
109
107.2
101.6
112.7
115.9
105
110.4
100.9
98.5
111.3
109.6
103.4
115.7
110.4
105.2
113.2
117.4
112.3
113.9
102.2
106.9
118
113.8
114.9
118.8
106.3
114.2
117.3
114.7
117
116.6
106.5
105.7
121
107.8
119.7
121
108.8
115




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310646&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 time6 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])
188105.2-------
189113.2-------
190117.4-------
191112.3-------
192113.9-------
193102.2-------
194106.9-------
195118-------
196113.8-------
197114.9-------
198118.8-------
199106.3-------
200114.2-------
201117.3116.6852111.2624122.10790.41210.81550.89610.8155
202114.7118.262112.8392123.68480.0990.6360.62230.929
203117117.7931112.2997123.28640.38860.86510.9750.9001
204116.6115.9361109.8266122.04560.41570.36640.74320.7112
205106.5109.4171103.2775115.55670.17590.01090.98940.0634
206105.7109.1735102.9081115.43880.13860.79850.76150.0579
207121118.3259111.812124.83990.21050.99990.53910.8928
208107.8114.608108.0125121.20360.02150.02880.59490.5483
209119.7117.9969111.2664124.72750.310.99850.81640.8656
210121118.1353111.244125.02660.20760.32820.4250.8685
211108.8112.8331105.8359119.83030.12930.01110.96640.3509
212115116.8203109.6939123.94660.30830.98630.76440.7644

\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 & 105.2 & - & - & - & - & - & - & - \tabularnewline
189 & 113.2 & - & - & - & - & - & - & - \tabularnewline
190 & 117.4 & - & - & - & - & - & - & - \tabularnewline
191 & 112.3 & - & - & - & - & - & - & - \tabularnewline
192 & 113.9 & - & - & - & - & - & - & - \tabularnewline
193 & 102.2 & - & - & - & - & - & - & - \tabularnewline
194 & 106.9 & - & - & - & - & - & - & - \tabularnewline
195 & 118 & - & - & - & - & - & - & - \tabularnewline
196 & 113.8 & - & - & - & - & - & - & - \tabularnewline
197 & 114.9 & - & - & - & - & - & - & - \tabularnewline
198 & 118.8 & - & - & - & - & - & - & - \tabularnewline
199 & 106.3 & - & - & - & - & - & - & - \tabularnewline
200 & 114.2 & - & - & - & - & - & - & - \tabularnewline
201 & 117.3 & 116.6852 & 111.2624 & 122.1079 & 0.4121 & 0.8155 & 0.8961 & 0.8155 \tabularnewline
202 & 114.7 & 118.262 & 112.8392 & 123.6848 & 0.099 & 0.636 & 0.6223 & 0.929 \tabularnewline
203 & 117 & 117.7931 & 112.2997 & 123.2864 & 0.3886 & 0.8651 & 0.975 & 0.9001 \tabularnewline
204 & 116.6 & 115.9361 & 109.8266 & 122.0456 & 0.4157 & 0.3664 & 0.7432 & 0.7112 \tabularnewline
205 & 106.5 & 109.4171 & 103.2775 & 115.5567 & 0.1759 & 0.0109 & 0.9894 & 0.0634 \tabularnewline
206 & 105.7 & 109.1735 & 102.9081 & 115.4388 & 0.1386 & 0.7985 & 0.7615 & 0.0579 \tabularnewline
207 & 121 & 118.3259 & 111.812 & 124.8399 & 0.2105 & 0.9999 & 0.5391 & 0.8928 \tabularnewline
208 & 107.8 & 114.608 & 108.0125 & 121.2036 & 0.0215 & 0.0288 & 0.5949 & 0.5483 \tabularnewline
209 & 119.7 & 117.9969 & 111.2664 & 124.7275 & 0.31 & 0.9985 & 0.8164 & 0.8656 \tabularnewline
210 & 121 & 118.1353 & 111.244 & 125.0266 & 0.2076 & 0.3282 & 0.425 & 0.8685 \tabularnewline
211 & 108.8 & 112.8331 & 105.8359 & 119.8303 & 0.1293 & 0.0111 & 0.9664 & 0.3509 \tabularnewline
212 & 115 & 116.8203 & 109.6939 & 123.9466 & 0.3083 & 0.9863 & 0.7644 & 0.7644 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310646&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]105.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]113.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]117.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]112.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]113.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]102.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]106.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]118[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]113.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]114.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]118.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]106.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]114.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]117.3[/C][C]116.6852[/C][C]111.2624[/C][C]122.1079[/C][C]0.4121[/C][C]0.8155[/C][C]0.8961[/C][C]0.8155[/C][/ROW]
[ROW][C]202[/C][C]114.7[/C][C]118.262[/C][C]112.8392[/C][C]123.6848[/C][C]0.099[/C][C]0.636[/C][C]0.6223[/C][C]0.929[/C][/ROW]
[ROW][C]203[/C][C]117[/C][C]117.7931[/C][C]112.2997[/C][C]123.2864[/C][C]0.3886[/C][C]0.8651[/C][C]0.975[/C][C]0.9001[/C][/ROW]
[ROW][C]204[/C][C]116.6[/C][C]115.9361[/C][C]109.8266[/C][C]122.0456[/C][C]0.4157[/C][C]0.3664[/C][C]0.7432[/C][C]0.7112[/C][/ROW]
[ROW][C]205[/C][C]106.5[/C][C]109.4171[/C][C]103.2775[/C][C]115.5567[/C][C]0.1759[/C][C]0.0109[/C][C]0.9894[/C][C]0.0634[/C][/ROW]
[ROW][C]206[/C][C]105.7[/C][C]109.1735[/C][C]102.9081[/C][C]115.4388[/C][C]0.1386[/C][C]0.7985[/C][C]0.7615[/C][C]0.0579[/C][/ROW]
[ROW][C]207[/C][C]121[/C][C]118.3259[/C][C]111.812[/C][C]124.8399[/C][C]0.2105[/C][C]0.9999[/C][C]0.5391[/C][C]0.8928[/C][/ROW]
[ROW][C]208[/C][C]107.8[/C][C]114.608[/C][C]108.0125[/C][C]121.2036[/C][C]0.0215[/C][C]0.0288[/C][C]0.5949[/C][C]0.5483[/C][/ROW]
[ROW][C]209[/C][C]119.7[/C][C]117.9969[/C][C]111.2664[/C][C]124.7275[/C][C]0.31[/C][C]0.9985[/C][C]0.8164[/C][C]0.8656[/C][/ROW]
[ROW][C]210[/C][C]121[/C][C]118.1353[/C][C]111.244[/C][C]125.0266[/C][C]0.2076[/C][C]0.3282[/C][C]0.425[/C][C]0.8685[/C][/ROW]
[ROW][C]211[/C][C]108.8[/C][C]112.8331[/C][C]105.8359[/C][C]119.8303[/C][C]0.1293[/C][C]0.0111[/C][C]0.9664[/C][C]0.3509[/C][/ROW]
[ROW][C]212[/C][C]115[/C][C]116.8203[/C][C]109.6939[/C][C]123.9466[/C][C]0.3083[/C][C]0.9863[/C][C]0.7644[/C][C]0.7644[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310646&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310646&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])
188105.2-------
189113.2-------
190117.4-------
191112.3-------
192113.9-------
193102.2-------
194106.9-------
195118-------
196113.8-------
197114.9-------
198118.8-------
199106.3-------
200114.2-------
201117.3116.6852111.2624122.10790.41210.81550.89610.8155
202114.7118.262112.8392123.68480.0990.6360.62230.929
203117117.7931112.2997123.28640.38860.86510.9750.9001
204116.6115.9361109.8266122.04560.41570.36640.74320.7112
205106.5109.4171103.2775115.55670.17590.01090.98940.0634
206105.7109.1735102.9081115.43880.13860.79850.76150.0579
207121118.3259111.812124.83990.21050.99990.53910.8928
208107.8114.608108.0125121.20360.02150.02880.59490.5483
209119.7117.9969111.2664124.72750.310.99850.81640.8656
210121118.1353111.244125.02660.20760.32820.4250.8685
211108.8112.8331105.8359119.83030.12930.01110.96640.3509
212115116.8203109.6939123.94660.30830.98630.76440.7644







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.02370.00520.00520.00530.378000.08860.0886
2020.0234-0.03110.01810.017912.68796.53292.556-0.51350.3011
2030.0238-0.00680.01440.01420.6294.56492.1366-0.11430.2388
2040.02690.00570.01220.01210.44073.53391.87990.09570.2031
2050.0286-0.02740.01520.01518.50964.5292.1282-0.42060.2466
2060.0293-0.03290.01820.017912.06495.7852.4052-0.50080.2889
2070.02810.02210.01870.01867.15065.98012.44540.38550.3027
2080.0294-0.06320.02430.023946.349511.02633.3206-0.98150.3876
2090.02910.01420.02320.02282.900410.12343.18170.24550.3718
2100.02980.02370.02320.0238.20659.93173.15150.4130.3759
2110.0316-0.03710.02450.024216.265810.50753.2415-0.58140.3946
2120.0311-0.01580.02380.02353.31349.9083.1477-0.26240.3836

\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.0237 & 0.0052 & 0.0052 & 0.0053 & 0.378 & 0 & 0 & 0.0886 & 0.0886 \tabularnewline
202 & 0.0234 & -0.0311 & 0.0181 & 0.0179 & 12.6879 & 6.5329 & 2.556 & -0.5135 & 0.3011 \tabularnewline
203 & 0.0238 & -0.0068 & 0.0144 & 0.0142 & 0.629 & 4.5649 & 2.1366 & -0.1143 & 0.2388 \tabularnewline
204 & 0.0269 & 0.0057 & 0.0122 & 0.0121 & 0.4407 & 3.5339 & 1.8799 & 0.0957 & 0.2031 \tabularnewline
205 & 0.0286 & -0.0274 & 0.0152 & 0.0151 & 8.5096 & 4.529 & 2.1282 & -0.4206 & 0.2466 \tabularnewline
206 & 0.0293 & -0.0329 & 0.0182 & 0.0179 & 12.0649 & 5.785 & 2.4052 & -0.5008 & 0.2889 \tabularnewline
207 & 0.0281 & 0.0221 & 0.0187 & 0.0186 & 7.1506 & 5.9801 & 2.4454 & 0.3855 & 0.3027 \tabularnewline
208 & 0.0294 & -0.0632 & 0.0243 & 0.0239 & 46.3495 & 11.0263 & 3.3206 & -0.9815 & 0.3876 \tabularnewline
209 & 0.0291 & 0.0142 & 0.0232 & 0.0228 & 2.9004 & 10.1234 & 3.1817 & 0.2455 & 0.3718 \tabularnewline
210 & 0.0298 & 0.0237 & 0.0232 & 0.023 & 8.2065 & 9.9317 & 3.1515 & 0.413 & 0.3759 \tabularnewline
211 & 0.0316 & -0.0371 & 0.0245 & 0.0242 & 16.2658 & 10.5075 & 3.2415 & -0.5814 & 0.3946 \tabularnewline
212 & 0.0311 & -0.0158 & 0.0238 & 0.0235 & 3.3134 & 9.908 & 3.1477 & -0.2624 & 0.3836 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310646&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.0237[/C][C]0.0052[/C][C]0.0052[/C][C]0.0053[/C][C]0.378[/C][C]0[/C][C]0[/C][C]0.0886[/C][C]0.0886[/C][/ROW]
[ROW][C]202[/C][C]0.0234[/C][C]-0.0311[/C][C]0.0181[/C][C]0.0179[/C][C]12.6879[/C][C]6.5329[/C][C]2.556[/C][C]-0.5135[/C][C]0.3011[/C][/ROW]
[ROW][C]203[/C][C]0.0238[/C][C]-0.0068[/C][C]0.0144[/C][C]0.0142[/C][C]0.629[/C][C]4.5649[/C][C]2.1366[/C][C]-0.1143[/C][C]0.2388[/C][/ROW]
[ROW][C]204[/C][C]0.0269[/C][C]0.0057[/C][C]0.0122[/C][C]0.0121[/C][C]0.4407[/C][C]3.5339[/C][C]1.8799[/C][C]0.0957[/C][C]0.2031[/C][/ROW]
[ROW][C]205[/C][C]0.0286[/C][C]-0.0274[/C][C]0.0152[/C][C]0.0151[/C][C]8.5096[/C][C]4.529[/C][C]2.1282[/C][C]-0.4206[/C][C]0.2466[/C][/ROW]
[ROW][C]206[/C][C]0.0293[/C][C]-0.0329[/C][C]0.0182[/C][C]0.0179[/C][C]12.0649[/C][C]5.785[/C][C]2.4052[/C][C]-0.5008[/C][C]0.2889[/C][/ROW]
[ROW][C]207[/C][C]0.0281[/C][C]0.0221[/C][C]0.0187[/C][C]0.0186[/C][C]7.1506[/C][C]5.9801[/C][C]2.4454[/C][C]0.3855[/C][C]0.3027[/C][/ROW]
[ROW][C]208[/C][C]0.0294[/C][C]-0.0632[/C][C]0.0243[/C][C]0.0239[/C][C]46.3495[/C][C]11.0263[/C][C]3.3206[/C][C]-0.9815[/C][C]0.3876[/C][/ROW]
[ROW][C]209[/C][C]0.0291[/C][C]0.0142[/C][C]0.0232[/C][C]0.0228[/C][C]2.9004[/C][C]10.1234[/C][C]3.1817[/C][C]0.2455[/C][C]0.3718[/C][/ROW]
[ROW][C]210[/C][C]0.0298[/C][C]0.0237[/C][C]0.0232[/C][C]0.023[/C][C]8.2065[/C][C]9.9317[/C][C]3.1515[/C][C]0.413[/C][C]0.3759[/C][/ROW]
[ROW][C]211[/C][C]0.0316[/C][C]-0.0371[/C][C]0.0245[/C][C]0.0242[/C][C]16.2658[/C][C]10.5075[/C][C]3.2415[/C][C]-0.5814[/C][C]0.3946[/C][/ROW]
[ROW][C]212[/C][C]0.0311[/C][C]-0.0158[/C][C]0.0238[/C][C]0.0235[/C][C]3.3134[/C][C]9.908[/C][C]3.1477[/C][C]-0.2624[/C][C]0.3836[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310646&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310646&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.02370.00520.00520.00530.378000.08860.0886
2020.0234-0.03110.01810.017912.68796.53292.556-0.51350.3011
2030.0238-0.00680.01440.01420.6294.56492.1366-0.11430.2388
2040.02690.00570.01220.01210.44073.53391.87990.09570.2031
2050.0286-0.02740.01520.01518.50964.5292.1282-0.42060.2466
2060.0293-0.03290.01820.017912.06495.7852.4052-0.50080.2889
2070.02810.02210.01870.01867.15065.98012.44540.38550.3027
2080.0294-0.06320.02430.023946.349511.02633.3206-0.98150.3876
2090.02910.01420.02320.02282.900410.12343.18170.24550.3718
2100.02980.02370.02320.0238.20659.93173.15150.4130.3759
2110.0316-0.03710.02450.024216.265810.50753.2415-0.58140.3946
2120.0311-0.01580.02380.02353.31349.9083.1477-0.26240.3836



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')