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, 21 Dec 2017 11:33:03 +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/21/t1513852598ct0vi92p73lm7aw.htm/, Retrieved Tue, 14 May 2024 23:57:45 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310608, Retrieved Tue, 14 May 2024 23:57:45 +0000
QR Codes:

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

Post a new message
Dataseries X:
58.5
59.8
64.6
62.2
68
64.3
58.9
64.8
67.5
76.2
73.7
70.4
67.7
63.7
72.4
66
70.1
70.4
66.6
72.6
74
79
76.1
72.3
71.6
67.2
73.8
70.8
71.4
70.4
70.7
70.6
75.5
82.1
74.3
76.3
74.5
71.1
73.3
73.8
69
71.1
71.9
69
77.3
82.8
74
77.6
72.3
70.7
81
76.4
72.3
79.5
73.3
74.5
82.7
83.8
81.6
85.5
76.7
71.8
80.2
76.8
76.1
80.7
71.3
80.9
85
84.5
87.7
87.7
80.2
74.4
85.8
77
84.5
83.6
77.7
85.7
87.9
93.7
92.3
87
89.1
81.3
92.7
83.9
87.3
89.1
86.9
91.7
93
105.3
101.6
94.2
100.5
95.8
95.8
102.1
96
96.8
98.9
93.4
105.5
110.9
98.6
102.6
93.5
90.8
99.7
97.8
91.1
98.1
96
93.5
101.2
105.2
98.9
101.3
92.1
90.6
105.4
98.4
92.7
101.2
93.4
98.3
104.3
107
107.7
108.9
99.6
96.1
109
99.5
104.6
99.9
94.1
105.3
110.4
110.5
110
108.5
104.3
101.2
109.2
99.6
105.6
106.2
102.2
107.5
105.8
120.5
113.2
104.3
107.7
99.2
105.1
104.3
106.1
100.8
106.7
101.6
104.4
114.8
105.4
104
102
96.5
102.3
105.3
101.9
102.2
102.8
100.4
110.7
116.4
106
109.2
103
99.8
109.8
107.3
101.2
111.8
106.9
103.5
113.1
119.4
113.3
115
104.7
107.2
116.6
111.3
111.4
115
102.4
111.4
113.2
112.9
114.2
115.6
107.1
102.3
117.9
105.8
114.3
113.1
102.9
112.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=310608&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=310608&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310608&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])
188103.5-------
189113.1-------
190119.4-------
191113.3-------
192115-------
193104.7-------
194107.2-------
195116.6-------
196111.3-------
197111.4-------
198115-------
199102.4-------
200111.4-------
201113.2115.0473107.6425122.45220.31240.83280.69690.8328
202112.9122.877115.4557130.29830.00420.99470.82080.9988
203114.2116.2097108.4259123.99350.30640.79770.76810.8871
204115.6117.9362109.9598125.91250.2830.82070.76470.9459
205107.1107.500499.3167115.6840.46180.02620.74880.1752
206102.3109.9145101.5509118.27820.03720.74520.73770.3639
207117.9119.2189110.6884127.74940.38090.99990.72630.9638
208105.8113.8302105.1476122.51270.03490.17910.71610.7084
209114.3113.8434105.0212122.66570.45960.9630.70640.7064
210113.1117.3599108.4094126.31040.17550.74860.69730.9041
211102.9104.679295.6107113.74770.35030.03440.68890.0732
212112.2113.6013104.424122.77850.38240.98890.68090.6809

\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 & 103.5 & - & - & - & - & - & - & - \tabularnewline
189 & 113.1 & - & - & - & - & - & - & - \tabularnewline
190 & 119.4 & - & - & - & - & - & - & - \tabularnewline
191 & 113.3 & - & - & - & - & - & - & - \tabularnewline
192 & 115 & - & - & - & - & - & - & - \tabularnewline
193 & 104.7 & - & - & - & - & - & - & - \tabularnewline
194 & 107.2 & - & - & - & - & - & - & - \tabularnewline
195 & 116.6 & - & - & - & - & - & - & - \tabularnewline
196 & 111.3 & - & - & - & - & - & - & - \tabularnewline
197 & 111.4 & - & - & - & - & - & - & - \tabularnewline
198 & 115 & - & - & - & - & - & - & - \tabularnewline
199 & 102.4 & - & - & - & - & - & - & - \tabularnewline
200 & 111.4 & - & - & - & - & - & - & - \tabularnewline
201 & 113.2 & 115.0473 & 107.6425 & 122.4522 & 0.3124 & 0.8328 & 0.6969 & 0.8328 \tabularnewline
202 & 112.9 & 122.877 & 115.4557 & 130.2983 & 0.0042 & 0.9947 & 0.8208 & 0.9988 \tabularnewline
203 & 114.2 & 116.2097 & 108.4259 & 123.9935 & 0.3064 & 0.7977 & 0.7681 & 0.8871 \tabularnewline
204 & 115.6 & 117.9362 & 109.9598 & 125.9125 & 0.283 & 0.8207 & 0.7647 & 0.9459 \tabularnewline
205 & 107.1 & 107.5004 & 99.3167 & 115.684 & 0.4618 & 0.0262 & 0.7488 & 0.1752 \tabularnewline
206 & 102.3 & 109.9145 & 101.5509 & 118.2782 & 0.0372 & 0.7452 & 0.7377 & 0.3639 \tabularnewline
207 & 117.9 & 119.2189 & 110.6884 & 127.7494 & 0.3809 & 0.9999 & 0.7263 & 0.9638 \tabularnewline
208 & 105.8 & 113.8302 & 105.1476 & 122.5127 & 0.0349 & 0.1791 & 0.7161 & 0.7084 \tabularnewline
209 & 114.3 & 113.8434 & 105.0212 & 122.6657 & 0.4596 & 0.963 & 0.7064 & 0.7064 \tabularnewline
210 & 113.1 & 117.3599 & 108.4094 & 126.3104 & 0.1755 & 0.7486 & 0.6973 & 0.9041 \tabularnewline
211 & 102.9 & 104.6792 & 95.6107 & 113.7477 & 0.3503 & 0.0344 & 0.6889 & 0.0732 \tabularnewline
212 & 112.2 & 113.6013 & 104.424 & 122.7785 & 0.3824 & 0.9889 & 0.6809 & 0.6809 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310608&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]103.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]113.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]119.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]113.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]104.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]107.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]116.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]111.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]111.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]102.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]111.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]113.2[/C][C]115.0473[/C][C]107.6425[/C][C]122.4522[/C][C]0.3124[/C][C]0.8328[/C][C]0.6969[/C][C]0.8328[/C][/ROW]
[ROW][C]202[/C][C]112.9[/C][C]122.877[/C][C]115.4557[/C][C]130.2983[/C][C]0.0042[/C][C]0.9947[/C][C]0.8208[/C][C]0.9988[/C][/ROW]
[ROW][C]203[/C][C]114.2[/C][C]116.2097[/C][C]108.4259[/C][C]123.9935[/C][C]0.3064[/C][C]0.7977[/C][C]0.7681[/C][C]0.8871[/C][/ROW]
[ROW][C]204[/C][C]115.6[/C][C]117.9362[/C][C]109.9598[/C][C]125.9125[/C][C]0.283[/C][C]0.8207[/C][C]0.7647[/C][C]0.9459[/C][/ROW]
[ROW][C]205[/C][C]107.1[/C][C]107.5004[/C][C]99.3167[/C][C]115.684[/C][C]0.4618[/C][C]0.0262[/C][C]0.7488[/C][C]0.1752[/C][/ROW]
[ROW][C]206[/C][C]102.3[/C][C]109.9145[/C][C]101.5509[/C][C]118.2782[/C][C]0.0372[/C][C]0.7452[/C][C]0.7377[/C][C]0.3639[/C][/ROW]
[ROW][C]207[/C][C]117.9[/C][C]119.2189[/C][C]110.6884[/C][C]127.7494[/C][C]0.3809[/C][C]0.9999[/C][C]0.7263[/C][C]0.9638[/C][/ROW]
[ROW][C]208[/C][C]105.8[/C][C]113.8302[/C][C]105.1476[/C][C]122.5127[/C][C]0.0349[/C][C]0.1791[/C][C]0.7161[/C][C]0.7084[/C][/ROW]
[ROW][C]209[/C][C]114.3[/C][C]113.8434[/C][C]105.0212[/C][C]122.6657[/C][C]0.4596[/C][C]0.963[/C][C]0.7064[/C][C]0.7064[/C][/ROW]
[ROW][C]210[/C][C]113.1[/C][C]117.3599[/C][C]108.4094[/C][C]126.3104[/C][C]0.1755[/C][C]0.7486[/C][C]0.6973[/C][C]0.9041[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]104.6792[/C][C]95.6107[/C][C]113.7477[/C][C]0.3503[/C][C]0.0344[/C][C]0.6889[/C][C]0.0732[/C][/ROW]
[ROW][C]212[/C][C]112.2[/C][C]113.6013[/C][C]104.424[/C][C]122.7785[/C][C]0.3824[/C][C]0.9889[/C][C]0.6809[/C][C]0.6809[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310608&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310608&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])
188103.5-------
189113.1-------
190119.4-------
191113.3-------
192115-------
193104.7-------
194107.2-------
195116.6-------
196111.3-------
197111.4-------
198115-------
199102.4-------
200111.4-------
201113.2115.0473107.6425122.45220.31240.83280.69690.8328
202112.9122.877115.4557130.29830.00420.99470.82080.9988
203114.2116.2097108.4259123.99350.30640.79770.76810.8871
204115.6117.9362109.9598125.91250.2830.82070.76470.9459
205107.1107.500499.3167115.6840.46180.02620.74880.1752
206102.3109.9145101.5509118.27820.03720.74520.73770.3639
207117.9119.2189110.6884127.74940.38090.99990.72630.9638
208105.8113.8302105.1476122.51270.03490.17910.71610.7084
209114.3113.8434105.0212122.66570.45960.9630.70640.7064
210113.1117.3599108.4094126.31040.17550.74860.69730.9041
211102.9104.679295.6107113.74770.35030.03440.68890.0732
212112.2113.6013104.424122.77850.38240.98890.68090.6809







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0328-0.01630.01630.01623.412700-0.27760.2776
2020.0308-0.08840.05230.050499.540251.47657.1747-1.49930.8884
2030.0342-0.01760.04080.03944.038935.66395.9719-0.3020.693
2040.0345-0.02020.03560.03465.457628.11245.3021-0.35110.6075
2050.0388-0.00370.02920.02840.160322.52194.7457-0.06020.498
2060.0388-0.07440.03680.035657.981328.43185.3322-1.14430.6057
2070.0365-0.01120.03310.03211.739624.61874.9617-0.19820.5475
2080.0389-0.07590.03850.037364.483429.60175.4407-1.20670.6299
2090.03950.0040.03460.03360.208526.33585.13180.06860.5675
2100.0389-0.03770.03490.033918.146925.51695.0514-0.64020.5748
2110.0442-0.01730.03330.03243.165623.4854.8461-0.26740.5469
2120.0412-0.01250.03160.03071.963621.69154.6574-0.21060.5188

\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.0328 & -0.0163 & 0.0163 & 0.0162 & 3.4127 & 0 & 0 & -0.2776 & 0.2776 \tabularnewline
202 & 0.0308 & -0.0884 & 0.0523 & 0.0504 & 99.5402 & 51.4765 & 7.1747 & -1.4993 & 0.8884 \tabularnewline
203 & 0.0342 & -0.0176 & 0.0408 & 0.0394 & 4.0389 & 35.6639 & 5.9719 & -0.302 & 0.693 \tabularnewline
204 & 0.0345 & -0.0202 & 0.0356 & 0.0346 & 5.4576 & 28.1124 & 5.3021 & -0.3511 & 0.6075 \tabularnewline
205 & 0.0388 & -0.0037 & 0.0292 & 0.0284 & 0.1603 & 22.5219 & 4.7457 & -0.0602 & 0.498 \tabularnewline
206 & 0.0388 & -0.0744 & 0.0368 & 0.0356 & 57.9813 & 28.4318 & 5.3322 & -1.1443 & 0.6057 \tabularnewline
207 & 0.0365 & -0.0112 & 0.0331 & 0.0321 & 1.7396 & 24.6187 & 4.9617 & -0.1982 & 0.5475 \tabularnewline
208 & 0.0389 & -0.0759 & 0.0385 & 0.0373 & 64.4834 & 29.6017 & 5.4407 & -1.2067 & 0.6299 \tabularnewline
209 & 0.0395 & 0.004 & 0.0346 & 0.0336 & 0.2085 & 26.3358 & 5.1318 & 0.0686 & 0.5675 \tabularnewline
210 & 0.0389 & -0.0377 & 0.0349 & 0.0339 & 18.1469 & 25.5169 & 5.0514 & -0.6402 & 0.5748 \tabularnewline
211 & 0.0442 & -0.0173 & 0.0333 & 0.0324 & 3.1656 & 23.485 & 4.8461 & -0.2674 & 0.5469 \tabularnewline
212 & 0.0412 & -0.0125 & 0.0316 & 0.0307 & 1.9636 & 21.6915 & 4.6574 & -0.2106 & 0.5188 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310608&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.0328[/C][C]-0.0163[/C][C]0.0163[/C][C]0.0162[/C][C]3.4127[/C][C]0[/C][C]0[/C][C]-0.2776[/C][C]0.2776[/C][/ROW]
[ROW][C]202[/C][C]0.0308[/C][C]-0.0884[/C][C]0.0523[/C][C]0.0504[/C][C]99.5402[/C][C]51.4765[/C][C]7.1747[/C][C]-1.4993[/C][C]0.8884[/C][/ROW]
[ROW][C]203[/C][C]0.0342[/C][C]-0.0176[/C][C]0.0408[/C][C]0.0394[/C][C]4.0389[/C][C]35.6639[/C][C]5.9719[/C][C]-0.302[/C][C]0.693[/C][/ROW]
[ROW][C]204[/C][C]0.0345[/C][C]-0.0202[/C][C]0.0356[/C][C]0.0346[/C][C]5.4576[/C][C]28.1124[/C][C]5.3021[/C][C]-0.3511[/C][C]0.6075[/C][/ROW]
[ROW][C]205[/C][C]0.0388[/C][C]-0.0037[/C][C]0.0292[/C][C]0.0284[/C][C]0.1603[/C][C]22.5219[/C][C]4.7457[/C][C]-0.0602[/C][C]0.498[/C][/ROW]
[ROW][C]206[/C][C]0.0388[/C][C]-0.0744[/C][C]0.0368[/C][C]0.0356[/C][C]57.9813[/C][C]28.4318[/C][C]5.3322[/C][C]-1.1443[/C][C]0.6057[/C][/ROW]
[ROW][C]207[/C][C]0.0365[/C][C]-0.0112[/C][C]0.0331[/C][C]0.0321[/C][C]1.7396[/C][C]24.6187[/C][C]4.9617[/C][C]-0.1982[/C][C]0.5475[/C][/ROW]
[ROW][C]208[/C][C]0.0389[/C][C]-0.0759[/C][C]0.0385[/C][C]0.0373[/C][C]64.4834[/C][C]29.6017[/C][C]5.4407[/C][C]-1.2067[/C][C]0.6299[/C][/ROW]
[ROW][C]209[/C][C]0.0395[/C][C]0.004[/C][C]0.0346[/C][C]0.0336[/C][C]0.2085[/C][C]26.3358[/C][C]5.1318[/C][C]0.0686[/C][C]0.5675[/C][/ROW]
[ROW][C]210[/C][C]0.0389[/C][C]-0.0377[/C][C]0.0349[/C][C]0.0339[/C][C]18.1469[/C][C]25.5169[/C][C]5.0514[/C][C]-0.6402[/C][C]0.5748[/C][/ROW]
[ROW][C]211[/C][C]0.0442[/C][C]-0.0173[/C][C]0.0333[/C][C]0.0324[/C][C]3.1656[/C][C]23.485[/C][C]4.8461[/C][C]-0.2674[/C][C]0.5469[/C][/ROW]
[ROW][C]212[/C][C]0.0412[/C][C]-0.0125[/C][C]0.0316[/C][C]0.0307[/C][C]1.9636[/C][C]21.6915[/C][C]4.6574[/C][C]-0.2106[/C][C]0.5188[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310608&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310608&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.0328-0.01630.01630.01623.412700-0.27760.2776
2020.0308-0.08840.05230.050499.540251.47657.1747-1.49930.8884
2030.0342-0.01760.04080.03944.038935.66395.9719-0.3020.693
2040.0345-0.02020.03560.03465.457628.11245.3021-0.35110.6075
2050.0388-0.00370.02920.02840.160322.52194.7457-0.06020.498
2060.0388-0.07440.03680.035657.981328.43185.3322-1.14430.6057
2070.0365-0.01120.03310.03211.739624.61874.9617-0.19820.5475
2080.0389-0.07590.03850.037364.483429.60175.4407-1.20670.6299
2090.03950.0040.03460.03360.208526.33585.13180.06860.5675
2100.0389-0.03770.03490.033918.146925.51695.0514-0.64020.5748
2110.0442-0.01730.03330.03243.165623.4854.8461-0.26740.5469
2120.0412-0.01250.03160.03071.963621.69154.6574-0.21060.5188



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