Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 14 Dec 2017 11:56:16 +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/14/t15132500957rd0vwtbo7pu86o.htm/, Retrieved Tue, 14 May 2024 03:04:51 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=309458, Retrieved Tue, 14 May 2024 03:04:51 +0000
QR Codes:

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

Post a new message
Dataseries X:
81.6
86.1
96.5
85.4
94.5
90
69.1
82.4
96.5
100
94.7
88.8
95.4
88.4
101.3
88.7
92.8
93.3
77.6
84.6
96.9
101.3
92.2
87.6
89.8
84.8
94.2
91.3
88.9
89.7
75.8
80.5
98
101.4
90.4
86.5
89.9
83.4
93.2
90.3
86.8
87.5
75.7
77.4
98
100.8
86.5
92
87.8
84.7
99.9
92.2
85.3
96.3
72.9
82.8
98.5
95.2
89.5
94
85
86
96.8
92.1
87.3
94.3
71
81.5
101.5
92.8
92.1
97.9
88.9
89.7
102.2
88.4
94.3
97.6
73.9
87.9
102.7
104.5
100.5
99.5
94.2
95.1
108.1
94.6
98
101.7
83.1
92.9
104.1
111.1
104.1
99
110.7
107.7
113.2
114.3
107.1
109.6
89.2
96.1
118.7
120.8
105
109.8
96.1
97.8
108.3
99.1
93.6
100.1
80.9
87.5
107.4
107.1
99.5
101.8
92
95.8
110
99.4
94.4
105.4
84.1
92.3
109.8
106.8
103.8
106.2
91.2
94.7
109.9
93.7
101.4
93.6
78.3
91.8
107.8
98.8
98.6
99.9
89.7
94.4
103.2
89.9
92.6
97.8
81.1
91.2
101.4
105.3
95.8
91.3
91.1
88.8
95.3
89.4
88.3
87.4
78.9
82.2
94.5
98.8
88.1
86.5
88.1
85.8
94
90.4
86.4
90.3
82.1
82.1
97.7
99.1
85.9
89.1
85.7
85.9
99.9
91.6
82.9
96.6
81.5
84
100.8
102
92.9
93.2
86.7
91.6
97.6
92.8
93.5
95.5
75.1
90.9
98.9
95.5
94.3
90.3
87.9
88.7
100.3
85.5
93
96
77.6
87.5




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309458&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])
18884-------
189100.8-------
190102-------
19192.9-------
19293.2-------
19386.7-------
19491.6-------
19597.6-------
19692.8-------
19793.5-------
19895.5-------
19975.1-------
20090.9-------
20198.9100.612592.0394110.25330.36390.97580.48480.9758
20295.5104.654595.1012115.49390.04890.8510.68440.9936
20394.394.117584.6977104.9460.48680.40120.58720.7198
20490.395.218385.2476106.75980.20180.5620.63410.7683
20587.990.138580.4344101.42130.34870.48880.72490.4474
20688.791.179581.0869102.9680.34010.70720.47210.5185
207100.3101.049689.3044114.88470.45770.95990.68750.9248
20885.593.237282.4904105.87750.11510.13670.5270.6415
2099391.401780.8102103.87110.40080.82320.37080.5314
2109695.620484.3119108.98260.47780.64960.5070.7557
21177.679.361270.393489.87280.37130.0010.78660.0157
21287.587.139776.988699.10190.47650.9410.26890.2689

\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 & 84 & - & - & - & - & - & - & - \tabularnewline
189 & 100.8 & - & - & - & - & - & - & - \tabularnewline
190 & 102 & - & - & - & - & - & - & - \tabularnewline
191 & 92.9 & - & - & - & - & - & - & - \tabularnewline
192 & 93.2 & - & - & - & - & - & - & - \tabularnewline
193 & 86.7 & - & - & - & - & - & - & - \tabularnewline
194 & 91.6 & - & - & - & - & - & - & - \tabularnewline
195 & 97.6 & - & - & - & - & - & - & - \tabularnewline
196 & 92.8 & - & - & - & - & - & - & - \tabularnewline
197 & 93.5 & - & - & - & - & - & - & - \tabularnewline
198 & 95.5 & - & - & - & - & - & - & - \tabularnewline
199 & 75.1 & - & - & - & - & - & - & - \tabularnewline
200 & 90.9 & - & - & - & - & - & - & - \tabularnewline
201 & 98.9 & 100.6125 & 92.0394 & 110.2533 & 0.3639 & 0.9758 & 0.4848 & 0.9758 \tabularnewline
202 & 95.5 & 104.6545 & 95.1012 & 115.4939 & 0.0489 & 0.851 & 0.6844 & 0.9936 \tabularnewline
203 & 94.3 & 94.1175 & 84.6977 & 104.946 & 0.4868 & 0.4012 & 0.5872 & 0.7198 \tabularnewline
204 & 90.3 & 95.2183 & 85.2476 & 106.7598 & 0.2018 & 0.562 & 0.6341 & 0.7683 \tabularnewline
205 & 87.9 & 90.1385 & 80.4344 & 101.4213 & 0.3487 & 0.4888 & 0.7249 & 0.4474 \tabularnewline
206 & 88.7 & 91.1795 & 81.0869 & 102.968 & 0.3401 & 0.7072 & 0.4721 & 0.5185 \tabularnewline
207 & 100.3 & 101.0496 & 89.3044 & 114.8847 & 0.4577 & 0.9599 & 0.6875 & 0.9248 \tabularnewline
208 & 85.5 & 93.2372 & 82.4904 & 105.8775 & 0.1151 & 0.1367 & 0.527 & 0.6415 \tabularnewline
209 & 93 & 91.4017 & 80.8102 & 103.8711 & 0.4008 & 0.8232 & 0.3708 & 0.5314 \tabularnewline
210 & 96 & 95.6204 & 84.3119 & 108.9826 & 0.4778 & 0.6496 & 0.507 & 0.7557 \tabularnewline
211 & 77.6 & 79.3612 & 70.3934 & 89.8728 & 0.3713 & 0.001 & 0.7866 & 0.0157 \tabularnewline
212 & 87.5 & 87.1397 & 76.9886 & 99.1019 & 0.4765 & 0.941 & 0.2689 & 0.2689 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309458&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]84[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]100.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]102[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]92.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]93.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]86.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]91.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]97.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]92.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]93.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]95.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]75.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]90.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]98.9[/C][C]100.6125[/C][C]92.0394[/C][C]110.2533[/C][C]0.3639[/C][C]0.9758[/C][C]0.4848[/C][C]0.9758[/C][/ROW]
[ROW][C]202[/C][C]95.5[/C][C]104.6545[/C][C]95.1012[/C][C]115.4939[/C][C]0.0489[/C][C]0.851[/C][C]0.6844[/C][C]0.9936[/C][/ROW]
[ROW][C]203[/C][C]94.3[/C][C]94.1175[/C][C]84.6977[/C][C]104.946[/C][C]0.4868[/C][C]0.4012[/C][C]0.5872[/C][C]0.7198[/C][/ROW]
[ROW][C]204[/C][C]90.3[/C][C]95.2183[/C][C]85.2476[/C][C]106.7598[/C][C]0.2018[/C][C]0.562[/C][C]0.6341[/C][C]0.7683[/C][/ROW]
[ROW][C]205[/C][C]87.9[/C][C]90.1385[/C][C]80.4344[/C][C]101.4213[/C][C]0.3487[/C][C]0.4888[/C][C]0.7249[/C][C]0.4474[/C][/ROW]
[ROW][C]206[/C][C]88.7[/C][C]91.1795[/C][C]81.0869[/C][C]102.968[/C][C]0.3401[/C][C]0.7072[/C][C]0.4721[/C][C]0.5185[/C][/ROW]
[ROW][C]207[/C][C]100.3[/C][C]101.0496[/C][C]89.3044[/C][C]114.8847[/C][C]0.4577[/C][C]0.9599[/C][C]0.6875[/C][C]0.9248[/C][/ROW]
[ROW][C]208[/C][C]85.5[/C][C]93.2372[/C][C]82.4904[/C][C]105.8775[/C][C]0.1151[/C][C]0.1367[/C][C]0.527[/C][C]0.6415[/C][/ROW]
[ROW][C]209[/C][C]93[/C][C]91.4017[/C][C]80.8102[/C][C]103.8711[/C][C]0.4008[/C][C]0.8232[/C][C]0.3708[/C][C]0.5314[/C][/ROW]
[ROW][C]210[/C][C]96[/C][C]95.6204[/C][C]84.3119[/C][C]108.9826[/C][C]0.4778[/C][C]0.6496[/C][C]0.507[/C][C]0.7557[/C][/ROW]
[ROW][C]211[/C][C]77.6[/C][C]79.3612[/C][C]70.3934[/C][C]89.8728[/C][C]0.3713[/C][C]0.001[/C][C]0.7866[/C][C]0.0157[/C][/ROW]
[ROW][C]212[/C][C]87.5[/C][C]87.1397[/C][C]76.9886[/C][C]99.1019[/C][C]0.4765[/C][C]0.941[/C][C]0.2689[/C][C]0.2689[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309458&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309458&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])
18884-------
189100.8-------
190102-------
19192.9-------
19293.2-------
19386.7-------
19491.6-------
19597.6-------
19692.8-------
19793.5-------
19895.5-------
19975.1-------
20090.9-------
20198.9100.612592.0394110.25330.36390.97580.48480.9758
20295.5104.654595.1012115.49390.04890.8510.68440.9936
20394.394.117584.6977104.9460.48680.40120.58720.7198
20490.395.218385.2476106.75980.20180.5620.63410.7683
20587.990.138580.4344101.42130.34870.48880.72490.4474
20688.791.179581.0869102.9680.34010.70720.47210.5185
207100.3101.049689.3044114.88470.45770.95990.68750.9248
20885.593.237282.4904105.87750.11510.13670.5270.6415
2099391.401780.8102103.87110.40080.82320.37080.5314
2109695.620484.3119108.98260.47780.64960.5070.7557
21177.679.361270.393489.87280.37130.0010.78660.0157
21287.587.139776.988699.10190.47650.9410.26890.2689







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0489-0.01730.01730.01722.932600-0.24460.2446
2020.0528-0.09590.05660.054383.805143.36886.5855-1.30780.7762
2030.05870.00190.03840.03690.033328.92375.37810.02610.5262
2040.0618-0.05450.04240.040924.189627.74015.2669-0.70260.5703
2050.0639-0.02550.0390.03775.010923.19434.816-0.31980.5202
2060.066-0.0280.03720.03616.14820.35334.5115-0.35420.4925
2070.0699-0.00750.03290.0320.561917.52594.1864-0.10710.4375
2080.0692-0.09050.04010.038859.863722.81814.7768-1.10530.5209
2090.06960.01720.03760.03642.554620.56664.5350.22830.4884
2100.07130.0040.03420.03320.144118.52444.3040.05420.445
2110.0676-0.02270.03320.03223.101917.12234.1379-0.25160.4274
2120.070.00410.03070.02990.129815.70633.96310.05150.3961

\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.0489 & -0.0173 & 0.0173 & 0.0172 & 2.9326 & 0 & 0 & -0.2446 & 0.2446 \tabularnewline
202 & 0.0528 & -0.0959 & 0.0566 & 0.0543 & 83.8051 & 43.3688 & 6.5855 & -1.3078 & 0.7762 \tabularnewline
203 & 0.0587 & 0.0019 & 0.0384 & 0.0369 & 0.0333 & 28.9237 & 5.3781 & 0.0261 & 0.5262 \tabularnewline
204 & 0.0618 & -0.0545 & 0.0424 & 0.0409 & 24.1896 & 27.7401 & 5.2669 & -0.7026 & 0.5703 \tabularnewline
205 & 0.0639 & -0.0255 & 0.039 & 0.0377 & 5.0109 & 23.1943 & 4.816 & -0.3198 & 0.5202 \tabularnewline
206 & 0.066 & -0.028 & 0.0372 & 0.0361 & 6.148 & 20.3533 & 4.5115 & -0.3542 & 0.4925 \tabularnewline
207 & 0.0699 & -0.0075 & 0.0329 & 0.032 & 0.5619 & 17.5259 & 4.1864 & -0.1071 & 0.4375 \tabularnewline
208 & 0.0692 & -0.0905 & 0.0401 & 0.0388 & 59.8637 & 22.8181 & 4.7768 & -1.1053 & 0.5209 \tabularnewline
209 & 0.0696 & 0.0172 & 0.0376 & 0.0364 & 2.5546 & 20.5666 & 4.535 & 0.2283 & 0.4884 \tabularnewline
210 & 0.0713 & 0.004 & 0.0342 & 0.0332 & 0.1441 & 18.5244 & 4.304 & 0.0542 & 0.445 \tabularnewline
211 & 0.0676 & -0.0227 & 0.0332 & 0.0322 & 3.1019 & 17.1223 & 4.1379 & -0.2516 & 0.4274 \tabularnewline
212 & 0.07 & 0.0041 & 0.0307 & 0.0299 & 0.1298 & 15.7063 & 3.9631 & 0.0515 & 0.3961 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=309458&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.0489[/C][C]-0.0173[/C][C]0.0173[/C][C]0.0172[/C][C]2.9326[/C][C]0[/C][C]0[/C][C]-0.2446[/C][C]0.2446[/C][/ROW]
[ROW][C]202[/C][C]0.0528[/C][C]-0.0959[/C][C]0.0566[/C][C]0.0543[/C][C]83.8051[/C][C]43.3688[/C][C]6.5855[/C][C]-1.3078[/C][C]0.7762[/C][/ROW]
[ROW][C]203[/C][C]0.0587[/C][C]0.0019[/C][C]0.0384[/C][C]0.0369[/C][C]0.0333[/C][C]28.9237[/C][C]5.3781[/C][C]0.0261[/C][C]0.5262[/C][/ROW]
[ROW][C]204[/C][C]0.0618[/C][C]-0.0545[/C][C]0.0424[/C][C]0.0409[/C][C]24.1896[/C][C]27.7401[/C][C]5.2669[/C][C]-0.7026[/C][C]0.5703[/C][/ROW]
[ROW][C]205[/C][C]0.0639[/C][C]-0.0255[/C][C]0.039[/C][C]0.0377[/C][C]5.0109[/C][C]23.1943[/C][C]4.816[/C][C]-0.3198[/C][C]0.5202[/C][/ROW]
[ROW][C]206[/C][C]0.066[/C][C]-0.028[/C][C]0.0372[/C][C]0.0361[/C][C]6.148[/C][C]20.3533[/C][C]4.5115[/C][C]-0.3542[/C][C]0.4925[/C][/ROW]
[ROW][C]207[/C][C]0.0699[/C][C]-0.0075[/C][C]0.0329[/C][C]0.032[/C][C]0.5619[/C][C]17.5259[/C][C]4.1864[/C][C]-0.1071[/C][C]0.4375[/C][/ROW]
[ROW][C]208[/C][C]0.0692[/C][C]-0.0905[/C][C]0.0401[/C][C]0.0388[/C][C]59.8637[/C][C]22.8181[/C][C]4.7768[/C][C]-1.1053[/C][C]0.5209[/C][/ROW]
[ROW][C]209[/C][C]0.0696[/C][C]0.0172[/C][C]0.0376[/C][C]0.0364[/C][C]2.5546[/C][C]20.5666[/C][C]4.535[/C][C]0.2283[/C][C]0.4884[/C][/ROW]
[ROW][C]210[/C][C]0.0713[/C][C]0.004[/C][C]0.0342[/C][C]0.0332[/C][C]0.1441[/C][C]18.5244[/C][C]4.304[/C][C]0.0542[/C][C]0.445[/C][/ROW]
[ROW][C]211[/C][C]0.0676[/C][C]-0.0227[/C][C]0.0332[/C][C]0.0322[/C][C]3.1019[/C][C]17.1223[/C][C]4.1379[/C][C]-0.2516[/C][C]0.4274[/C][/ROW]
[ROW][C]212[/C][C]0.07[/C][C]0.0041[/C][C]0.0307[/C][C]0.0299[/C][C]0.1298[/C][C]15.7063[/C][C]3.9631[/C][C]0.0515[/C][C]0.3961[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=309458&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=309458&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.0489-0.01730.01730.01722.932600-0.24460.2446
2020.0528-0.09590.05660.054383.805143.36886.5855-1.30780.7762
2030.05870.00190.03840.03690.033328.92375.37810.02610.5262
2040.0618-0.05450.04240.040924.189627.74015.2669-0.70260.5703
2050.0639-0.02550.0390.03775.010923.19434.816-0.31980.5202
2060.066-0.0280.03720.03616.14820.35334.5115-0.35420.4925
2070.0699-0.00750.03290.0320.561917.52594.1864-0.10710.4375
2080.0692-0.09050.04010.038859.863722.81814.7768-1.10530.5209
2090.06960.01720.03760.03642.554620.56664.5350.22830.4884
2100.07130.0040.03420.03320.144118.52444.3040.05420.445
2110.0676-0.02270.03320.03223.101917.12234.1379-0.25160.4274
2120.070.00410.03070.02990.129815.70633.96310.05150.3961



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