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 21:01:06 +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/t1513800130co1pojae0gl6eam.htm/, Retrieved Mon, 13 May 2024 23:48:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310570, Retrieved Mon, 13 May 2024 23:48:33 +0000
QR Codes:

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

Post a new message
Dataseries X:
122.2
136.1
145.5
116.7
137.1
125.5
112.4
106.3
145.7
151.5
144.6
116.4
137.7
138.8
149.5
125
133.4
134.4
124.8
110.6
142.4
149.6
134.6
103.3
136.5
137.1
140.7
131.4
126.2
125.3
126.6
107.7
144.5
154.2
131.4
105.7
136.2
133.3
130
129.3
113.1
117.7
116.3
97.3
140.6
141.2
120.8
106.2
121.5
122.6
137.2
118.9
107.2
127.4
111.8
100
138.3
128
121.2
105.9
112.5
123.1
129
115.5
105.7
122.3
106.4
101.1
131.6
119.5
127
106.9
115.9
122.7
137.2
108.5
115.2
129.4
112.3
104.3
140
139.9
134.9
105.1
127
135.5
143.9
115.8
117.5
129.3
117.9
108.1
131.7
143.7
126.2
96.9
125.8
129.6
124.9
136.8
107.5
114.3
110.3
85.5
116.8
115.1
95.2
83.4
95.4
96.3
100.5
90.9
80.6
94.8
93.9
75.9
101.6
103.3
91.8
83.5
92
101.2
109.1
99.8
90.8
110.6
97.8
81.9
114.4
108.8
103.1
90.4
94.4
100.5
115.1
93.9
102.5
97.1
91.2
82.3
107.1
99.2
94.8
81.1
92.5
97.7
98.5
81.2
86.2
92
86.3
74.8
90
101.1
87.8
66.3
88.6
90
92
85.1
85.9
88.5
92.3
68
93.6
97.7
85.1
69.9
96.1
97
95.9
91.3
83.5
91.4
96.8
71
106.9
102.7
84.9
75.8
93.6
100.7
100.5
95.9
85.7
104.1
93.5
81.5
102.1
98.2
88.4
77.8
90.1
101
98.6
91.5
86.4
98.9
85.2
77.3
93
86.8
91.3
74.9
93.9
95
103.1
81.4
93.1
97.2
86.4
75.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=310570&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=310570&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310570&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])
18881.5-------
189102.1-------
19098.2-------
19188.4-------
19277.8-------
19390.1-------
194101-------
19598.6-------
19691.5000000000001-------
19786.4-------
19898.9-------
19985.2-------
20077.3-------
2019398.453888.4219109.8830.17480.99990.26590.9999
20286.893.614584.0737104.48450.10960.54410.20420.9984
20391.387.664678.378198.30320.25150.56330.44610.9719
20474.972.972964.157383.28280.35712e-040.17940.2054
20593.989.595878.1991103.0450.26520.98390.47070.9634
2069599.310985.7106115.58480.30180.74270.41940.996
207103.195.235481.4421111.92910.17790.5110.34640.9824
20881.490.119276.943106.09790.14240.05570.43280.9421
20993.184.328771.593899.88090.13450.6440.3970.8121
21097.294.768579.6179113.51370.39970.56920.33290.9661
21186.488.16173.9363105.79940.42240.15760.62890.8863
21275.574.66962.573589.68150.45680.06280.36560.3656

\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 & 81.5 & - & - & - & - & - & - & - \tabularnewline
189 & 102.1 & - & - & - & - & - & - & - \tabularnewline
190 & 98.2 & - & - & - & - & - & - & - \tabularnewline
191 & 88.4 & - & - & - & - & - & - & - \tabularnewline
192 & 77.8 & - & - & - & - & - & - & - \tabularnewline
193 & 90.1 & - & - & - & - & - & - & - \tabularnewline
194 & 101 & - & - & - & - & - & - & - \tabularnewline
195 & 98.6 & - & - & - & - & - & - & - \tabularnewline
196 & 91.5000000000001 & - & - & - & - & - & - & - \tabularnewline
197 & 86.4 & - & - & - & - & - & - & - \tabularnewline
198 & 98.9 & - & - & - & - & - & - & - \tabularnewline
199 & 85.2 & - & - & - & - & - & - & - \tabularnewline
200 & 77.3 & - & - & - & - & - & - & - \tabularnewline
201 & 93 & 98.4538 & 88.4219 & 109.883 & 0.1748 & 0.9999 & 0.2659 & 0.9999 \tabularnewline
202 & 86.8 & 93.6145 & 84.0737 & 104.4845 & 0.1096 & 0.5441 & 0.2042 & 0.9984 \tabularnewline
203 & 91.3 & 87.6646 & 78.3781 & 98.3032 & 0.2515 & 0.5633 & 0.4461 & 0.9719 \tabularnewline
204 & 74.9 & 72.9729 & 64.1573 & 83.2828 & 0.3571 & 2e-04 & 0.1794 & 0.2054 \tabularnewline
205 & 93.9 & 89.5958 & 78.1991 & 103.045 & 0.2652 & 0.9839 & 0.4707 & 0.9634 \tabularnewline
206 & 95 & 99.3109 & 85.7106 & 115.5848 & 0.3018 & 0.7427 & 0.4194 & 0.996 \tabularnewline
207 & 103.1 & 95.2354 & 81.4421 & 111.9291 & 0.1779 & 0.511 & 0.3464 & 0.9824 \tabularnewline
208 & 81.4 & 90.1192 & 76.943 & 106.0979 & 0.1424 & 0.0557 & 0.4328 & 0.9421 \tabularnewline
209 & 93.1 & 84.3287 & 71.5938 & 99.8809 & 0.1345 & 0.644 & 0.397 & 0.8121 \tabularnewline
210 & 97.2 & 94.7685 & 79.6179 & 113.5137 & 0.3997 & 0.5692 & 0.3329 & 0.9661 \tabularnewline
211 & 86.4 & 88.161 & 73.9363 & 105.7994 & 0.4224 & 0.1576 & 0.6289 & 0.8863 \tabularnewline
212 & 75.5 & 74.669 & 62.5735 & 89.6815 & 0.4568 & 0.0628 & 0.3656 & 0.3656 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310570&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]81.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]102.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]98.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]88.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]77.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]90.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]101[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]98.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]91.5000000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]86.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]98.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]85.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]77.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]93[/C][C]98.4538[/C][C]88.4219[/C][C]109.883[/C][C]0.1748[/C][C]0.9999[/C][C]0.2659[/C][C]0.9999[/C][/ROW]
[ROW][C]202[/C][C]86.8[/C][C]93.6145[/C][C]84.0737[/C][C]104.4845[/C][C]0.1096[/C][C]0.5441[/C][C]0.2042[/C][C]0.9984[/C][/ROW]
[ROW][C]203[/C][C]91.3[/C][C]87.6646[/C][C]78.3781[/C][C]98.3032[/C][C]0.2515[/C][C]0.5633[/C][C]0.4461[/C][C]0.9719[/C][/ROW]
[ROW][C]204[/C][C]74.9[/C][C]72.9729[/C][C]64.1573[/C][C]83.2828[/C][C]0.3571[/C][C]2e-04[/C][C]0.1794[/C][C]0.2054[/C][/ROW]
[ROW][C]205[/C][C]93.9[/C][C]89.5958[/C][C]78.1991[/C][C]103.045[/C][C]0.2652[/C][C]0.9839[/C][C]0.4707[/C][C]0.9634[/C][/ROW]
[ROW][C]206[/C][C]95[/C][C]99.3109[/C][C]85.7106[/C][C]115.5848[/C][C]0.3018[/C][C]0.7427[/C][C]0.4194[/C][C]0.996[/C][/ROW]
[ROW][C]207[/C][C]103.1[/C][C]95.2354[/C][C]81.4421[/C][C]111.9291[/C][C]0.1779[/C][C]0.511[/C][C]0.3464[/C][C]0.9824[/C][/ROW]
[ROW][C]208[/C][C]81.4[/C][C]90.1192[/C][C]76.943[/C][C]106.0979[/C][C]0.1424[/C][C]0.0557[/C][C]0.4328[/C][C]0.9421[/C][/ROW]
[ROW][C]209[/C][C]93.1[/C][C]84.3287[/C][C]71.5938[/C][C]99.8809[/C][C]0.1345[/C][C]0.644[/C][C]0.397[/C][C]0.8121[/C][/ROW]
[ROW][C]210[/C][C]97.2[/C][C]94.7685[/C][C]79.6179[/C][C]113.5137[/C][C]0.3997[/C][C]0.5692[/C][C]0.3329[/C][C]0.9661[/C][/ROW]
[ROW][C]211[/C][C]86.4[/C][C]88.161[/C][C]73.9363[/C][C]105.7994[/C][C]0.4224[/C][C]0.1576[/C][C]0.6289[/C][C]0.8863[/C][/ROW]
[ROW][C]212[/C][C]75.5[/C][C]74.669[/C][C]62.5735[/C][C]89.6815[/C][C]0.4568[/C][C]0.0628[/C][C]0.3656[/C][C]0.3656[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310570&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310570&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])
18881.5-------
189102.1-------
19098.2-------
19188.4-------
19277.8-------
19390.1-------
194101-------
19598.6-------
19691.5000000000001-------
19786.4-------
19898.9-------
19985.2-------
20077.3-------
2019398.453888.4219109.8830.17480.99990.26590.9999
20286.893.614584.0737104.48450.10960.54410.20420.9984
20391.387.664678.378198.30320.25150.56330.44610.9719
20474.972.972964.157383.28280.35712e-040.17940.2054
20593.989.595878.1991103.0450.26520.98390.47070.9634
2069599.310985.7106115.58480.30180.74270.41940.996
207103.195.235481.4421111.92910.17790.5110.34640.9824
20881.490.119276.943106.09790.14240.05570.43280.9421
20993.184.328771.593899.88090.13450.6440.3970.8121
21097.294.768579.6179113.51370.39970.56920.33290.9661
21186.488.16173.9363105.79940.42240.15760.62890.8863
21275.574.66962.573589.68150.45680.06280.36560.3656







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0592-0.05860.05860.05729.74400-0.52390.5239
2020.0592-0.07850.06860.066346.437538.09086.1718-0.65470.5893
2030.06190.03980.0590.057713.216129.79925.45890.34930.5093
2040.07210.02570.05070.04983.713623.27784.82470.18510.4283
2050.07660.04580.04970.049218.525822.32744.72520.41350.4253
2060.0836-0.04540.0490.048418.583721.70354.6587-0.41410.4234
2070.08940.07630.05290.052861.851827.43895.23820.75560.4709
2080.0905-0.10710.05970.058976.024433.51215.789-0.83770.5167
2090.09410.09420.06350.063476.935938.3376.19170.84270.5529
2100.10090.0250.05970.05965.912235.09455.92410.23360.521
2110.1021-0.02040.05610.0563.101132.1865.6733-0.16920.489
2120.10260.0110.05230.05220.690529.56145.4370.07980.4549

\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.0592 & -0.0586 & 0.0586 & 0.057 & 29.744 & 0 & 0 & -0.5239 & 0.5239 \tabularnewline
202 & 0.0592 & -0.0785 & 0.0686 & 0.0663 & 46.4375 & 38.0908 & 6.1718 & -0.6547 & 0.5893 \tabularnewline
203 & 0.0619 & 0.0398 & 0.059 & 0.0577 & 13.2161 & 29.7992 & 5.4589 & 0.3493 & 0.5093 \tabularnewline
204 & 0.0721 & 0.0257 & 0.0507 & 0.0498 & 3.7136 & 23.2778 & 4.8247 & 0.1851 & 0.4283 \tabularnewline
205 & 0.0766 & 0.0458 & 0.0497 & 0.0492 & 18.5258 & 22.3274 & 4.7252 & 0.4135 & 0.4253 \tabularnewline
206 & 0.0836 & -0.0454 & 0.049 & 0.0484 & 18.5837 & 21.7035 & 4.6587 & -0.4141 & 0.4234 \tabularnewline
207 & 0.0894 & 0.0763 & 0.0529 & 0.0528 & 61.8518 & 27.4389 & 5.2382 & 0.7556 & 0.4709 \tabularnewline
208 & 0.0905 & -0.1071 & 0.0597 & 0.0589 & 76.0244 & 33.5121 & 5.789 & -0.8377 & 0.5167 \tabularnewline
209 & 0.0941 & 0.0942 & 0.0635 & 0.0634 & 76.9359 & 38.337 & 6.1917 & 0.8427 & 0.5529 \tabularnewline
210 & 0.1009 & 0.025 & 0.0597 & 0.0596 & 5.9122 & 35.0945 & 5.9241 & 0.2336 & 0.521 \tabularnewline
211 & 0.1021 & -0.0204 & 0.0561 & 0.056 & 3.1011 & 32.186 & 5.6733 & -0.1692 & 0.489 \tabularnewline
212 & 0.1026 & 0.011 & 0.0523 & 0.0522 & 0.6905 & 29.5614 & 5.437 & 0.0798 & 0.4549 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310570&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.0592[/C][C]-0.0586[/C][C]0.0586[/C][C]0.057[/C][C]29.744[/C][C]0[/C][C]0[/C][C]-0.5239[/C][C]0.5239[/C][/ROW]
[ROW][C]202[/C][C]0.0592[/C][C]-0.0785[/C][C]0.0686[/C][C]0.0663[/C][C]46.4375[/C][C]38.0908[/C][C]6.1718[/C][C]-0.6547[/C][C]0.5893[/C][/ROW]
[ROW][C]203[/C][C]0.0619[/C][C]0.0398[/C][C]0.059[/C][C]0.0577[/C][C]13.2161[/C][C]29.7992[/C][C]5.4589[/C][C]0.3493[/C][C]0.5093[/C][/ROW]
[ROW][C]204[/C][C]0.0721[/C][C]0.0257[/C][C]0.0507[/C][C]0.0498[/C][C]3.7136[/C][C]23.2778[/C][C]4.8247[/C][C]0.1851[/C][C]0.4283[/C][/ROW]
[ROW][C]205[/C][C]0.0766[/C][C]0.0458[/C][C]0.0497[/C][C]0.0492[/C][C]18.5258[/C][C]22.3274[/C][C]4.7252[/C][C]0.4135[/C][C]0.4253[/C][/ROW]
[ROW][C]206[/C][C]0.0836[/C][C]-0.0454[/C][C]0.049[/C][C]0.0484[/C][C]18.5837[/C][C]21.7035[/C][C]4.6587[/C][C]-0.4141[/C][C]0.4234[/C][/ROW]
[ROW][C]207[/C][C]0.0894[/C][C]0.0763[/C][C]0.0529[/C][C]0.0528[/C][C]61.8518[/C][C]27.4389[/C][C]5.2382[/C][C]0.7556[/C][C]0.4709[/C][/ROW]
[ROW][C]208[/C][C]0.0905[/C][C]-0.1071[/C][C]0.0597[/C][C]0.0589[/C][C]76.0244[/C][C]33.5121[/C][C]5.789[/C][C]-0.8377[/C][C]0.5167[/C][/ROW]
[ROW][C]209[/C][C]0.0941[/C][C]0.0942[/C][C]0.0635[/C][C]0.0634[/C][C]76.9359[/C][C]38.337[/C][C]6.1917[/C][C]0.8427[/C][C]0.5529[/C][/ROW]
[ROW][C]210[/C][C]0.1009[/C][C]0.025[/C][C]0.0597[/C][C]0.0596[/C][C]5.9122[/C][C]35.0945[/C][C]5.9241[/C][C]0.2336[/C][C]0.521[/C][/ROW]
[ROW][C]211[/C][C]0.1021[/C][C]-0.0204[/C][C]0.0561[/C][C]0.056[/C][C]3.1011[/C][C]32.186[/C][C]5.6733[/C][C]-0.1692[/C][C]0.489[/C][/ROW]
[ROW][C]212[/C][C]0.1026[/C][C]0.011[/C][C]0.0523[/C][C]0.0522[/C][C]0.6905[/C][C]29.5614[/C][C]5.437[/C][C]0.0798[/C][C]0.4549[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310570&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310570&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.0592-0.05860.05860.05729.74400-0.52390.5239
2020.0592-0.07850.06860.066346.437538.09086.1718-0.65470.5893
2030.06190.03980.0590.057713.216129.79925.45890.34930.5093
2040.07210.02570.05070.04983.713623.27784.82470.18510.4283
2050.07660.04580.04970.049218.525822.32744.72520.41350.4253
2060.0836-0.04540.0490.048418.583721.70354.6587-0.41410.4234
2070.08940.07630.05290.052861.851827.43895.23820.75560.4709
2080.0905-0.10710.05970.058976.024433.51215.789-0.83770.5167
2090.09410.09420.06350.063476.935938.3376.19170.84270.5529
2100.10090.0250.05970.05965.912235.09455.92410.23360.521
2110.1021-0.02040.05610.0563.101132.1865.6733-0.16920.489
2120.10260.0110.05230.05220.690529.56145.4370.07980.4549



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