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 18:29:24 +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/t1513790985b6ue4dwwezwj2s8.htm/, Retrieved Tue, 14 May 2024 23:24:19 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310553, Retrieved Tue, 14 May 2024 23:24:19 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact82
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-12-20 17:29:24] [834c75312b1a933b06457deba9c9b5e8] [Current]
Feedback Forum

Post a new message
Dataseries X:
57,7
60,1
66,5
63,4
71,4
68,5
61,6
68,3
69,3
76,1
73,3
69,7
67,4
63,7
73
67,5
74,4
72,9
71,7
75,6
72,5
80
75,4
71
70,6
67,5
74,1
73,2
74
73
74
73
76
81,7
73,5
77
73,6
70,4
74,7
76,8
72,7
76
77,5
73,6
78,5
84,3
74,4
78,5
72,7
71,3
84,4
79,1
76,2
84,9
77,1
78,7
84,7
83,7
82,5
85,2
76
72,2
83,2
80,2
81,1
86
76
83,9
87,9
85
88,1
87,4
79,5
75,2
87,3
79,5
87,6
89,1
83
88,3
88,9
93,9
91,7
87,2
87,8
81
93,7
87,5
91,4
93,8
89,5
93,3
92,8
104,1
99,9
93,4
99
93,2
95,7
102,6
98,8
98
101,5
94,9
104,7
108,4
97
102,3
90,8
89,6
99,9
99,2
94
103
99,8
94,9
102
103,2
98
101,1
88,2
90,3
105,5
99,4
94,3
105,9
98
99
103,9
104,3
105,7
105,5
97,4
95,4
110,5
102,8
110
104,3
96,5
105,6
111,3
108,5
109,1
107,7
102,3
102,4
110,8
101,7
108,9
111,5
104
109,9
106,8
118,4
111,8
105
104,9
96,5
106,3
105,6
109,3
105,1
111,5
103,1
106,5
114,4
104,7
105,5
100,5
96,4
105,1
108,4
105,7
109
107,2
101,6
112,7
115,9
105
110,4
100,9
98,5
111,3
109,6
103,4
115,7
110,4
105,2
113,2
117,4
112,3
113,9
102,2
106,9
118
113,8
114,9
118,8
106,3
114,2
117,3
114,7
117
116,6
106,5
105,7
121
107,8
119,7
121
108,8
115




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310553&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])
188105.2-------
189113.2-------
190117.4-------
191112.3-------
192113.9-------
193102.2-------
194106.9-------
195118-------
196113.8-------
197114.9-------
198118.8-------
199106.3-------
200114.2-------
201117.3117.902111.7866124.14710.42510.87740.930.8774
202114.7118.9146112.7769125.18180.09370.69320.68210.9298
203117117.7511111.5543124.08110.40810.82760.95430.8642
204116.6116.1809109.116123.42190.45480.41230.73150.7041
205106.5108.5696101.6835115.6350.28290.0130.96140.0592
206105.7108.5236101.4011115.83810.22460.70620.66820.0641
207121118.4375110.7124126.36960.26330.99920.5430.8525
208107.8115.1753107.4576123.10570.03420.0750.6330.5952
209119.7116.9524108.9389125.19190.25670.98530.68730.7437
210121119.5348111.2433128.0630.36820.48490.56710.8899
211108.8113.9711105.7094122.47950.11680.05270.96140.479
212115116.3785107.8357125.17980.37940.95430.68620.6862

\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 & 105.2 & - & - & - & - & - & - & - \tabularnewline
189 & 113.2 & - & - & - & - & - & - & - \tabularnewline
190 & 117.4 & - & - & - & - & - & - & - \tabularnewline
191 & 112.3 & - & - & - & - & - & - & - \tabularnewline
192 & 113.9 & - & - & - & - & - & - & - \tabularnewline
193 & 102.2 & - & - & - & - & - & - & - \tabularnewline
194 & 106.9 & - & - & - & - & - & - & - \tabularnewline
195 & 118 & - & - & - & - & - & - & - \tabularnewline
196 & 113.8 & - & - & - & - & - & - & - \tabularnewline
197 & 114.9 & - & - & - & - & - & - & - \tabularnewline
198 & 118.8 & - & - & - & - & - & - & - \tabularnewline
199 & 106.3 & - & - & - & - & - & - & - \tabularnewline
200 & 114.2 & - & - & - & - & - & - & - \tabularnewline
201 & 117.3 & 117.902 & 111.7866 & 124.1471 & 0.4251 & 0.8774 & 0.93 & 0.8774 \tabularnewline
202 & 114.7 & 118.9146 & 112.7769 & 125.1818 & 0.0937 & 0.6932 & 0.6821 & 0.9298 \tabularnewline
203 & 117 & 117.7511 & 111.5543 & 124.0811 & 0.4081 & 0.8276 & 0.9543 & 0.8642 \tabularnewline
204 & 116.6 & 116.1809 & 109.116 & 123.4219 & 0.4548 & 0.4123 & 0.7315 & 0.7041 \tabularnewline
205 & 106.5 & 108.5696 & 101.6835 & 115.635 & 0.2829 & 0.013 & 0.9614 & 0.0592 \tabularnewline
206 & 105.7 & 108.5236 & 101.4011 & 115.8381 & 0.2246 & 0.7062 & 0.6682 & 0.0641 \tabularnewline
207 & 121 & 118.4375 & 110.7124 & 126.3696 & 0.2633 & 0.9992 & 0.543 & 0.8525 \tabularnewline
208 & 107.8 & 115.1753 & 107.4576 & 123.1057 & 0.0342 & 0.075 & 0.633 & 0.5952 \tabularnewline
209 & 119.7 & 116.9524 & 108.9389 & 125.1919 & 0.2567 & 0.9853 & 0.6873 & 0.7437 \tabularnewline
210 & 121 & 119.5348 & 111.2433 & 128.063 & 0.3682 & 0.4849 & 0.5671 & 0.8899 \tabularnewline
211 & 108.8 & 113.9711 & 105.7094 & 122.4795 & 0.1168 & 0.0527 & 0.9614 & 0.479 \tabularnewline
212 & 115 & 116.3785 & 107.8357 & 125.1798 & 0.3794 & 0.9543 & 0.6862 & 0.6862 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310553&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]105.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]113.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]117.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]112.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]113.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]102.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]106.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]118[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]113.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]114.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]118.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]106.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]114.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]117.3[/C][C]117.902[/C][C]111.7866[/C][C]124.1471[/C][C]0.4251[/C][C]0.8774[/C][C]0.93[/C][C]0.8774[/C][/ROW]
[ROW][C]202[/C][C]114.7[/C][C]118.9146[/C][C]112.7769[/C][C]125.1818[/C][C]0.0937[/C][C]0.6932[/C][C]0.6821[/C][C]0.9298[/C][/ROW]
[ROW][C]203[/C][C]117[/C][C]117.7511[/C][C]111.5543[/C][C]124.0811[/C][C]0.4081[/C][C]0.8276[/C][C]0.9543[/C][C]0.8642[/C][/ROW]
[ROW][C]204[/C][C]116.6[/C][C]116.1809[/C][C]109.116[/C][C]123.4219[/C][C]0.4548[/C][C]0.4123[/C][C]0.7315[/C][C]0.7041[/C][/ROW]
[ROW][C]205[/C][C]106.5[/C][C]108.5696[/C][C]101.6835[/C][C]115.635[/C][C]0.2829[/C][C]0.013[/C][C]0.9614[/C][C]0.0592[/C][/ROW]
[ROW][C]206[/C][C]105.7[/C][C]108.5236[/C][C]101.4011[/C][C]115.8381[/C][C]0.2246[/C][C]0.7062[/C][C]0.6682[/C][C]0.0641[/C][/ROW]
[ROW][C]207[/C][C]121[/C][C]118.4375[/C][C]110.7124[/C][C]126.3696[/C][C]0.2633[/C][C]0.9992[/C][C]0.543[/C][C]0.8525[/C][/ROW]
[ROW][C]208[/C][C]107.8[/C][C]115.1753[/C][C]107.4576[/C][C]123.1057[/C][C]0.0342[/C][C]0.075[/C][C]0.633[/C][C]0.5952[/C][/ROW]
[ROW][C]209[/C][C]119.7[/C][C]116.9524[/C][C]108.9389[/C][C]125.1919[/C][C]0.2567[/C][C]0.9853[/C][C]0.6873[/C][C]0.7437[/C][/ROW]
[ROW][C]210[/C][C]121[/C][C]119.5348[/C][C]111.2433[/C][C]128.063[/C][C]0.3682[/C][C]0.4849[/C][C]0.5671[/C][C]0.8899[/C][/ROW]
[ROW][C]211[/C][C]108.8[/C][C]113.9711[/C][C]105.7094[/C][C]122.4795[/C][C]0.1168[/C][C]0.0527[/C][C]0.9614[/C][C]0.479[/C][/ROW]
[ROW][C]212[/C][C]115[/C][C]116.3785[/C][C]107.8357[/C][C]125.1798[/C][C]0.3794[/C][C]0.9543[/C][C]0.6862[/C][C]0.6862[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310553&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310553&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])
188105.2-------
189113.2-------
190117.4-------
191112.3-------
192113.9-------
193102.2-------
194106.9-------
195118-------
196113.8-------
197114.9-------
198118.8-------
199106.3-------
200114.2-------
201117.3117.902111.7866124.14710.42510.87740.930.8774
202114.7118.9146112.7769125.18180.09370.69320.68210.9298
203117117.7511111.5543124.08110.40810.82760.95430.8642
204116.6116.1809109.116123.42190.45480.41230.73150.7041
205106.5108.5696101.6835115.6350.28290.0130.96140.0592
206105.7108.5236101.4011115.83810.22460.70620.66820.0641
207121118.4375110.7124126.36960.26330.99920.5430.8525
208107.8115.1753107.4576123.10570.03420.0750.6330.5952
209119.7116.9524108.9389125.19190.25670.98530.68730.7437
210121119.5348111.2433128.0630.36820.48490.56710.8899
211108.8113.9711105.7094122.47950.11680.05270.96140.479
212115116.3785107.8357125.17980.37940.95430.68620.6862







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.027-0.00510.00510.00510.362500-0.08680.0868
2020.0269-0.03670.02090.020617.76289.06263.0104-0.60760.3472
2030.0274-0.00640.01610.01590.56416.22982.496-0.10830.2676
2040.03180.00360.0130.01280.17574.71632.17170.06040.2158
2050.0332-0.01940.01430.01414.28324.62962.1517-0.29840.2323
2060.0344-0.02670.01630.01617.97255.18682.2775-0.40710.2614
2070.03420.02120.0170.01696.56665.38392.32030.36940.2769
2080.0351-0.06840.02350.02354.395411.51033.3927-1.06330.3752
2090.03590.0230.02340.02317.549311.07023.32720.39610.3775
2100.03640.01210.02230.0222.146810.17793.19030.21120.3609
2110.0381-0.04750.02460.024226.739811.68353.4181-0.74550.3958
2120.0386-0.0120.02350.02321.900210.86823.2967-0.19870.3794

\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.027 & -0.0051 & 0.0051 & 0.0051 & 0.3625 & 0 & 0 & -0.0868 & 0.0868 \tabularnewline
202 & 0.0269 & -0.0367 & 0.0209 & 0.0206 & 17.7628 & 9.0626 & 3.0104 & -0.6076 & 0.3472 \tabularnewline
203 & 0.0274 & -0.0064 & 0.0161 & 0.0159 & 0.5641 & 6.2298 & 2.496 & -0.1083 & 0.2676 \tabularnewline
204 & 0.0318 & 0.0036 & 0.013 & 0.0128 & 0.1757 & 4.7163 & 2.1717 & 0.0604 & 0.2158 \tabularnewline
205 & 0.0332 & -0.0194 & 0.0143 & 0.0141 & 4.2832 & 4.6296 & 2.1517 & -0.2984 & 0.2323 \tabularnewline
206 & 0.0344 & -0.0267 & 0.0163 & 0.0161 & 7.9725 & 5.1868 & 2.2775 & -0.4071 & 0.2614 \tabularnewline
207 & 0.0342 & 0.0212 & 0.017 & 0.0169 & 6.5666 & 5.3839 & 2.3203 & 0.3694 & 0.2769 \tabularnewline
208 & 0.0351 & -0.0684 & 0.0235 & 0.023 & 54.3954 & 11.5103 & 3.3927 & -1.0633 & 0.3752 \tabularnewline
209 & 0.0359 & 0.023 & 0.0234 & 0.0231 & 7.5493 & 11.0702 & 3.3272 & 0.3961 & 0.3775 \tabularnewline
210 & 0.0364 & 0.0121 & 0.0223 & 0.022 & 2.1468 & 10.1779 & 3.1903 & 0.2112 & 0.3609 \tabularnewline
211 & 0.0381 & -0.0475 & 0.0246 & 0.0242 & 26.7398 & 11.6835 & 3.4181 & -0.7455 & 0.3958 \tabularnewline
212 & 0.0386 & -0.012 & 0.0235 & 0.0232 & 1.9002 & 10.8682 & 3.2967 & -0.1987 & 0.3794 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310553&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.027[/C][C]-0.0051[/C][C]0.0051[/C][C]0.0051[/C][C]0.3625[/C][C]0[/C][C]0[/C][C]-0.0868[/C][C]0.0868[/C][/ROW]
[ROW][C]202[/C][C]0.0269[/C][C]-0.0367[/C][C]0.0209[/C][C]0.0206[/C][C]17.7628[/C][C]9.0626[/C][C]3.0104[/C][C]-0.6076[/C][C]0.3472[/C][/ROW]
[ROW][C]203[/C][C]0.0274[/C][C]-0.0064[/C][C]0.0161[/C][C]0.0159[/C][C]0.5641[/C][C]6.2298[/C][C]2.496[/C][C]-0.1083[/C][C]0.2676[/C][/ROW]
[ROW][C]204[/C][C]0.0318[/C][C]0.0036[/C][C]0.013[/C][C]0.0128[/C][C]0.1757[/C][C]4.7163[/C][C]2.1717[/C][C]0.0604[/C][C]0.2158[/C][/ROW]
[ROW][C]205[/C][C]0.0332[/C][C]-0.0194[/C][C]0.0143[/C][C]0.0141[/C][C]4.2832[/C][C]4.6296[/C][C]2.1517[/C][C]-0.2984[/C][C]0.2323[/C][/ROW]
[ROW][C]206[/C][C]0.0344[/C][C]-0.0267[/C][C]0.0163[/C][C]0.0161[/C][C]7.9725[/C][C]5.1868[/C][C]2.2775[/C][C]-0.4071[/C][C]0.2614[/C][/ROW]
[ROW][C]207[/C][C]0.0342[/C][C]0.0212[/C][C]0.017[/C][C]0.0169[/C][C]6.5666[/C][C]5.3839[/C][C]2.3203[/C][C]0.3694[/C][C]0.2769[/C][/ROW]
[ROW][C]208[/C][C]0.0351[/C][C]-0.0684[/C][C]0.0235[/C][C]0.023[/C][C]54.3954[/C][C]11.5103[/C][C]3.3927[/C][C]-1.0633[/C][C]0.3752[/C][/ROW]
[ROW][C]209[/C][C]0.0359[/C][C]0.023[/C][C]0.0234[/C][C]0.0231[/C][C]7.5493[/C][C]11.0702[/C][C]3.3272[/C][C]0.3961[/C][C]0.3775[/C][/ROW]
[ROW][C]210[/C][C]0.0364[/C][C]0.0121[/C][C]0.0223[/C][C]0.022[/C][C]2.1468[/C][C]10.1779[/C][C]3.1903[/C][C]0.2112[/C][C]0.3609[/C][/ROW]
[ROW][C]211[/C][C]0.0381[/C][C]-0.0475[/C][C]0.0246[/C][C]0.0242[/C][C]26.7398[/C][C]11.6835[/C][C]3.4181[/C][C]-0.7455[/C][C]0.3958[/C][/ROW]
[ROW][C]212[/C][C]0.0386[/C][C]-0.012[/C][C]0.0235[/C][C]0.0232[/C][C]1.9002[/C][C]10.8682[/C][C]3.2967[/C][C]-0.1987[/C][C]0.3794[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310553&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310553&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.027-0.00510.00510.00510.362500-0.08680.0868
2020.0269-0.03670.02090.020617.76289.06263.0104-0.60760.3472
2030.0274-0.00640.01610.01590.56416.22982.496-0.10830.2676
2040.03180.00360.0130.01280.17574.71632.17170.06040.2158
2050.0332-0.01940.01430.01414.28324.62962.1517-0.29840.2323
2060.0344-0.02670.01630.01617.97255.18682.2775-0.40710.2614
2070.03420.02120.0170.01696.56665.38392.32030.36940.2769
2080.0351-0.06840.02350.02354.395411.51033.3927-1.06330.3752
2090.03590.0230.02340.02317.549311.07023.32720.39610.3775
2100.03640.01210.02230.0222.146810.17793.19030.21120.3609
2110.0381-0.04750.02460.024226.739811.68353.4181-0.74550.3958
2120.0386-0.0120.02350.02321.900210.86823.2967-0.19870.3794



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