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:34:55 +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/t1513377302g445ovkwsgbhj7o.htm/, Retrieved Thu, 16 May 2024 03:29:07 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=309826, Retrieved Thu, 16 May 2024 03:29:07 +0000
QR Codes:

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309826&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 time1 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.8181.7251134.3718256.18640.46770.5990.5990.599
202160.5172.9085127.1972245.38820.36860.37390.69160.5076
203139.7174.7518127.0724251.78960.18630.64150.6650.5259
204219.8168.5859121.9074244.69670.09360.77150.71790.4629
205143.9158.3054114.2762230.29950.34750.0470.79530.3526
206166.2156.3282112.0154229.67320.3960.63010.8010.3357
207182.7175.9128123.0507266.96910.44190.58280.63160.5318
208152.7169.6033118.1854258.73860.35510.38670.68180.4772
209146.8165.0288114.4624253.37550.3430.60780.71290.4368
210177.1191.6135129.0516306.49410.40220.77770.48380.6298
211186189.2924126.6632305.58140.47790.58140.5040.6134
212189.2181.7251121.3641294.17610.44820.47030.56590.5659

\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 & 181.7251 & 134.3718 & 256.1864 & 0.4677 & 0.599 & 0.599 & 0.599 \tabularnewline
202 & 160.5 & 172.9085 & 127.1972 & 245.3882 & 0.3686 & 0.3739 & 0.6916 & 0.5076 \tabularnewline
203 & 139.7 & 174.7518 & 127.0724 & 251.7896 & 0.1863 & 0.6415 & 0.665 & 0.5259 \tabularnewline
204 & 219.8 & 168.5859 & 121.9074 & 244.6967 & 0.0936 & 0.7715 & 0.7179 & 0.4629 \tabularnewline
205 & 143.9 & 158.3054 & 114.2762 & 230.2995 & 0.3475 & 0.047 & 0.7953 & 0.3526 \tabularnewline
206 & 166.2 & 156.3282 & 112.0154 & 229.6732 & 0.396 & 0.6301 & 0.801 & 0.3357 \tabularnewline
207 & 182.7 & 175.9128 & 123.0507 & 266.9691 & 0.4419 & 0.5828 & 0.6316 & 0.5318 \tabularnewline
208 & 152.7 & 169.6033 & 118.1854 & 258.7386 & 0.3551 & 0.3867 & 0.6818 & 0.4772 \tabularnewline
209 & 146.8 & 165.0288 & 114.4624 & 253.3755 & 0.343 & 0.6078 & 0.7129 & 0.4368 \tabularnewline
210 & 177.1 & 191.6135 & 129.0516 & 306.4941 & 0.4022 & 0.7777 & 0.4838 & 0.6298 \tabularnewline
211 & 186 & 189.2924 & 126.6632 & 305.5814 & 0.4779 & 0.5814 & 0.504 & 0.6134 \tabularnewline
212 & 189.2 & 181.7251 & 121.3641 & 294.1761 & 0.4482 & 0.4703 & 0.5659 & 0.5659 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309826&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]181.7251[/C][C]134.3718[/C][C]256.1864[/C][C]0.4677[/C][C]0.599[/C][C]0.599[/C][C]0.599[/C][/ROW]
[ROW][C]202[/C][C]160.5[/C][C]172.9085[/C][C]127.1972[/C][C]245.3882[/C][C]0.3686[/C][C]0.3739[/C][C]0.6916[/C][C]0.5076[/C][/ROW]
[ROW][C]203[/C][C]139.7[/C][C]174.7518[/C][C]127.0724[/C][C]251.7896[/C][C]0.1863[/C][C]0.6415[/C][C]0.665[/C][C]0.5259[/C][/ROW]
[ROW][C]204[/C][C]219.8[/C][C]168.5859[/C][C]121.9074[/C][C]244.6967[/C][C]0.0936[/C][C]0.7715[/C][C]0.7179[/C][C]0.4629[/C][/ROW]
[ROW][C]205[/C][C]143.9[/C][C]158.3054[/C][C]114.2762[/C][C]230.2995[/C][C]0.3475[/C][C]0.047[/C][C]0.7953[/C][C]0.3526[/C][/ROW]
[ROW][C]206[/C][C]166.2[/C][C]156.3282[/C][C]112.0154[/C][C]229.6732[/C][C]0.396[/C][C]0.6301[/C][C]0.801[/C][C]0.3357[/C][/ROW]
[ROW][C]207[/C][C]182.7[/C][C]175.9128[/C][C]123.0507[/C][C]266.9691[/C][C]0.4419[/C][C]0.5828[/C][C]0.6316[/C][C]0.5318[/C][/ROW]
[ROW][C]208[/C][C]152.7[/C][C]169.6033[/C][C]118.1854[/C][C]258.7386[/C][C]0.3551[/C][C]0.3867[/C][C]0.6818[/C][C]0.4772[/C][/ROW]
[ROW][C]209[/C][C]146.8[/C][C]165.0288[/C][C]114.4624[/C][C]253.3755[/C][C]0.343[/C][C]0.6078[/C][C]0.7129[/C][C]0.4368[/C][/ROW]
[ROW][C]210[/C][C]177.1[/C][C]191.6135[/C][C]129.0516[/C][C]306.4941[/C][C]0.4022[/C][C]0.7777[/C][C]0.4838[/C][C]0.6298[/C][/ROW]
[ROW][C]211[/C][C]186[/C][C]189.2924[/C][C]126.6632[/C][C]305.5814[/C][C]0.4779[/C][C]0.5814[/C][C]0.504[/C][C]0.6134[/C][/ROW]
[ROW][C]212[/C][C]189.2[/C][C]181.7251[/C][C]121.3641[/C][C]294.1761[/C][C]0.4482[/C][C]0.4703[/C][C]0.5659[/C][C]0.5659[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309826&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309826&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.8181.7251134.3718256.18640.46770.5990.5990.599
202160.5172.9085127.1972245.38820.36860.37390.69160.5076
203139.7174.7518127.0724251.78960.18630.64150.6650.5259
204219.8168.5859121.9074244.69670.09360.77150.71790.4629
205143.9158.3054114.2762230.29950.34750.0470.79530.3526
206166.2156.3282112.0154229.67320.3960.63010.8010.3357
207182.7175.9128123.0507266.96910.44190.58280.63160.5318
208152.7169.6033118.1854258.73860.35510.38670.68180.4772
209146.8165.0288114.4624253.37550.3430.60780.71290.4368
210177.1191.6135129.0516306.49410.40220.77770.48380.6298
211186189.2924126.6632305.58140.47790.58140.5040.6134
212189.2181.7251121.3641294.17610.44820.47030.56590.5659







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.20910.01660.01660.01689.4551000.10630.1063
2020.2139-0.07730.0470.0456153.970981.7139.0395-0.4290.2676
2030.2249-0.25090.1150.10471228.6263464.017521.5411-1.21170.5823
2040.23030.2330.14450.14452622.88541003.734431.68181.77040.8794
2050.232-0.10010.13560.1346207.5161844.490829.0601-0.4980.8031
2060.23940.05940.12290.122497.4533719.984526.83250.34130.7261
2070.26410.03710.11060.110346.0658623.710424.97420.23460.6559
2080.2681-0.11070.11070.1096285.7231581.46224.1135-0.58430.647
2090.2731-0.12420.11220.1105332.2896553.776223.5324-0.63020.6451
2100.3059-0.0820.10910.1073210.641519.462722.7917-0.50170.6308
2110.3134-0.01770.10080.099110.8397473.224221.7537-0.11380.5838
2120.31570.03950.09570.094255.8743438.445120.93910.25840.5566

\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.2091 & 0.0166 & 0.0166 & 0.0168 & 9.4551 & 0 & 0 & 0.1063 & 0.1063 \tabularnewline
202 & 0.2139 & -0.0773 & 0.047 & 0.0456 & 153.9709 & 81.713 & 9.0395 & -0.429 & 0.2676 \tabularnewline
203 & 0.2249 & -0.2509 & 0.115 & 0.1047 & 1228.6263 & 464.0175 & 21.5411 & -1.2117 & 0.5823 \tabularnewline
204 & 0.2303 & 0.233 & 0.1445 & 0.1445 & 2622.8854 & 1003.7344 & 31.6818 & 1.7704 & 0.8794 \tabularnewline
205 & 0.232 & -0.1001 & 0.1356 & 0.1346 & 207.5161 & 844.4908 & 29.0601 & -0.498 & 0.8031 \tabularnewline
206 & 0.2394 & 0.0594 & 0.1229 & 0.1224 & 97.4533 & 719.9845 & 26.8325 & 0.3413 & 0.7261 \tabularnewline
207 & 0.2641 & 0.0371 & 0.1106 & 0.1103 & 46.0658 & 623.7104 & 24.9742 & 0.2346 & 0.6559 \tabularnewline
208 & 0.2681 & -0.1107 & 0.1107 & 0.1096 & 285.7231 & 581.462 & 24.1135 & -0.5843 & 0.647 \tabularnewline
209 & 0.2731 & -0.1242 & 0.1122 & 0.1105 & 332.2896 & 553.7762 & 23.5324 & -0.6302 & 0.6451 \tabularnewline
210 & 0.3059 & -0.082 & 0.1091 & 0.1073 & 210.641 & 519.4627 & 22.7917 & -0.5017 & 0.6308 \tabularnewline
211 & 0.3134 & -0.0177 & 0.1008 & 0.0991 & 10.8397 & 473.2242 & 21.7537 & -0.1138 & 0.5838 \tabularnewline
212 & 0.3157 & 0.0395 & 0.0957 & 0.0942 & 55.8743 & 438.4451 & 20.9391 & 0.2584 & 0.5566 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309826&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.2091[/C][C]0.0166[/C][C]0.0166[/C][C]0.0168[/C][C]9.4551[/C][C]0[/C][C]0[/C][C]0.1063[/C][C]0.1063[/C][/ROW]
[ROW][C]202[/C][C]0.2139[/C][C]-0.0773[/C][C]0.047[/C][C]0.0456[/C][C]153.9709[/C][C]81.713[/C][C]9.0395[/C][C]-0.429[/C][C]0.2676[/C][/ROW]
[ROW][C]203[/C][C]0.2249[/C][C]-0.2509[/C][C]0.115[/C][C]0.1047[/C][C]1228.6263[/C][C]464.0175[/C][C]21.5411[/C][C]-1.2117[/C][C]0.5823[/C][/ROW]
[ROW][C]204[/C][C]0.2303[/C][C]0.233[/C][C]0.1445[/C][C]0.1445[/C][C]2622.8854[/C][C]1003.7344[/C][C]31.6818[/C][C]1.7704[/C][C]0.8794[/C][/ROW]
[ROW][C]205[/C][C]0.232[/C][C]-0.1001[/C][C]0.1356[/C][C]0.1346[/C][C]207.5161[/C][C]844.4908[/C][C]29.0601[/C][C]-0.498[/C][C]0.8031[/C][/ROW]
[ROW][C]206[/C][C]0.2394[/C][C]0.0594[/C][C]0.1229[/C][C]0.1224[/C][C]97.4533[/C][C]719.9845[/C][C]26.8325[/C][C]0.3413[/C][C]0.7261[/C][/ROW]
[ROW][C]207[/C][C]0.2641[/C][C]0.0371[/C][C]0.1106[/C][C]0.1103[/C][C]46.0658[/C][C]623.7104[/C][C]24.9742[/C][C]0.2346[/C][C]0.6559[/C][/ROW]
[ROW][C]208[/C][C]0.2681[/C][C]-0.1107[/C][C]0.1107[/C][C]0.1096[/C][C]285.7231[/C][C]581.462[/C][C]24.1135[/C][C]-0.5843[/C][C]0.647[/C][/ROW]
[ROW][C]209[/C][C]0.2731[/C][C]-0.1242[/C][C]0.1122[/C][C]0.1105[/C][C]332.2896[/C][C]553.7762[/C][C]23.5324[/C][C]-0.6302[/C][C]0.6451[/C][/ROW]
[ROW][C]210[/C][C]0.3059[/C][C]-0.082[/C][C]0.1091[/C][C]0.1073[/C][C]210.641[/C][C]519.4627[/C][C]22.7917[/C][C]-0.5017[/C][C]0.6308[/C][/ROW]
[ROW][C]211[/C][C]0.3134[/C][C]-0.0177[/C][C]0.1008[/C][C]0.0991[/C][C]10.8397[/C][C]473.2242[/C][C]21.7537[/C][C]-0.1138[/C][C]0.5838[/C][/ROW]
[ROW][C]212[/C][C]0.3157[/C][C]0.0395[/C][C]0.0957[/C][C]0.0942[/C][C]55.8743[/C][C]438.4451[/C][C]20.9391[/C][C]0.2584[/C][C]0.5566[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309826&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309826&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.20910.01660.01660.01689.4551000.10630.1063
2020.2139-0.07730.0470.0456153.970981.7139.0395-0.4290.2676
2030.2249-0.25090.1150.10471228.6263464.017521.5411-1.21170.5823
2040.23030.2330.14450.14452622.88541003.734431.68181.77040.8794
2050.232-0.10010.13560.1346207.5161844.490829.0601-0.4980.8031
2060.23940.05940.12290.122497.4533719.984526.83250.34130.7261
2070.26410.03710.11060.110346.0658623.710424.97420.23460.6559
2080.2681-0.11070.11070.1096285.7231581.46224.1135-0.58430.647
2090.2731-0.12420.11220.1105332.2896553.776223.5324-0.63020.6451
2100.3059-0.0820.10910.1073210.641519.462722.7917-0.50170.6308
2110.3134-0.01770.10080.099110.8397473.224221.7537-0.11380.5838
2120.31570.03950.09570.094255.8743438.445120.93910.25840.5566



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