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, 22 Dec 2017 14:52:29 +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/22/t15139511765ngwdkcup9io8ak.htm/, Retrieved Wed, 15 May 2024 10:43:02 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310787, Retrieved Wed, 15 May 2024 10:43:02 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact103
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecast] [2017-12-22 13:52:29] [d28c247ea8cb6ea87dffcd446de21a8e] [Current]
Feedback Forum

Post a new message
Dataseries X:
52
54,9
60,5
54,8
60,1
60,3
49,8
53,8
64,8
62
65,2
60,1
61,2
63,6
68,6
63,1
66,5
71,9
58,1
61,5
66,2
72,3
67
62,9
66,4
65,6
70,9
68,4
66,4
67,6
64,1
62,1
70
74,4
67
64,8
70,7
64
72,5
70,4
63,6
69,8
67,7
66,4
78,9
79,9
69,1
81,2
66
71,8
86,1
76,1
70,5
83,3
74,8
73,4
86,5
82
80,8
91,5
77
72,3
83,5
79
76,7
83,1
71,1
75,5
90,9
85,4
84,8
83,8
79,3
79,9
93
78,1
82,3
87,3
74,6
80
91,3
94,2
90,9
88
81,6
77,4
91
79,9
83,4
91,6
85,2
84,1
87
92,8
89,2
87,3
89,5
86,8
92
92,2
86,4
92,9
91,2
80,3
102
99
89,2
103
80,4
83,4
97,6
87
84,4
94,1
88,9
82,3
94,7
94,5
91,6
96,8
87,9
99,9
109,5
91,2
89,4
109,7
96,9
94,1
104,4
100,8
107,4
108,9
95,2
102,7
130,9
104
106,5
106,1
97,8
112,2
114,5
105,8
101
101,2
96,5
99,5
123,8
94,6
95,8
105,4
104,4
105,2
112,7
114,8
108,9
103,8
102,5
98,1
118,2
114,8
109,9
116,7
116,9
104,4
113,5
123,8
116,4
114,1
102,8
112,7
121,1
120,8
117,8
130,4
110,9
105,4
137,6
133,3
123,3
122,8
110,2
101,4
128,7
120,6
110,1
121,6
113
115,9
131,1
127,4
123,9
120,8
108,5
112,9
129,6
121,3
119,1
140,8
127,4
128,1
136,6
126,5
120,8
144,3
116
123,4
138,6
118,3
124,2
136
127,4
131,6




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310787&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 time3 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])
188115.9-------
189131.1-------
190127.4-------
191123.9-------
192120.8-------
193108.5-------
194112.9-------
195129.6-------
196121.3-------
197119.1-------
198140.8-------
199127.4-------
200128.1-------
201136.6142.1563126.6604159.98370.27060.93890.88790.9389
202126.5140.4445124.8062158.49410.0650.66180.92170.91
203120.8134.449119.5024151.69590.06040.81680.88470.7647
204144.3133.6383118.018151.80630.1250.9170.9170.7249
205116121.7209107.5447138.19970.24810.00360.94210.224
206123.4123.622109.0756140.55940.48980.81110.89270.3022
207138.6145.2148127.376166.13710.26770.97950.92820.9456
208118.3130.9519115.0324149.58960.09170.21060.8450.6179
209124.2127.7987112.2277146.03550.34950.84630.82510.4871
210136141.7229123.9882162.59050.29550.95010.53450.8996
211127.4129.3399113.3178148.15880.41990.24390.58010.5514
212131.6128.231112.2737146.98880.36240.53460.50550.5055

\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 & 115.9 & - & - & - & - & - & - & - \tabularnewline
189 & 131.1 & - & - & - & - & - & - & - \tabularnewline
190 & 127.4 & - & - & - & - & - & - & - \tabularnewline
191 & 123.9 & - & - & - & - & - & - & - \tabularnewline
192 & 120.8 & - & - & - & - & - & - & - \tabularnewline
193 & 108.5 & - & - & - & - & - & - & - \tabularnewline
194 & 112.9 & - & - & - & - & - & - & - \tabularnewline
195 & 129.6 & - & - & - & - & - & - & - \tabularnewline
196 & 121.3 & - & - & - & - & - & - & - \tabularnewline
197 & 119.1 & - & - & - & - & - & - & - \tabularnewline
198 & 140.8 & - & - & - & - & - & - & - \tabularnewline
199 & 127.4 & - & - & - & - & - & - & - \tabularnewline
200 & 128.1 & - & - & - & - & - & - & - \tabularnewline
201 & 136.6 & 142.1563 & 126.6604 & 159.9837 & 0.2706 & 0.9389 & 0.8879 & 0.9389 \tabularnewline
202 & 126.5 & 140.4445 & 124.8062 & 158.4941 & 0.065 & 0.6618 & 0.9217 & 0.91 \tabularnewline
203 & 120.8 & 134.449 & 119.5024 & 151.6959 & 0.0604 & 0.8168 & 0.8847 & 0.7647 \tabularnewline
204 & 144.3 & 133.6383 & 118.018 & 151.8063 & 0.125 & 0.917 & 0.917 & 0.7249 \tabularnewline
205 & 116 & 121.7209 & 107.5447 & 138.1997 & 0.2481 & 0.0036 & 0.9421 & 0.224 \tabularnewline
206 & 123.4 & 123.622 & 109.0756 & 140.5594 & 0.4898 & 0.8111 & 0.8927 & 0.3022 \tabularnewline
207 & 138.6 & 145.2148 & 127.376 & 166.1371 & 0.2677 & 0.9795 & 0.9282 & 0.9456 \tabularnewline
208 & 118.3 & 130.9519 & 115.0324 & 149.5896 & 0.0917 & 0.2106 & 0.845 & 0.6179 \tabularnewline
209 & 124.2 & 127.7987 & 112.2277 & 146.0355 & 0.3495 & 0.8463 & 0.8251 & 0.4871 \tabularnewline
210 & 136 & 141.7229 & 123.9882 & 162.5905 & 0.2955 & 0.9501 & 0.5345 & 0.8996 \tabularnewline
211 & 127.4 & 129.3399 & 113.3178 & 148.1588 & 0.4199 & 0.2439 & 0.5801 & 0.5514 \tabularnewline
212 & 131.6 & 128.231 & 112.2737 & 146.9888 & 0.3624 & 0.5346 & 0.5055 & 0.5055 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310787&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]115.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]131.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]127.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]123.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]120.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]108.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]112.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]129.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]121.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]119.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]140.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]127.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]128.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]136.6[/C][C]142.1563[/C][C]126.6604[/C][C]159.9837[/C][C]0.2706[/C][C]0.9389[/C][C]0.8879[/C][C]0.9389[/C][/ROW]
[ROW][C]202[/C][C]126.5[/C][C]140.4445[/C][C]124.8062[/C][C]158.4941[/C][C]0.065[/C][C]0.6618[/C][C]0.9217[/C][C]0.91[/C][/ROW]
[ROW][C]203[/C][C]120.8[/C][C]134.449[/C][C]119.5024[/C][C]151.6959[/C][C]0.0604[/C][C]0.8168[/C][C]0.8847[/C][C]0.7647[/C][/ROW]
[ROW][C]204[/C][C]144.3[/C][C]133.6383[/C][C]118.018[/C][C]151.8063[/C][C]0.125[/C][C]0.917[/C][C]0.917[/C][C]0.7249[/C][/ROW]
[ROW][C]205[/C][C]116[/C][C]121.7209[/C][C]107.5447[/C][C]138.1997[/C][C]0.2481[/C][C]0.0036[/C][C]0.9421[/C][C]0.224[/C][/ROW]
[ROW][C]206[/C][C]123.4[/C][C]123.622[/C][C]109.0756[/C][C]140.5594[/C][C]0.4898[/C][C]0.8111[/C][C]0.8927[/C][C]0.3022[/C][/ROW]
[ROW][C]207[/C][C]138.6[/C][C]145.2148[/C][C]127.376[/C][C]166.1371[/C][C]0.2677[/C][C]0.9795[/C][C]0.9282[/C][C]0.9456[/C][/ROW]
[ROW][C]208[/C][C]118.3[/C][C]130.9519[/C][C]115.0324[/C][C]149.5896[/C][C]0.0917[/C][C]0.2106[/C][C]0.845[/C][C]0.6179[/C][/ROW]
[ROW][C]209[/C][C]124.2[/C][C]127.7987[/C][C]112.2277[/C][C]146.0355[/C][C]0.3495[/C][C]0.8463[/C][C]0.8251[/C][C]0.4871[/C][/ROW]
[ROW][C]210[/C][C]136[/C][C]141.7229[/C][C]123.9882[/C][C]162.5905[/C][C]0.2955[/C][C]0.9501[/C][C]0.5345[/C][C]0.8996[/C][/ROW]
[ROW][C]211[/C][C]127.4[/C][C]129.3399[/C][C]113.3178[/C][C]148.1588[/C][C]0.4199[/C][C]0.2439[/C][C]0.5801[/C][C]0.5514[/C][/ROW]
[ROW][C]212[/C][C]131.6[/C][C]128.231[/C][C]112.2737[/C][C]146.9888[/C][C]0.3624[/C][C]0.5346[/C][C]0.5055[/C][C]0.5055[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310787&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310787&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])
188115.9-------
189131.1-------
190127.4-------
191123.9-------
192120.8-------
193108.5-------
194112.9-------
195129.6-------
196121.3-------
197119.1-------
198140.8-------
199127.4-------
200128.1-------
201136.6142.1563126.6604159.98370.27060.93890.88790.9389
202126.5140.4445124.8062158.49410.0650.66180.92170.91
203120.8134.449119.5024151.69590.06040.81680.88470.7647
204144.3133.6383118.018151.80630.1250.9170.9170.7249
205116121.7209107.5447138.19970.24810.00360.94210.224
206123.4123.622109.0756140.55940.48980.81110.89270.3022
207138.6145.2148127.376166.13710.26770.97950.92820.9456
208118.3130.9519115.0324149.58960.09170.21060.8450.6179
209124.2127.7987112.2277146.03550.34950.84630.82510.4871
210136141.7229123.9882162.59050.29550.95010.53450.8996
211127.4129.3399113.3178148.15880.41990.24390.58010.5514
212131.6128.231112.2737146.98880.36240.53460.50550.5055







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.064-0.04070.04070.039930.872400-0.43350.4335
2020.0656-0.11020.07550.0722194.4495112.66110.6142-1.08790.7607
2030.0654-0.1130.0880.0838186.2953137.205711.7135-1.06480.8621
2040.06940.07390.08440.082113.6717131.322211.45960.83180.8545
2050.0691-0.04930.07740.075232.7291111.603610.5643-0.44630.7728
2060.0699-0.00180.06480.0630.049393.01129.6442-0.01730.6469
2070.0735-0.04770.06240.060643.755385.97479.2723-0.5160.6282
2080.0726-0.10690.06790.0658160.069395.23659.7589-0.9870.6731
2090.0728-0.0290.06360.061612.950886.09369.2787-0.28080.6295
2100.0751-0.04210.06150.059632.751880.75958.9866-0.44650.6112
2110.0742-0.01520.05730.05553.763173.75988.5884-0.15130.5694
2120.07460.02560.05460.053111.350168.5598.280.26280.5438

\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.064 & -0.0407 & 0.0407 & 0.0399 & 30.8724 & 0 & 0 & -0.4335 & 0.4335 \tabularnewline
202 & 0.0656 & -0.1102 & 0.0755 & 0.0722 & 194.4495 & 112.661 & 10.6142 & -1.0879 & 0.7607 \tabularnewline
203 & 0.0654 & -0.113 & 0.088 & 0.0838 & 186.2953 & 137.2057 & 11.7135 & -1.0648 & 0.8621 \tabularnewline
204 & 0.0694 & 0.0739 & 0.0844 & 0.082 & 113.6717 & 131.3222 & 11.4596 & 0.8318 & 0.8545 \tabularnewline
205 & 0.0691 & -0.0493 & 0.0774 & 0.0752 & 32.7291 & 111.6036 & 10.5643 & -0.4463 & 0.7728 \tabularnewline
206 & 0.0699 & -0.0018 & 0.0648 & 0.063 & 0.0493 & 93.0112 & 9.6442 & -0.0173 & 0.6469 \tabularnewline
207 & 0.0735 & -0.0477 & 0.0624 & 0.0606 & 43.7553 & 85.9747 & 9.2723 & -0.516 & 0.6282 \tabularnewline
208 & 0.0726 & -0.1069 & 0.0679 & 0.0658 & 160.0693 & 95.2365 & 9.7589 & -0.987 & 0.6731 \tabularnewline
209 & 0.0728 & -0.029 & 0.0636 & 0.0616 & 12.9508 & 86.0936 & 9.2787 & -0.2808 & 0.6295 \tabularnewline
210 & 0.0751 & -0.0421 & 0.0615 & 0.0596 & 32.7518 & 80.7595 & 8.9866 & -0.4465 & 0.6112 \tabularnewline
211 & 0.0742 & -0.0152 & 0.0573 & 0.0555 & 3.7631 & 73.7598 & 8.5884 & -0.1513 & 0.5694 \tabularnewline
212 & 0.0746 & 0.0256 & 0.0546 & 0.0531 & 11.3501 & 68.559 & 8.28 & 0.2628 & 0.5438 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310787&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.064[/C][C]-0.0407[/C][C]0.0407[/C][C]0.0399[/C][C]30.8724[/C][C]0[/C][C]0[/C][C]-0.4335[/C][C]0.4335[/C][/ROW]
[ROW][C]202[/C][C]0.0656[/C][C]-0.1102[/C][C]0.0755[/C][C]0.0722[/C][C]194.4495[/C][C]112.661[/C][C]10.6142[/C][C]-1.0879[/C][C]0.7607[/C][/ROW]
[ROW][C]203[/C][C]0.0654[/C][C]-0.113[/C][C]0.088[/C][C]0.0838[/C][C]186.2953[/C][C]137.2057[/C][C]11.7135[/C][C]-1.0648[/C][C]0.8621[/C][/ROW]
[ROW][C]204[/C][C]0.0694[/C][C]0.0739[/C][C]0.0844[/C][C]0.082[/C][C]113.6717[/C][C]131.3222[/C][C]11.4596[/C][C]0.8318[/C][C]0.8545[/C][/ROW]
[ROW][C]205[/C][C]0.0691[/C][C]-0.0493[/C][C]0.0774[/C][C]0.0752[/C][C]32.7291[/C][C]111.6036[/C][C]10.5643[/C][C]-0.4463[/C][C]0.7728[/C][/ROW]
[ROW][C]206[/C][C]0.0699[/C][C]-0.0018[/C][C]0.0648[/C][C]0.063[/C][C]0.0493[/C][C]93.0112[/C][C]9.6442[/C][C]-0.0173[/C][C]0.6469[/C][/ROW]
[ROW][C]207[/C][C]0.0735[/C][C]-0.0477[/C][C]0.0624[/C][C]0.0606[/C][C]43.7553[/C][C]85.9747[/C][C]9.2723[/C][C]-0.516[/C][C]0.6282[/C][/ROW]
[ROW][C]208[/C][C]0.0726[/C][C]-0.1069[/C][C]0.0679[/C][C]0.0658[/C][C]160.0693[/C][C]95.2365[/C][C]9.7589[/C][C]-0.987[/C][C]0.6731[/C][/ROW]
[ROW][C]209[/C][C]0.0728[/C][C]-0.029[/C][C]0.0636[/C][C]0.0616[/C][C]12.9508[/C][C]86.0936[/C][C]9.2787[/C][C]-0.2808[/C][C]0.6295[/C][/ROW]
[ROW][C]210[/C][C]0.0751[/C][C]-0.0421[/C][C]0.0615[/C][C]0.0596[/C][C]32.7518[/C][C]80.7595[/C][C]8.9866[/C][C]-0.4465[/C][C]0.6112[/C][/ROW]
[ROW][C]211[/C][C]0.0742[/C][C]-0.0152[/C][C]0.0573[/C][C]0.0555[/C][C]3.7631[/C][C]73.7598[/C][C]8.5884[/C][C]-0.1513[/C][C]0.5694[/C][/ROW]
[ROW][C]212[/C][C]0.0746[/C][C]0.0256[/C][C]0.0546[/C][C]0.0531[/C][C]11.3501[/C][C]68.559[/C][C]8.28[/C][C]0.2628[/C][C]0.5438[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310787&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310787&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.064-0.04070.04070.039930.872400-0.43350.4335
2020.0656-0.11020.07550.0722194.4495112.66110.6142-1.08790.7607
2030.0654-0.1130.0880.0838186.2953137.205711.7135-1.06480.8621
2040.06940.07390.08440.082113.6717131.322211.45960.83180.8545
2050.0691-0.04930.07740.075232.7291111.603610.5643-0.44630.7728
2060.0699-0.00180.06480.0630.049393.01129.6442-0.01730.6469
2070.0735-0.04770.06240.060643.755385.97479.2723-0.5160.6282
2080.0726-0.10690.06790.0658160.069395.23659.7589-0.9870.6731
2090.0728-0.0290.06360.061612.950886.09369.2787-0.28080.6295
2100.0751-0.04210.06150.059632.751880.75958.9866-0.44650.6112
2110.0742-0.01520.05730.05553.763173.75988.5884-0.15130.5694
2120.07460.02560.05460.053111.350168.5598.280.26280.5438



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