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, 01 Feb 2018 11:40:48 +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/2018/Feb/01/t15174816608aeuams8hiooacl.htm/, Retrieved Sun, 28 Apr 2024 20:20:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=314841, Retrieved Sun, 28 Apr 2024 20:20:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact47
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-02-01 10:40:48] [f30504383acfe1cf2db4c3a49aec2d50] [Current]
Feedback Forum

Post a new message
Dataseries X:
97.7
88.9
96.5
89.5
85.4
84.3
83.7
86.2
90.7
95.7
95.6
97
97.2
86.6
88.4
81.4
86.9
84.9
83.7
86.8
88.3
92.5
94.7
94.5
98.7
88.6
95.2
91.3
91.7
89.3
88.7
91.2
88.6
94.6
96
94.3
102
93.4
96.7
93.7
91.6
89.6
92.9
94.1
92
97.5
92.7
100.7
105.9
95.3
99.8
91.3
90.8
87.1
91.4
86.1
87.1
92.6
96.6
105.3
102.4
98.2
98.6
92.6
87.9
84.1
86.7
84.4
86
90.4
92.9
105.8
106
99.1
99.9
88.1
87.8
87.1
85.9
86.5
84.1
92.1
93.3
98.9
103
98.4
100.7
92.3
89
88.9
85.5
90.1
87
97.1
101.5
103
106.1
96.1
94.2
89.1
85.2
86.5
88
88.4
87.9
95.7
94.8
105.2
108.7
96.1
98.3
88.6
90.8
88.1
91.9
98.5
98.6
100.3
98.7
110.7
115.4
105.4
108
94.5
96.5
91
94.1
96.4
93.1
97.5
102.5
105.7
109.1
97.2
100.3
91.3
94.3
89.5
89.3
93.4
91.9
92.9
93.7
100.1
105.5
110.5
89.5
90.4
89.9
84.6
86.2
83.4
82.9
81.8
87.6
94.6
99.6
96.7
99.8
83.8
82.4
86.8
91
85.3
83.6
94
100.3
107.1
100.7
95.5
92.9
79.2
82
79.3
81.5
76
73.1
80.4
82.1
90.5
98.1
89.5
86.5
77
74.7
73.4
72.5
69.3
75.2
83.5
90.5
92.2
110.5
101.8
107.4
95.5
84.5
81.1
86.2
91.5
84.7
92.2
99.2
104.5
113
100.4
101
84.8
86.5
91.7
94.8
95




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314841&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])
18869.3-------
18975.2-------
19083.5-------
19190.5-------
19292.2-------
193110.5-------
194101.8-------
195107.4-------
19695.5-------
19784.5-------
19881.1-------
19986.2-------
20091.5-------
20184.788.850481.123396.57750.14620.25080.99970.2508
20292.293.756184.6359102.87620.3690.97420.98620.6861
20399.296.92887.0732106.78280.32570.82650.89950.8598
204104.5102.704492.3099113.09880.36750.74560.97620.9827
205113108.553597.695119.41190.21110.76780.36270.999
206100.4101.677890.3917112.96380.41220.02460.49150.9614
207101101.337989.6464113.02940.47740.56250.15480.9505
20884.891.320579.2394103.40150.14510.05820.24890.4884
20986.589.091576.634101.5490.34170.75020.7650.3524
21091.786.960874.138299.78340.23440.52810.81480.2439
21194.889.01875.8406102.19540.19490.3450.66240.356
2129588.875775.3528102.39860.18740.19530.35180.3518

\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 & 69.3 & - & - & - & - & - & - & - \tabularnewline
189 & 75.2 & - & - & - & - & - & - & - \tabularnewline
190 & 83.5 & - & - & - & - & - & - & - \tabularnewline
191 & 90.5 & - & - & - & - & - & - & - \tabularnewline
192 & 92.2 & - & - & - & - & - & - & - \tabularnewline
193 & 110.5 & - & - & - & - & - & - & - \tabularnewline
194 & 101.8 & - & - & - & - & - & - & - \tabularnewline
195 & 107.4 & - & - & - & - & - & - & - \tabularnewline
196 & 95.5 & - & - & - & - & - & - & - \tabularnewline
197 & 84.5 & - & - & - & - & - & - & - \tabularnewline
198 & 81.1 & - & - & - & - & - & - & - \tabularnewline
199 & 86.2 & - & - & - & - & - & - & - \tabularnewline
200 & 91.5 & - & - & - & - & - & - & - \tabularnewline
201 & 84.7 & 88.8504 & 81.1233 & 96.5775 & 0.1462 & 0.2508 & 0.9997 & 0.2508 \tabularnewline
202 & 92.2 & 93.7561 & 84.6359 & 102.8762 & 0.369 & 0.9742 & 0.9862 & 0.6861 \tabularnewline
203 & 99.2 & 96.928 & 87.0732 & 106.7828 & 0.3257 & 0.8265 & 0.8995 & 0.8598 \tabularnewline
204 & 104.5 & 102.7044 & 92.3099 & 113.0988 & 0.3675 & 0.7456 & 0.9762 & 0.9827 \tabularnewline
205 & 113 & 108.5535 & 97.695 & 119.4119 & 0.2111 & 0.7678 & 0.3627 & 0.999 \tabularnewline
206 & 100.4 & 101.6778 & 90.3917 & 112.9638 & 0.4122 & 0.0246 & 0.4915 & 0.9614 \tabularnewline
207 & 101 & 101.3379 & 89.6464 & 113.0294 & 0.4774 & 0.5625 & 0.1548 & 0.9505 \tabularnewline
208 & 84.8 & 91.3205 & 79.2394 & 103.4015 & 0.1451 & 0.0582 & 0.2489 & 0.4884 \tabularnewline
209 & 86.5 & 89.0915 & 76.634 & 101.549 & 0.3417 & 0.7502 & 0.765 & 0.3524 \tabularnewline
210 & 91.7 & 86.9608 & 74.1382 & 99.7834 & 0.2344 & 0.5281 & 0.8148 & 0.2439 \tabularnewline
211 & 94.8 & 89.018 & 75.8406 & 102.1954 & 0.1949 & 0.345 & 0.6624 & 0.356 \tabularnewline
212 & 95 & 88.8757 & 75.3528 & 102.3986 & 0.1874 & 0.1953 & 0.3518 & 0.3518 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=314841&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]69.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]75.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]83.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]90.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]92.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]110.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]101.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]107.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]95.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]84.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]81.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]86.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]91.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]84.7[/C][C]88.8504[/C][C]81.1233[/C][C]96.5775[/C][C]0.1462[/C][C]0.2508[/C][C]0.9997[/C][C]0.2508[/C][/ROW]
[ROW][C]202[/C][C]92.2[/C][C]93.7561[/C][C]84.6359[/C][C]102.8762[/C][C]0.369[/C][C]0.9742[/C][C]0.9862[/C][C]0.6861[/C][/ROW]
[ROW][C]203[/C][C]99.2[/C][C]96.928[/C][C]87.0732[/C][C]106.7828[/C][C]0.3257[/C][C]0.8265[/C][C]0.8995[/C][C]0.8598[/C][/ROW]
[ROW][C]204[/C][C]104.5[/C][C]102.7044[/C][C]92.3099[/C][C]113.0988[/C][C]0.3675[/C][C]0.7456[/C][C]0.9762[/C][C]0.9827[/C][/ROW]
[ROW][C]205[/C][C]113[/C][C]108.5535[/C][C]97.695[/C][C]119.4119[/C][C]0.2111[/C][C]0.7678[/C][C]0.3627[/C][C]0.999[/C][/ROW]
[ROW][C]206[/C][C]100.4[/C][C]101.6778[/C][C]90.3917[/C][C]112.9638[/C][C]0.4122[/C][C]0.0246[/C][C]0.4915[/C][C]0.9614[/C][/ROW]
[ROW][C]207[/C][C]101[/C][C]101.3379[/C][C]89.6464[/C][C]113.0294[/C][C]0.4774[/C][C]0.5625[/C][C]0.1548[/C][C]0.9505[/C][/ROW]
[ROW][C]208[/C][C]84.8[/C][C]91.3205[/C][C]79.2394[/C][C]103.4015[/C][C]0.1451[/C][C]0.0582[/C][C]0.2489[/C][C]0.4884[/C][/ROW]
[ROW][C]209[/C][C]86.5[/C][C]89.0915[/C][C]76.634[/C][C]101.549[/C][C]0.3417[/C][C]0.7502[/C][C]0.765[/C][C]0.3524[/C][/ROW]
[ROW][C]210[/C][C]91.7[/C][C]86.9608[/C][C]74.1382[/C][C]99.7834[/C][C]0.2344[/C][C]0.5281[/C][C]0.8148[/C][C]0.2439[/C][/ROW]
[ROW][C]211[/C][C]94.8[/C][C]89.018[/C][C]75.8406[/C][C]102.1954[/C][C]0.1949[/C][C]0.345[/C][C]0.6624[/C][C]0.356[/C][/ROW]
[ROW][C]212[/C][C]95[/C][C]88.8757[/C][C]75.3528[/C][C]102.3986[/C][C]0.1874[/C][C]0.1953[/C][C]0.3518[/C][C]0.3518[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=314841&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314841&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])
18869.3-------
18975.2-------
19083.5-------
19190.5-------
19292.2-------
193110.5-------
194101.8-------
195107.4-------
19695.5-------
19784.5-------
19881.1-------
19986.2-------
20091.5-------
20184.788.850481.123396.57750.14620.25080.99970.2508
20292.293.756184.6359102.87620.3690.97420.98620.6861
20399.296.92887.0732106.78280.32570.82650.89950.8598
204104.5102.704492.3099113.09880.36750.74560.97620.9827
205113108.553597.695119.41190.21110.76780.36270.999
206100.4101.677890.3917112.96380.41220.02460.49150.9614
207101101.337989.6464113.02940.47740.56250.15480.9505
20884.891.320579.2394103.40150.14510.05820.24890.4884
20986.589.091576.634101.5490.34170.75020.7650.3524
21091.786.960874.138299.78340.23440.52810.81480.2439
21194.889.01875.8406102.19540.19490.3450.66240.356
2129588.875775.3528102.39860.18740.19530.35180.3518







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0444-0.0490.0490.047817.225700-0.67240.6724
2020.0496-0.01690.03290.03232.42149.82363.1343-0.25210.4622
2030.05190.02290.02960.02925.1628.26972.87570.36810.4308
2040.05160.01720.02650.02633.22447.00842.64730.29090.3959
2050.0510.03930.02910.02919.77189.5613.09210.72040.4608
2060.0566-0.01270.02630.02631.63278.23972.8705-0.2070.4185
2070.0589-0.00330.02310.0230.11427.07892.6606-0.05470.3665
2080.0675-0.07690.02980.029442.516711.50863.3924-1.05630.4527
2090.0713-0.030.02980.02946.71610.97613.313-0.41980.4491
2100.07520.05170.0320.031822.459712.12453.4820.76780.4809
2110.07550.0610.03460.034633.431314.06143.74990.93670.5224
2120.07760.06450.03710.037337.50716.01524.00190.99220.5615

\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.0444 & -0.049 & 0.049 & 0.0478 & 17.2257 & 0 & 0 & -0.6724 & 0.6724 \tabularnewline
202 & 0.0496 & -0.0169 & 0.0329 & 0.0323 & 2.4214 & 9.8236 & 3.1343 & -0.2521 & 0.4622 \tabularnewline
203 & 0.0519 & 0.0229 & 0.0296 & 0.0292 & 5.162 & 8.2697 & 2.8757 & 0.3681 & 0.4308 \tabularnewline
204 & 0.0516 & 0.0172 & 0.0265 & 0.0263 & 3.2244 & 7.0084 & 2.6473 & 0.2909 & 0.3959 \tabularnewline
205 & 0.051 & 0.0393 & 0.0291 & 0.029 & 19.7718 & 9.561 & 3.0921 & 0.7204 & 0.4608 \tabularnewline
206 & 0.0566 & -0.0127 & 0.0263 & 0.0263 & 1.6327 & 8.2397 & 2.8705 & -0.207 & 0.4185 \tabularnewline
207 & 0.0589 & -0.0033 & 0.0231 & 0.023 & 0.1142 & 7.0789 & 2.6606 & -0.0547 & 0.3665 \tabularnewline
208 & 0.0675 & -0.0769 & 0.0298 & 0.0294 & 42.5167 & 11.5086 & 3.3924 & -1.0563 & 0.4527 \tabularnewline
209 & 0.0713 & -0.03 & 0.0298 & 0.0294 & 6.716 & 10.9761 & 3.313 & -0.4198 & 0.4491 \tabularnewline
210 & 0.0752 & 0.0517 & 0.032 & 0.0318 & 22.4597 & 12.1245 & 3.482 & 0.7678 & 0.4809 \tabularnewline
211 & 0.0755 & 0.061 & 0.0346 & 0.0346 & 33.4313 & 14.0614 & 3.7499 & 0.9367 & 0.5224 \tabularnewline
212 & 0.0776 & 0.0645 & 0.0371 & 0.0373 & 37.507 & 16.0152 & 4.0019 & 0.9922 & 0.5615 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=314841&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.0444[/C][C]-0.049[/C][C]0.049[/C][C]0.0478[/C][C]17.2257[/C][C]0[/C][C]0[/C][C]-0.6724[/C][C]0.6724[/C][/ROW]
[ROW][C]202[/C][C]0.0496[/C][C]-0.0169[/C][C]0.0329[/C][C]0.0323[/C][C]2.4214[/C][C]9.8236[/C][C]3.1343[/C][C]-0.2521[/C][C]0.4622[/C][/ROW]
[ROW][C]203[/C][C]0.0519[/C][C]0.0229[/C][C]0.0296[/C][C]0.0292[/C][C]5.162[/C][C]8.2697[/C][C]2.8757[/C][C]0.3681[/C][C]0.4308[/C][/ROW]
[ROW][C]204[/C][C]0.0516[/C][C]0.0172[/C][C]0.0265[/C][C]0.0263[/C][C]3.2244[/C][C]7.0084[/C][C]2.6473[/C][C]0.2909[/C][C]0.3959[/C][/ROW]
[ROW][C]205[/C][C]0.051[/C][C]0.0393[/C][C]0.0291[/C][C]0.029[/C][C]19.7718[/C][C]9.561[/C][C]3.0921[/C][C]0.7204[/C][C]0.4608[/C][/ROW]
[ROW][C]206[/C][C]0.0566[/C][C]-0.0127[/C][C]0.0263[/C][C]0.0263[/C][C]1.6327[/C][C]8.2397[/C][C]2.8705[/C][C]-0.207[/C][C]0.4185[/C][/ROW]
[ROW][C]207[/C][C]0.0589[/C][C]-0.0033[/C][C]0.0231[/C][C]0.023[/C][C]0.1142[/C][C]7.0789[/C][C]2.6606[/C][C]-0.0547[/C][C]0.3665[/C][/ROW]
[ROW][C]208[/C][C]0.0675[/C][C]-0.0769[/C][C]0.0298[/C][C]0.0294[/C][C]42.5167[/C][C]11.5086[/C][C]3.3924[/C][C]-1.0563[/C][C]0.4527[/C][/ROW]
[ROW][C]209[/C][C]0.0713[/C][C]-0.03[/C][C]0.0298[/C][C]0.0294[/C][C]6.716[/C][C]10.9761[/C][C]3.313[/C][C]-0.4198[/C][C]0.4491[/C][/ROW]
[ROW][C]210[/C][C]0.0752[/C][C]0.0517[/C][C]0.032[/C][C]0.0318[/C][C]22.4597[/C][C]12.1245[/C][C]3.482[/C][C]0.7678[/C][C]0.4809[/C][/ROW]
[ROW][C]211[/C][C]0.0755[/C][C]0.061[/C][C]0.0346[/C][C]0.0346[/C][C]33.4313[/C][C]14.0614[/C][C]3.7499[/C][C]0.9367[/C][C]0.5224[/C][/ROW]
[ROW][C]212[/C][C]0.0776[/C][C]0.0645[/C][C]0.0371[/C][C]0.0373[/C][C]37.507[/C][C]16.0152[/C][C]4.0019[/C][C]0.9922[/C][C]0.5615[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=314841&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314841&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.0444-0.0490.0490.047817.225700-0.67240.6724
2020.0496-0.01690.03290.03232.42149.82363.1343-0.25210.4622
2030.05190.02290.02960.02925.1628.26972.87570.36810.4308
2040.05160.01720.02650.02633.22447.00842.64730.29090.3959
2050.0510.03930.02910.02919.77189.5613.09210.72040.4608
2060.0566-0.01270.02630.02631.63278.23972.8705-0.2070.4185
2070.0589-0.00330.02310.0230.11427.07892.6606-0.05470.3665
2080.0675-0.07690.02980.029442.516711.50863.3924-1.05630.4527
2090.0713-0.030.02980.02946.71610.97613.313-0.41980.4491
2100.07520.05170.0320.031822.459712.12453.4820.76780.4809
2110.07550.0610.03460.034633.431314.06143.74990.93670.5224
2120.07760.06450.03710.037337.50716.01524.00190.99220.5615



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