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 computationWed, 20 Dec 2017 02:21:42 +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/20/t1513732925jrbspbevl4jyvdx.htm/, Retrieved Tue, 14 May 2024 12:15:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310435, Retrieved Tue, 14 May 2024 12:15:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact114
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [EEarimaF] [2017-12-20 01:21:42] [ec772448347bb766a411d58621b503be] [Current]
Feedback Forum

Post a new message
Dataseries X:
82
96.5
104.8
87.2
98.6
98.7
75
86.8
105
109.8
108.2
99
89.6
97.8
104.8
87
87.9
93.9
84.3
84
104.3
104.4
102.3
89.4
78.7
86.9
93.7
87
83.9
95.3
73.7
76.6
94.7
97.7
90
82.4
77.4
85
90.3
82.1
79.6
86.2
73.4
66.7
96.7
98.6
83.2
84
75.8
83.2
95.7
87.3
83.8
98.7
80.8
74.2
96.1
99.4
91.8
89.7
82.9
90
98.5
93.4
89.1
103
74.7
79
101.3
96.7
99.1
92.3
90.6
95.2
107.6
97.6
104
112
90.6
84.9
112.7
115.2
110.1
95.7
104.2
103.3
116.1
106.9
105.9
120.2
96.2
91.5
108.3
121.1
111.4
95.6
98.7
117.7
124.5
114.8
108
120.7
95.6
84.3
122.2
117.1
97.2
99.5
90.1
87.3
97.4
90.1
83.6
97.8
79.7
75.1
106.1
103.5
94.5
100.9
89.7
91.4
110.2
102.8
89.8
112.8
84
86.5
107.3
120.2
105.5
99.9
100.4
99.6
118.6
96
105.3
105.8
80.1
89.3
120.4
111.3
98.1
102.9
95.4
108.7
123
107.7
97.2
127.7
100.6
89.7
108.3
110
105.2
87.7
91.4
92.8
97.5
95.7
93.5
97.3
84.1
87.8
96.2
94.6
88.7
76.5
83.9
88.1
93
81.8
84.1
89.1
75.8
71.4
93.8
88.5
78.1
83.6
78.2
76.2
92
79.5
69.5
86.4
72.3
65
86
83.4
87.2
76.4
76.3
76.9
92.7
83.3
73.8
94
73.1
69.8
86
78.8
89.4
83.8
74.1
77.2
103.6
78
80.2
88.8
72.9
73.6




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310435&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])
18865-------
18986-------
19083.4-------
19187.2-------
19276.4-------
19376.3-------
19476.9-------
19592.7-------
19683.3-------
19773.8-------
19894-------
19973.1-------
20069.8-------
2018691.111881.7299102.20710.18330.99990.81670.9999
20278.888.910479.4258100.20120.03960.69330.83060.9995
20389.482.965674.022593.6330.11860.7780.21830.9922
20483.878.996769.514590.56020.20780.03890.67010.9405
20574.177.012567.421788.80530.31420.12960.54710.8847
20677.279.586569.080492.6850.36050.79420.65620.9285
207103.689.919776.6477106.96280.05780.92820.37460.9897
2087880.95469.091196.15660.35170.00180.38120.9248
20980.277.011865.567591.73650.33560.44770.66550.8315
21088.888.511273.997107.75550.48830.80140.28810.9717
21172.972.171561.001686.71570.46090.01250.45020.6254
21273.669.772158.81384.10610.30030.33440.49850.4985

\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 & 65 & - & - & - & - & - & - & - \tabularnewline
189 & 86 & - & - & - & - & - & - & - \tabularnewline
190 & 83.4 & - & - & - & - & - & - & - \tabularnewline
191 & 87.2 & - & - & - & - & - & - & - \tabularnewline
192 & 76.4 & - & - & - & - & - & - & - \tabularnewline
193 & 76.3 & - & - & - & - & - & - & - \tabularnewline
194 & 76.9 & - & - & - & - & - & - & - \tabularnewline
195 & 92.7 & - & - & - & - & - & - & - \tabularnewline
196 & 83.3 & - & - & - & - & - & - & - \tabularnewline
197 & 73.8 & - & - & - & - & - & - & - \tabularnewline
198 & 94 & - & - & - & - & - & - & - \tabularnewline
199 & 73.1 & - & - & - & - & - & - & - \tabularnewline
200 & 69.8 & - & - & - & - & - & - & - \tabularnewline
201 & 86 & 91.1118 & 81.7299 & 102.2071 & 0.1833 & 0.9999 & 0.8167 & 0.9999 \tabularnewline
202 & 78.8 & 88.9104 & 79.4258 & 100.2012 & 0.0396 & 0.6933 & 0.8306 & 0.9995 \tabularnewline
203 & 89.4 & 82.9656 & 74.0225 & 93.633 & 0.1186 & 0.778 & 0.2183 & 0.9922 \tabularnewline
204 & 83.8 & 78.9967 & 69.5145 & 90.5602 & 0.2078 & 0.0389 & 0.6701 & 0.9405 \tabularnewline
205 & 74.1 & 77.0125 & 67.4217 & 88.8053 & 0.3142 & 0.1296 & 0.5471 & 0.8847 \tabularnewline
206 & 77.2 & 79.5865 & 69.0804 & 92.685 & 0.3605 & 0.7942 & 0.6562 & 0.9285 \tabularnewline
207 & 103.6 & 89.9197 & 76.6477 & 106.9628 & 0.0578 & 0.9282 & 0.3746 & 0.9897 \tabularnewline
208 & 78 & 80.954 & 69.0911 & 96.1566 & 0.3517 & 0.0018 & 0.3812 & 0.9248 \tabularnewline
209 & 80.2 & 77.0118 & 65.5675 & 91.7365 & 0.3356 & 0.4477 & 0.6655 & 0.8315 \tabularnewline
210 & 88.8 & 88.5112 & 73.997 & 107.7555 & 0.4883 & 0.8014 & 0.2881 & 0.9717 \tabularnewline
211 & 72.9 & 72.1715 & 61.0016 & 86.7157 & 0.4609 & 0.0125 & 0.4502 & 0.6254 \tabularnewline
212 & 73.6 & 69.7721 & 58.813 & 84.1061 & 0.3003 & 0.3344 & 0.4985 & 0.4985 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310435&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]65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]86[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]83.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]87.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]76.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]76.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]76.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]92.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]83.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]73.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]94[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]73.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]69.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]86[/C][C]91.1118[/C][C]81.7299[/C][C]102.2071[/C][C]0.1833[/C][C]0.9999[/C][C]0.8167[/C][C]0.9999[/C][/ROW]
[ROW][C]202[/C][C]78.8[/C][C]88.9104[/C][C]79.4258[/C][C]100.2012[/C][C]0.0396[/C][C]0.6933[/C][C]0.8306[/C][C]0.9995[/C][/ROW]
[ROW][C]203[/C][C]89.4[/C][C]82.9656[/C][C]74.0225[/C][C]93.633[/C][C]0.1186[/C][C]0.778[/C][C]0.2183[/C][C]0.9922[/C][/ROW]
[ROW][C]204[/C][C]83.8[/C][C]78.9967[/C][C]69.5145[/C][C]90.5602[/C][C]0.2078[/C][C]0.0389[/C][C]0.6701[/C][C]0.9405[/C][/ROW]
[ROW][C]205[/C][C]74.1[/C][C]77.0125[/C][C]67.4217[/C][C]88.8053[/C][C]0.3142[/C][C]0.1296[/C][C]0.5471[/C][C]0.8847[/C][/ROW]
[ROW][C]206[/C][C]77.2[/C][C]79.5865[/C][C]69.0804[/C][C]92.685[/C][C]0.3605[/C][C]0.7942[/C][C]0.6562[/C][C]0.9285[/C][/ROW]
[ROW][C]207[/C][C]103.6[/C][C]89.9197[/C][C]76.6477[/C][C]106.9628[/C][C]0.0578[/C][C]0.9282[/C][C]0.3746[/C][C]0.9897[/C][/ROW]
[ROW][C]208[/C][C]78[/C][C]80.954[/C][C]69.0911[/C][C]96.1566[/C][C]0.3517[/C][C]0.0018[/C][C]0.3812[/C][C]0.9248[/C][/ROW]
[ROW][C]209[/C][C]80.2[/C][C]77.0118[/C][C]65.5675[/C][C]91.7365[/C][C]0.3356[/C][C]0.4477[/C][C]0.6655[/C][C]0.8315[/C][/ROW]
[ROW][C]210[/C][C]88.8[/C][C]88.5112[/C][C]73.997[/C][C]107.7555[/C][C]0.4883[/C][C]0.8014[/C][C]0.2881[/C][C]0.9717[/C][/ROW]
[ROW][C]211[/C][C]72.9[/C][C]72.1715[/C][C]61.0016[/C][C]86.7157[/C][C]0.4609[/C][C]0.0125[/C][C]0.4502[/C][C]0.6254[/C][/ROW]
[ROW][C]212[/C][C]73.6[/C][C]69.7721[/C][C]58.813[/C][C]84.1061[/C][C]0.3003[/C][C]0.3344[/C][C]0.4985[/C][C]0.4985[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310435&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310435&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])
18865-------
18986-------
19083.4-------
19187.2-------
19276.4-------
19376.3-------
19476.9-------
19592.7-------
19683.3-------
19773.8-------
19894-------
19973.1-------
20069.8-------
2018691.111881.7299102.20710.18330.99990.81670.9999
20278.888.910479.4258100.20120.03960.69330.83060.9995
20389.482.965674.022593.6330.11860.7780.21830.9922
20483.878.996769.514590.56020.20780.03890.67010.9405
20574.177.012567.421788.80530.31420.12960.54710.8847
20677.279.586569.080492.6850.36050.79420.65620.9285
207103.689.919776.6477106.96280.05780.92820.37460.9897
2087880.95469.091196.15660.35170.00180.38120.9248
20980.277.011865.567591.73650.33560.44770.66550.8315
21088.888.511273.997107.75550.48830.80140.28810.9717
21172.972.171561.001686.71570.46090.01250.45020.6254
21273.669.772158.81384.10610.30030.33440.49850.4985







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0621-0.05940.05940.057726.130900-0.48640.4864
2020.0648-0.12830.09390.0891102.220264.17568.011-0.96210.7242
2030.06560.0720.08660.084341.401456.58427.52220.61230.6869
2040.07470.05730.07930.07823.071548.2066.94310.45710.6295
2050.0781-0.03930.07130.07018.482640.26136.3452-0.27710.559
2060.084-0.03090.06450.06355.695234.50035.8737-0.22710.5037
2070.09670.1320.07420.0746187.150556.30757.50381.30180.6177
2080.0958-0.03790.06960.06998.726150.35987.0965-0.28110.5756
2090.09760.03980.06630.066710.164445.89366.77450.30340.5454
2100.11090.00330.060.06030.083441.31266.42750.02750.4936
2110.10280.010.05550.05580.530737.60526.13230.06930.455
2120.10480.0520.05520.055614.652935.69255.97430.36420.4474

\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.0621 & -0.0594 & 0.0594 & 0.0577 & 26.1309 & 0 & 0 & -0.4864 & 0.4864 \tabularnewline
202 & 0.0648 & -0.1283 & 0.0939 & 0.0891 & 102.2202 & 64.1756 & 8.011 & -0.9621 & 0.7242 \tabularnewline
203 & 0.0656 & 0.072 & 0.0866 & 0.0843 & 41.4014 & 56.5842 & 7.5222 & 0.6123 & 0.6869 \tabularnewline
204 & 0.0747 & 0.0573 & 0.0793 & 0.078 & 23.0715 & 48.206 & 6.9431 & 0.4571 & 0.6295 \tabularnewline
205 & 0.0781 & -0.0393 & 0.0713 & 0.0701 & 8.4826 & 40.2613 & 6.3452 & -0.2771 & 0.559 \tabularnewline
206 & 0.084 & -0.0309 & 0.0645 & 0.0635 & 5.6952 & 34.5003 & 5.8737 & -0.2271 & 0.5037 \tabularnewline
207 & 0.0967 & 0.132 & 0.0742 & 0.0746 & 187.1505 & 56.3075 & 7.5038 & 1.3018 & 0.6177 \tabularnewline
208 & 0.0958 & -0.0379 & 0.0696 & 0.0699 & 8.7261 & 50.3598 & 7.0965 & -0.2811 & 0.5756 \tabularnewline
209 & 0.0976 & 0.0398 & 0.0663 & 0.0667 & 10.1644 & 45.8936 & 6.7745 & 0.3034 & 0.5454 \tabularnewline
210 & 0.1109 & 0.0033 & 0.06 & 0.0603 & 0.0834 & 41.3126 & 6.4275 & 0.0275 & 0.4936 \tabularnewline
211 & 0.1028 & 0.01 & 0.0555 & 0.0558 & 0.5307 & 37.6052 & 6.1323 & 0.0693 & 0.455 \tabularnewline
212 & 0.1048 & 0.052 & 0.0552 & 0.0556 & 14.6529 & 35.6925 & 5.9743 & 0.3642 & 0.4474 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310435&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.0621[/C][C]-0.0594[/C][C]0.0594[/C][C]0.0577[/C][C]26.1309[/C][C]0[/C][C]0[/C][C]-0.4864[/C][C]0.4864[/C][/ROW]
[ROW][C]202[/C][C]0.0648[/C][C]-0.1283[/C][C]0.0939[/C][C]0.0891[/C][C]102.2202[/C][C]64.1756[/C][C]8.011[/C][C]-0.9621[/C][C]0.7242[/C][/ROW]
[ROW][C]203[/C][C]0.0656[/C][C]0.072[/C][C]0.0866[/C][C]0.0843[/C][C]41.4014[/C][C]56.5842[/C][C]7.5222[/C][C]0.6123[/C][C]0.6869[/C][/ROW]
[ROW][C]204[/C][C]0.0747[/C][C]0.0573[/C][C]0.0793[/C][C]0.078[/C][C]23.0715[/C][C]48.206[/C][C]6.9431[/C][C]0.4571[/C][C]0.6295[/C][/ROW]
[ROW][C]205[/C][C]0.0781[/C][C]-0.0393[/C][C]0.0713[/C][C]0.0701[/C][C]8.4826[/C][C]40.2613[/C][C]6.3452[/C][C]-0.2771[/C][C]0.559[/C][/ROW]
[ROW][C]206[/C][C]0.084[/C][C]-0.0309[/C][C]0.0645[/C][C]0.0635[/C][C]5.6952[/C][C]34.5003[/C][C]5.8737[/C][C]-0.2271[/C][C]0.5037[/C][/ROW]
[ROW][C]207[/C][C]0.0967[/C][C]0.132[/C][C]0.0742[/C][C]0.0746[/C][C]187.1505[/C][C]56.3075[/C][C]7.5038[/C][C]1.3018[/C][C]0.6177[/C][/ROW]
[ROW][C]208[/C][C]0.0958[/C][C]-0.0379[/C][C]0.0696[/C][C]0.0699[/C][C]8.7261[/C][C]50.3598[/C][C]7.0965[/C][C]-0.2811[/C][C]0.5756[/C][/ROW]
[ROW][C]209[/C][C]0.0976[/C][C]0.0398[/C][C]0.0663[/C][C]0.0667[/C][C]10.1644[/C][C]45.8936[/C][C]6.7745[/C][C]0.3034[/C][C]0.5454[/C][/ROW]
[ROW][C]210[/C][C]0.1109[/C][C]0.0033[/C][C]0.06[/C][C]0.0603[/C][C]0.0834[/C][C]41.3126[/C][C]6.4275[/C][C]0.0275[/C][C]0.4936[/C][/ROW]
[ROW][C]211[/C][C]0.1028[/C][C]0.01[/C][C]0.0555[/C][C]0.0558[/C][C]0.5307[/C][C]37.6052[/C][C]6.1323[/C][C]0.0693[/C][C]0.455[/C][/ROW]
[ROW][C]212[/C][C]0.1048[/C][C]0.052[/C][C]0.0552[/C][C]0.0556[/C][C]14.6529[/C][C]35.6925[/C][C]5.9743[/C][C]0.3642[/C][C]0.4474[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310435&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310435&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.0621-0.05940.05940.057726.130900-0.48640.4864
2020.0648-0.12830.09390.0891102.220264.17568.011-0.96210.7242
2030.06560.0720.08660.084341.401456.58427.52220.61230.6869
2040.07470.05730.07930.07823.071548.2066.94310.45710.6295
2050.0781-0.03930.07130.07018.482640.26136.3452-0.27710.559
2060.084-0.03090.06450.06355.695234.50035.8737-0.22710.5037
2070.09670.1320.07420.0746187.150556.30757.50381.30180.6177
2080.0958-0.03790.06960.06998.726150.35987.0965-0.28110.5756
2090.09760.03980.06630.066710.164445.89366.77450.30340.5454
2100.11090.00330.060.06030.083441.31266.42750.02750.4936
2110.10280.010.05550.05580.530737.60526.13230.06930.455
2120.10480.0520.05520.055614.652935.69255.97430.36420.4474



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