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, 15 Dec 2017 23:17:30 +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/15/t1513376470yilpxb27oe5v21i.htm/, Retrieved Thu, 16 May 2024 00:32:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=309824, Retrieved Thu, 16 May 2024 00:32:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact46
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-12-15 22:17:30] [8329b9b38c877eb1bcf8703660df8d0b] [Current]
Feedback Forum

Post a new message
Dataseries X:
35
36.1
40.1
35.4
37.4
39.9
32
32.6
44.9
36.3
43.7
39.8
42.6
48.6
49.1
46.9
45.7
56.1
38.3
40.6
46.5
51.4
47
44.6
51
51.1
54.9
52.1
48.7
50.5
47.5
44.6
50.3
54.3
50
44.8
57.6
47.2
59.1
53.9
45.7
54.5
52.8
52.9
66
63.7
54.4
74.4
50.1
62.5
77.2
65.6
58.2
72.6
68.6
63.1
76.9
70.6
71.4
90.6
71.9
60.9
72.9
69.2
64.8
70.2
63
62.2
82.8
77.6
71.2
70.6
71.1
74
87.9
68.3
68.1
75.7
62.7
66.2
81.3
84
80
80.8
67.3
61.9
77.2
65.6
68.7
82
81.4
70.9
71.2
71.9
71.6
76.4
75.6
73.2
80.2
74
69.5
82
82.8
64.5
92.6
82
78.4
103.8
66.6
73.3
92.3
73.6
74.9
83.6
83.3
70.9
82.5
81.7
83.1
92.4
86.9
110.1
112.1
81.5
84.3
113.5
100.3
93.2
100.4
94.4
110.2
113
94.6
111
160.1
110.1
102.8
112.4
105.4
130.4
117.2
103.9
92.2
95.8
93.1
93.9
147.6
89.6
83
99.2
118.3
110.9
124.4
115.8
112.7
111.9
108.6
102.5
141.9
137.7
121.3
142.8
143
121.1
130.2
146.3
143.7
139.3
109.3
141.3
152.7
152.2
151.8
180.5
129
126.1
187.9
170
168.4
157.1
133.9
103.1
166.3
148
131.4
136.3
135.8
151.8
172.2
154.4
158
146.2
128
124.7
160.3
148.1
139.7
194
188.7
172.2
184.8
160.5
139.7
219.8
143.9
166.2
182.7
152.7
146.8
177.1
186
189.2




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309824&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])
188151.8-------
189172.2-------
190154.4-------
191158-------
192146.2-------
193128-------
194124.7-------
195160.3-------
196148.1-------
197139.7-------
198194-------
199188.7-------
200172.2-------
201184.8171.3545128.5464234.70420.33870.48960.48960.4896
202160.5167.8402124.8542232.22810.41160.30280.65880.4472
203139.7169.124124.5053236.96990.19770.59840.6260.4646
204219.8165.8767121.1804234.60080.0620.77230.71270.4284
205143.9159.9511116.1844227.80770.32150.04190.8220.3617
206166.2164.9913118.4607238.36550.48710.71340.85910.4237
207182.7170.309120.8684249.6080.37970.54040.59770.4814
208152.7167.7322118.2301247.93040.35670.35730.68430.4565
209146.8166.8208116.705248.92010.31630.6320.74130.4489
210177.1186.0271127.6483284.44580.42940.78270.43690.6085
211186182.3999124.4399280.95580.47150.5420.45010.5804
212189.2175.0143119.027270.66320.38560.41090.5230.523

\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 & 151.8 & - & - & - & - & - & - & - \tabularnewline
189 & 172.2 & - & - & - & - & - & - & - \tabularnewline
190 & 154.4 & - & - & - & - & - & - & - \tabularnewline
191 & 158 & - & - & - & - & - & - & - \tabularnewline
192 & 146.2 & - & - & - & - & - & - & - \tabularnewline
193 & 128 & - & - & - & - & - & - & - \tabularnewline
194 & 124.7 & - & - & - & - & - & - & - \tabularnewline
195 & 160.3 & - & - & - & - & - & - & - \tabularnewline
196 & 148.1 & - & - & - & - & - & - & - \tabularnewline
197 & 139.7 & - & - & - & - & - & - & - \tabularnewline
198 & 194 & - & - & - & - & - & - & - \tabularnewline
199 & 188.7 & - & - & - & - & - & - & - \tabularnewline
200 & 172.2 & - & - & - & - & - & - & - \tabularnewline
201 & 184.8 & 171.3545 & 128.5464 & 234.7042 & 0.3387 & 0.4896 & 0.4896 & 0.4896 \tabularnewline
202 & 160.5 & 167.8402 & 124.8542 & 232.2281 & 0.4116 & 0.3028 & 0.6588 & 0.4472 \tabularnewline
203 & 139.7 & 169.124 & 124.5053 & 236.9699 & 0.1977 & 0.5984 & 0.626 & 0.4646 \tabularnewline
204 & 219.8 & 165.8767 & 121.1804 & 234.6008 & 0.062 & 0.7723 & 0.7127 & 0.4284 \tabularnewline
205 & 143.9 & 159.9511 & 116.1844 & 227.8077 & 0.3215 & 0.0419 & 0.822 & 0.3617 \tabularnewline
206 & 166.2 & 164.9913 & 118.4607 & 238.3655 & 0.4871 & 0.7134 & 0.8591 & 0.4237 \tabularnewline
207 & 182.7 & 170.309 & 120.8684 & 249.608 & 0.3797 & 0.5404 & 0.5977 & 0.4814 \tabularnewline
208 & 152.7 & 167.7322 & 118.2301 & 247.9304 & 0.3567 & 0.3573 & 0.6843 & 0.4565 \tabularnewline
209 & 146.8 & 166.8208 & 116.705 & 248.9201 & 0.3163 & 0.632 & 0.7413 & 0.4489 \tabularnewline
210 & 177.1 & 186.0271 & 127.6483 & 284.4458 & 0.4294 & 0.7827 & 0.4369 & 0.6085 \tabularnewline
211 & 186 & 182.3999 & 124.4399 & 280.9558 & 0.4715 & 0.542 & 0.4501 & 0.5804 \tabularnewline
212 & 189.2 & 175.0143 & 119.027 & 270.6632 & 0.3856 & 0.4109 & 0.523 & 0.523 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309824&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]151.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]172.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]154.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]158[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]146.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]128[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]124.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]160.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]148.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]139.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]194[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]188.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]172.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]184.8[/C][C]171.3545[/C][C]128.5464[/C][C]234.7042[/C][C]0.3387[/C][C]0.4896[/C][C]0.4896[/C][C]0.4896[/C][/ROW]
[ROW][C]202[/C][C]160.5[/C][C]167.8402[/C][C]124.8542[/C][C]232.2281[/C][C]0.4116[/C][C]0.3028[/C][C]0.6588[/C][C]0.4472[/C][/ROW]
[ROW][C]203[/C][C]139.7[/C][C]169.124[/C][C]124.5053[/C][C]236.9699[/C][C]0.1977[/C][C]0.5984[/C][C]0.626[/C][C]0.4646[/C][/ROW]
[ROW][C]204[/C][C]219.8[/C][C]165.8767[/C][C]121.1804[/C][C]234.6008[/C][C]0.062[/C][C]0.7723[/C][C]0.7127[/C][C]0.4284[/C][/ROW]
[ROW][C]205[/C][C]143.9[/C][C]159.9511[/C][C]116.1844[/C][C]227.8077[/C][C]0.3215[/C][C]0.0419[/C][C]0.822[/C][C]0.3617[/C][/ROW]
[ROW][C]206[/C][C]166.2[/C][C]164.9913[/C][C]118.4607[/C][C]238.3655[/C][C]0.4871[/C][C]0.7134[/C][C]0.8591[/C][C]0.4237[/C][/ROW]
[ROW][C]207[/C][C]182.7[/C][C]170.309[/C][C]120.8684[/C][C]249.608[/C][C]0.3797[/C][C]0.5404[/C][C]0.5977[/C][C]0.4814[/C][/ROW]
[ROW][C]208[/C][C]152.7[/C][C]167.7322[/C][C]118.2301[/C][C]247.9304[/C][C]0.3567[/C][C]0.3573[/C][C]0.6843[/C][C]0.4565[/C][/ROW]
[ROW][C]209[/C][C]146.8[/C][C]166.8208[/C][C]116.705[/C][C]248.9201[/C][C]0.3163[/C][C]0.632[/C][C]0.7413[/C][C]0.4489[/C][/ROW]
[ROW][C]210[/C][C]177.1[/C][C]186.0271[/C][C]127.6483[/C][C]284.4458[/C][C]0.4294[/C][C]0.7827[/C][C]0.4369[/C][C]0.6085[/C][/ROW]
[ROW][C]211[/C][C]186[/C][C]182.3999[/C][C]124.4399[/C][C]280.9558[/C][C]0.4715[/C][C]0.542[/C][C]0.4501[/C][C]0.5804[/C][/ROW]
[ROW][C]212[/C][C]189.2[/C][C]175.0143[/C][C]119.027[/C][C]270.6632[/C][C]0.3856[/C][C]0.4109[/C][C]0.523[/C][C]0.523[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309824&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309824&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])
188151.8-------
189172.2-------
190154.4-------
191158-------
192146.2-------
193128-------
194124.7-------
195160.3-------
196148.1-------
197139.7-------
198194-------
199188.7-------
200172.2-------
201184.8171.3545128.5464234.70420.33870.48960.48960.4896
202160.5167.8402124.8542232.22810.41160.30280.65880.4472
203139.7169.124124.5053236.96990.19770.59840.6260.4646
204219.8165.8767121.1804234.60080.0620.77230.71270.4284
205143.9159.9511116.1844227.80770.32150.04190.8220.3617
206166.2164.9913118.4607238.36550.48710.71340.85910.4237
207182.7170.309120.8684249.6080.37970.54040.59770.4814
208152.7167.7322118.2301247.93040.35670.35730.68430.4565
209146.8166.8208116.705248.92010.31630.6320.74130.4489
210177.1186.0271127.6483284.44580.42940.78270.43690.6085
211186182.3999124.4399280.95580.47150.5420.45010.5804
212189.2175.0143119.027270.66320.38560.41090.5230.523







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.18860.07280.07280.0755180.7806000.46480.4648
2020.1957-0.04570.05920.060153.8788117.329710.8319-0.25370.3593
2030.2047-0.21060.10970.1036865.7727366.810719.1523-1.01720.5786
2040.21140.24530.14360.14762907.72221002.038631.6551.86410.9
2050.2164-0.11150.13720.1392257.6377853.158429.2089-0.55490.8309
2060.22690.00730.11550.11721.461711.208826.66850.04180.6994
2070.23760.06780.10870.1105153.5369631.541425.13050.42840.6607
2080.2439-0.09840.10740.1084225.9681580.844724.1007-0.51970.6431
2090.2511-0.13640.11070.1106400.8322560.843423.6821-0.69210.6485
2100.2699-0.05040.10460.104479.6933512.728422.6435-0.30860.6145
2110.27570.01940.09690.096712.9609467.29521.6170.12450.57
2120.27880.0750.09510.0951201.2332445.123121.09790.49040.5633

\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.1886 & 0.0728 & 0.0728 & 0.0755 & 180.7806 & 0 & 0 & 0.4648 & 0.4648 \tabularnewline
202 & 0.1957 & -0.0457 & 0.0592 & 0.0601 & 53.8788 & 117.3297 & 10.8319 & -0.2537 & 0.3593 \tabularnewline
203 & 0.2047 & -0.2106 & 0.1097 & 0.1036 & 865.7727 & 366.8107 & 19.1523 & -1.0172 & 0.5786 \tabularnewline
204 & 0.2114 & 0.2453 & 0.1436 & 0.1476 & 2907.7222 & 1002.0386 & 31.655 & 1.8641 & 0.9 \tabularnewline
205 & 0.2164 & -0.1115 & 0.1372 & 0.1392 & 257.6377 & 853.1584 & 29.2089 & -0.5549 & 0.8309 \tabularnewline
206 & 0.2269 & 0.0073 & 0.1155 & 0.1172 & 1.461 & 711.2088 & 26.6685 & 0.0418 & 0.6994 \tabularnewline
207 & 0.2376 & 0.0678 & 0.1087 & 0.1105 & 153.5369 & 631.5414 & 25.1305 & 0.4284 & 0.6607 \tabularnewline
208 & 0.2439 & -0.0984 & 0.1074 & 0.1084 & 225.9681 & 580.8447 & 24.1007 & -0.5197 & 0.6431 \tabularnewline
209 & 0.2511 & -0.1364 & 0.1107 & 0.1106 & 400.8322 & 560.8434 & 23.6821 & -0.6921 & 0.6485 \tabularnewline
210 & 0.2699 & -0.0504 & 0.1046 & 0.1044 & 79.6933 & 512.7284 & 22.6435 & -0.3086 & 0.6145 \tabularnewline
211 & 0.2757 & 0.0194 & 0.0969 & 0.0967 & 12.9609 & 467.295 & 21.617 & 0.1245 & 0.57 \tabularnewline
212 & 0.2788 & 0.075 & 0.0951 & 0.0951 & 201.2332 & 445.1231 & 21.0979 & 0.4904 & 0.5633 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309824&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.1886[/C][C]0.0728[/C][C]0.0728[/C][C]0.0755[/C][C]180.7806[/C][C]0[/C][C]0[/C][C]0.4648[/C][C]0.4648[/C][/ROW]
[ROW][C]202[/C][C]0.1957[/C][C]-0.0457[/C][C]0.0592[/C][C]0.0601[/C][C]53.8788[/C][C]117.3297[/C][C]10.8319[/C][C]-0.2537[/C][C]0.3593[/C][/ROW]
[ROW][C]203[/C][C]0.2047[/C][C]-0.2106[/C][C]0.1097[/C][C]0.1036[/C][C]865.7727[/C][C]366.8107[/C][C]19.1523[/C][C]-1.0172[/C][C]0.5786[/C][/ROW]
[ROW][C]204[/C][C]0.2114[/C][C]0.2453[/C][C]0.1436[/C][C]0.1476[/C][C]2907.7222[/C][C]1002.0386[/C][C]31.655[/C][C]1.8641[/C][C]0.9[/C][/ROW]
[ROW][C]205[/C][C]0.2164[/C][C]-0.1115[/C][C]0.1372[/C][C]0.1392[/C][C]257.6377[/C][C]853.1584[/C][C]29.2089[/C][C]-0.5549[/C][C]0.8309[/C][/ROW]
[ROW][C]206[/C][C]0.2269[/C][C]0.0073[/C][C]0.1155[/C][C]0.1172[/C][C]1.461[/C][C]711.2088[/C][C]26.6685[/C][C]0.0418[/C][C]0.6994[/C][/ROW]
[ROW][C]207[/C][C]0.2376[/C][C]0.0678[/C][C]0.1087[/C][C]0.1105[/C][C]153.5369[/C][C]631.5414[/C][C]25.1305[/C][C]0.4284[/C][C]0.6607[/C][/ROW]
[ROW][C]208[/C][C]0.2439[/C][C]-0.0984[/C][C]0.1074[/C][C]0.1084[/C][C]225.9681[/C][C]580.8447[/C][C]24.1007[/C][C]-0.5197[/C][C]0.6431[/C][/ROW]
[ROW][C]209[/C][C]0.2511[/C][C]-0.1364[/C][C]0.1107[/C][C]0.1106[/C][C]400.8322[/C][C]560.8434[/C][C]23.6821[/C][C]-0.6921[/C][C]0.6485[/C][/ROW]
[ROW][C]210[/C][C]0.2699[/C][C]-0.0504[/C][C]0.1046[/C][C]0.1044[/C][C]79.6933[/C][C]512.7284[/C][C]22.6435[/C][C]-0.3086[/C][C]0.6145[/C][/ROW]
[ROW][C]211[/C][C]0.2757[/C][C]0.0194[/C][C]0.0969[/C][C]0.0967[/C][C]12.9609[/C][C]467.295[/C][C]21.617[/C][C]0.1245[/C][C]0.57[/C][/ROW]
[ROW][C]212[/C][C]0.2788[/C][C]0.075[/C][C]0.0951[/C][C]0.0951[/C][C]201.2332[/C][C]445.1231[/C][C]21.0979[/C][C]0.4904[/C][C]0.5633[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309824&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309824&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.18860.07280.07280.0755180.7806000.46480.4648
2020.1957-0.04570.05920.060153.8788117.329710.8319-0.25370.3593
2030.2047-0.21060.10970.1036865.7727366.810719.1523-1.01720.5786
2040.21140.24530.14360.14762907.72221002.038631.6551.86410.9
2050.2164-0.11150.13720.1392257.6377853.158429.2089-0.55490.8309
2060.22690.00730.11550.11721.461711.208826.66850.04180.6994
2070.23760.06780.10870.1105153.5369631.541425.13050.42840.6607
2080.2439-0.09840.10740.1084225.9681580.844724.1007-0.51970.6431
2090.2511-0.13640.11070.1106400.8322560.843423.6821-0.69210.6485
2100.2699-0.05040.10460.104479.6933512.728422.6435-0.30860.6145
2110.27570.01940.09690.096712.9609467.29521.6170.12450.57
2120.27880.0750.09510.0951201.2332445.123121.09790.49040.5633



Parameters (Session):
Parameters (R input):
par1 = 12 ; par2 = -0.3 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; 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 <- '0'
par5 <- '12'
par4 <- '0'
par3 <- '1'
par2 <- '-0.3'
par1 <- '0'
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')