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 computationMon, 18 Dec 2017 11:10:06 +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/18/t15135920390vmlu1busgcq3ax.htm/, Retrieved Mon, 13 May 2024 20:38:10 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310111, Retrieved Mon, 13 May 2024 20:38:10 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact79
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Mijnbouwsector ar...] [2017-12-18 10:10:06] [2c7049bbcc29bc93573a73f5c62450a0] [Current]
Feedback Forum

Post a new message
Dataseries X:
56.5
69.4
81
68
69.1
66.3
46.4
71.6
75.8
78.7
73.2
53.3
60.3
71.4
73.1
73.4
66.4
69.9
53.9
72.7
77.3
78.6
73.4
63.7
73.8
81.5
93.7
92.9
79.4
81.8
69.3
82.9
90.1
95
83.3
64.6
64.7
85.5
88.5
84.8
81.2
74.3
68.1
82.3
91.6
95.2
76.5
64
62.2
70
93.3
91.1
73.9
90.9
70.7
85.5
91.3
88.3
79.8
68.5
64.8
72.5
84.1
89.1
82.9
100.1
63.8
87.6
96.5
121.3
121.8
111.5
81.9
85.7
106.8
94.7
104.8
110.5
82
102.7
103.8
111.1
100.4
92.5
88.9
97.3
116.2
105.9
107.1
115.4
90.9
123.6
103.5
111
106.9
83.5
113.8
104.2
126.9
125.8
112.9
119.9
105.1
123.4
113.3
114.4
93
73.9
64.9
83.5
90.5
92.1
85.8
99.1
76.7
92.5
106.8
108.5
95.3
67.2
59.4
74.3
111.2
112.4
102.6
127.5
88.4
118.5
112.9
111.1
111
70.6
84.9
102.4
115.6
105.3
118
111.5
72.8
118.7
112.9
107.4
105.2
85.7
88.2
78.8
111.5
99.4
108.7
112.4
79.1
94.7
99.3
111.6
96.1
67.2
66.8
78.9
87.8
97
103.5
103
85
91.7
96.6
105.8
87.5
74
80.7
82.2
92.8
97.1
90.4
90.3
78.1
84.5
95.8
101.4
82.1
72
99
86.6
114.9
101.2
104
119.4
106.2
106.8
113.4
110.8
97.9
83.4
85
89
117.9
112.5
100.3
111.5
66.3
120.4
131.3
118.6
120
100.1
83
99.2
123.7
104
113.9
122.2
98.7
114.8




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=310111&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=310111&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310111&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[200])
188106.8-------
189113.4-------
190110.8-------
19197.9-------
19283.4-------
19385-------
19489-------
195117.9-------
196112.5-------
197100.3-------
198111.5-------
19966.3-------
200120.4-------
201131.3115.15993.3548144.07470.1370.36120.54750.3612
202118.6117.160392.5496151.00320.46680.20640.64370.4256
203120103.190881.3126133.38150.13760.15860.63440.1319
204100.181.930165.0697104.94030.06086e-040.45025e-04
2058385.357667.1542110.53310.42720.12550.51110.0032
20699.293.560172.6589123.00120.35370.7590.61930.037
207123.7114.129586.7424153.90780.31860.7690.42630.3787
208104110.059383.3545149.04270.38030.24640.45120.3016
209113.9106.435580.3289144.73670.35120.54960.62320.2374
210122.2113.952185.0015157.14510.35410.50090.54430.3849
21198.785.563164.9624115.52980.19510.00830.89620.0113
212114.8110.576781.7273154.19390.42470.70320.32950.3295

\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 & 106.8 & - & - & - & - & - & - & - \tabularnewline
189 & 113.4 & - & - & - & - & - & - & - \tabularnewline
190 & 110.8 & - & - & - & - & - & - & - \tabularnewline
191 & 97.9 & - & - & - & - & - & - & - \tabularnewline
192 & 83.4 & - & - & - & - & - & - & - \tabularnewline
193 & 85 & - & - & - & - & - & - & - \tabularnewline
194 & 89 & - & - & - & - & - & - & - \tabularnewline
195 & 117.9 & - & - & - & - & - & - & - \tabularnewline
196 & 112.5 & - & - & - & - & - & - & - \tabularnewline
197 & 100.3 & - & - & - & - & - & - & - \tabularnewline
198 & 111.5 & - & - & - & - & - & - & - \tabularnewline
199 & 66.3 & - & - & - & - & - & - & - \tabularnewline
200 & 120.4 & - & - & - & - & - & - & - \tabularnewline
201 & 131.3 & 115.159 & 93.3548 & 144.0747 & 0.137 & 0.3612 & 0.5475 & 0.3612 \tabularnewline
202 & 118.6 & 117.1603 & 92.5496 & 151.0032 & 0.4668 & 0.2064 & 0.6437 & 0.4256 \tabularnewline
203 & 120 & 103.1908 & 81.3126 & 133.3815 & 0.1376 & 0.1586 & 0.6344 & 0.1319 \tabularnewline
204 & 100.1 & 81.9301 & 65.0697 & 104.9403 & 0.0608 & 6e-04 & 0.4502 & 5e-04 \tabularnewline
205 & 83 & 85.3576 & 67.1542 & 110.5331 & 0.4272 & 0.1255 & 0.5111 & 0.0032 \tabularnewline
206 & 99.2 & 93.5601 & 72.6589 & 123.0012 & 0.3537 & 0.759 & 0.6193 & 0.037 \tabularnewline
207 & 123.7 & 114.1295 & 86.7424 & 153.9078 & 0.3186 & 0.769 & 0.4263 & 0.3787 \tabularnewline
208 & 104 & 110.0593 & 83.3545 & 149.0427 & 0.3803 & 0.2464 & 0.4512 & 0.3016 \tabularnewline
209 & 113.9 & 106.4355 & 80.3289 & 144.7367 & 0.3512 & 0.5496 & 0.6232 & 0.2374 \tabularnewline
210 & 122.2 & 113.9521 & 85.0015 & 157.1451 & 0.3541 & 0.5009 & 0.5443 & 0.3849 \tabularnewline
211 & 98.7 & 85.5631 & 64.9624 & 115.5298 & 0.1951 & 0.0083 & 0.8962 & 0.0113 \tabularnewline
212 & 114.8 & 110.5767 & 81.7273 & 154.1939 & 0.4247 & 0.7032 & 0.3295 & 0.3295 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310111&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]106.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]113.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]110.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]97.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]83.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]85[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]117.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]112.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]100.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]111.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]66.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]120.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]131.3[/C][C]115.159[/C][C]93.3548[/C][C]144.0747[/C][C]0.137[/C][C]0.3612[/C][C]0.5475[/C][C]0.3612[/C][/ROW]
[ROW][C]202[/C][C]118.6[/C][C]117.1603[/C][C]92.5496[/C][C]151.0032[/C][C]0.4668[/C][C]0.2064[/C][C]0.6437[/C][C]0.4256[/C][/ROW]
[ROW][C]203[/C][C]120[/C][C]103.1908[/C][C]81.3126[/C][C]133.3815[/C][C]0.1376[/C][C]0.1586[/C][C]0.6344[/C][C]0.1319[/C][/ROW]
[ROW][C]204[/C][C]100.1[/C][C]81.9301[/C][C]65.0697[/C][C]104.9403[/C][C]0.0608[/C][C]6e-04[/C][C]0.4502[/C][C]5e-04[/C][/ROW]
[ROW][C]205[/C][C]83[/C][C]85.3576[/C][C]67.1542[/C][C]110.5331[/C][C]0.4272[/C][C]0.1255[/C][C]0.5111[/C][C]0.0032[/C][/ROW]
[ROW][C]206[/C][C]99.2[/C][C]93.5601[/C][C]72.6589[/C][C]123.0012[/C][C]0.3537[/C][C]0.759[/C][C]0.6193[/C][C]0.037[/C][/ROW]
[ROW][C]207[/C][C]123.7[/C][C]114.1295[/C][C]86.7424[/C][C]153.9078[/C][C]0.3186[/C][C]0.769[/C][C]0.4263[/C][C]0.3787[/C][/ROW]
[ROW][C]208[/C][C]104[/C][C]110.0593[/C][C]83.3545[/C][C]149.0427[/C][C]0.3803[/C][C]0.2464[/C][C]0.4512[/C][C]0.3016[/C][/ROW]
[ROW][C]209[/C][C]113.9[/C][C]106.4355[/C][C]80.3289[/C][C]144.7367[/C][C]0.3512[/C][C]0.5496[/C][C]0.6232[/C][C]0.2374[/C][/ROW]
[ROW][C]210[/C][C]122.2[/C][C]113.9521[/C][C]85.0015[/C][C]157.1451[/C][C]0.3541[/C][C]0.5009[/C][C]0.5443[/C][C]0.3849[/C][/ROW]
[ROW][C]211[/C][C]98.7[/C][C]85.5631[/C][C]64.9624[/C][C]115.5298[/C][C]0.1951[/C][C]0.0083[/C][C]0.8962[/C][C]0.0113[/C][/ROW]
[ROW][C]212[/C][C]114.8[/C][C]110.5767[/C][C]81.7273[/C][C]154.1939[/C][C]0.4247[/C][C]0.7032[/C][C]0.3295[/C][C]0.3295[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310111&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310111&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])
188106.8-------
189113.4-------
190110.8-------
19197.9-------
19283.4-------
19385-------
19489-------
195117.9-------
196112.5-------
197100.3-------
198111.5-------
19966.3-------
200120.4-------
201131.3115.15993.3548144.07470.1370.36120.54750.3612
202118.6117.160392.5496151.00320.46680.20640.64370.4256
203120103.190881.3126133.38150.13760.15860.63440.1319
204100.181.930165.0697104.94030.06086e-040.45025e-04
2058385.357667.1542110.53310.42720.12550.51110.0032
20699.293.560172.6589123.00120.35370.7590.61930.037
207123.7114.129586.7424153.90780.31860.7690.42630.3787
208104110.059383.3545149.04270.38030.24640.45120.3016
209113.9106.435580.3289144.73670.35120.54960.62320.2374
210122.2113.952185.0015157.14510.35410.50090.54430.3849
21198.785.563164.9624115.52980.19510.00830.89620.0113
212114.8110.576781.7273154.19390.42470.70320.32950.3295







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.12810.12290.12290.131260.5324001.04871.0487
2020.14740.01210.06750.07162.0727131.302611.45870.09350.5711
2030.14930.14010.09170.0979282.548181.717713.48031.09210.7448
2040.14330.18150.11420.1234330.1436218.824214.79271.18060.8537
2050.1505-0.02840.0970.10435.5583176.17113.2729-0.15320.7136
2060.16050.05690.09030.096731.8088152.110612.33330.36640.6558
2070.17780.07740.08850.094491.5948143.465511.97770.62180.6509
2080.1807-0.05830.08470.089636.7151130.121711.4071-0.39370.6188
2090.18360.06550.08260.087255.7181121.854711.03880.4850.6039
2100.19340.06750.08110.085568.0272116.471910.79220.53590.5971
2110.17870.13310.08580.0907172.5773121.572411.0260.85350.6204
2120.20130.03680.08170.086217.8361112.927710.62670.27440.5916

\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.1281 & 0.1229 & 0.1229 & 0.131 & 260.5324 & 0 & 0 & 1.0487 & 1.0487 \tabularnewline
202 & 0.1474 & 0.0121 & 0.0675 & 0.0716 & 2.0727 & 131.3026 & 11.4587 & 0.0935 & 0.5711 \tabularnewline
203 & 0.1493 & 0.1401 & 0.0917 & 0.0979 & 282.548 & 181.7177 & 13.4803 & 1.0921 & 0.7448 \tabularnewline
204 & 0.1433 & 0.1815 & 0.1142 & 0.1234 & 330.1436 & 218.8242 & 14.7927 & 1.1806 & 0.8537 \tabularnewline
205 & 0.1505 & -0.0284 & 0.097 & 0.1043 & 5.5583 & 176.171 & 13.2729 & -0.1532 & 0.7136 \tabularnewline
206 & 0.1605 & 0.0569 & 0.0903 & 0.0967 & 31.8088 & 152.1106 & 12.3333 & 0.3664 & 0.6558 \tabularnewline
207 & 0.1778 & 0.0774 & 0.0885 & 0.0944 & 91.5948 & 143.4655 & 11.9777 & 0.6218 & 0.6509 \tabularnewline
208 & 0.1807 & -0.0583 & 0.0847 & 0.0896 & 36.7151 & 130.1217 & 11.4071 & -0.3937 & 0.6188 \tabularnewline
209 & 0.1836 & 0.0655 & 0.0826 & 0.0872 & 55.7181 & 121.8547 & 11.0388 & 0.485 & 0.6039 \tabularnewline
210 & 0.1934 & 0.0675 & 0.0811 & 0.0855 & 68.0272 & 116.4719 & 10.7922 & 0.5359 & 0.5971 \tabularnewline
211 & 0.1787 & 0.1331 & 0.0858 & 0.0907 & 172.5773 & 121.5724 & 11.026 & 0.8535 & 0.6204 \tabularnewline
212 & 0.2013 & 0.0368 & 0.0817 & 0.0862 & 17.8361 & 112.9277 & 10.6267 & 0.2744 & 0.5916 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310111&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.1281[/C][C]0.1229[/C][C]0.1229[/C][C]0.131[/C][C]260.5324[/C][C]0[/C][C]0[/C][C]1.0487[/C][C]1.0487[/C][/ROW]
[ROW][C]202[/C][C]0.1474[/C][C]0.0121[/C][C]0.0675[/C][C]0.0716[/C][C]2.0727[/C][C]131.3026[/C][C]11.4587[/C][C]0.0935[/C][C]0.5711[/C][/ROW]
[ROW][C]203[/C][C]0.1493[/C][C]0.1401[/C][C]0.0917[/C][C]0.0979[/C][C]282.548[/C][C]181.7177[/C][C]13.4803[/C][C]1.0921[/C][C]0.7448[/C][/ROW]
[ROW][C]204[/C][C]0.1433[/C][C]0.1815[/C][C]0.1142[/C][C]0.1234[/C][C]330.1436[/C][C]218.8242[/C][C]14.7927[/C][C]1.1806[/C][C]0.8537[/C][/ROW]
[ROW][C]205[/C][C]0.1505[/C][C]-0.0284[/C][C]0.097[/C][C]0.1043[/C][C]5.5583[/C][C]176.171[/C][C]13.2729[/C][C]-0.1532[/C][C]0.7136[/C][/ROW]
[ROW][C]206[/C][C]0.1605[/C][C]0.0569[/C][C]0.0903[/C][C]0.0967[/C][C]31.8088[/C][C]152.1106[/C][C]12.3333[/C][C]0.3664[/C][C]0.6558[/C][/ROW]
[ROW][C]207[/C][C]0.1778[/C][C]0.0774[/C][C]0.0885[/C][C]0.0944[/C][C]91.5948[/C][C]143.4655[/C][C]11.9777[/C][C]0.6218[/C][C]0.6509[/C][/ROW]
[ROW][C]208[/C][C]0.1807[/C][C]-0.0583[/C][C]0.0847[/C][C]0.0896[/C][C]36.7151[/C][C]130.1217[/C][C]11.4071[/C][C]-0.3937[/C][C]0.6188[/C][/ROW]
[ROW][C]209[/C][C]0.1836[/C][C]0.0655[/C][C]0.0826[/C][C]0.0872[/C][C]55.7181[/C][C]121.8547[/C][C]11.0388[/C][C]0.485[/C][C]0.6039[/C][/ROW]
[ROW][C]210[/C][C]0.1934[/C][C]0.0675[/C][C]0.0811[/C][C]0.0855[/C][C]68.0272[/C][C]116.4719[/C][C]10.7922[/C][C]0.5359[/C][C]0.5971[/C][/ROW]
[ROW][C]211[/C][C]0.1787[/C][C]0.1331[/C][C]0.0858[/C][C]0.0907[/C][C]172.5773[/C][C]121.5724[/C][C]11.026[/C][C]0.8535[/C][C]0.6204[/C][/ROW]
[ROW][C]212[/C][C]0.2013[/C][C]0.0368[/C][C]0.0817[/C][C]0.0862[/C][C]17.8361[/C][C]112.9277[/C][C]10.6267[/C][C]0.2744[/C][C]0.5916[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310111&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310111&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.12810.12290.12290.131260.5324001.04871.0487
2020.14740.01210.06750.07162.0727131.302611.45870.09350.5711
2030.14930.14010.09170.0979282.548181.717713.48031.09210.7448
2040.14330.18150.11420.1234330.1436218.824214.79271.18060.8537
2050.1505-0.02840.0970.10435.5583176.17113.2729-0.15320.7136
2060.16050.05690.09030.096731.8088152.110612.33330.36640.6558
2070.17780.07740.08850.094491.5948143.465511.97770.62180.6509
2080.1807-0.05830.08470.089636.7151130.121711.4071-0.39370.6188
2090.18360.06550.08260.087255.7181121.854711.03880.4850.6039
2100.19340.06750.08110.085568.0272116.471910.79220.53590.5971
2110.17870.13310.08580.0907172.5773121.572411.0260.85350.6204
2120.20130.03680.08170.086217.8361112.927710.62670.27440.5916



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