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, 06 Sep 2018 14:39:39 +0200
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/Sep/06/t1536237594l8xd9ux2p2z5hvo.htm/, Retrieved Thu, 02 May 2024 09:46:04 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=315475, Retrieved Thu, 02 May 2024 09:46:04 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact49
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-09-06 12:39:39] [27993148ab1aadc826ce6032b83fbe19] [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=315475&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=315475&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=315475&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.800680.148796.68130.15390.2510.99960.251
20292.293.454683.8783102.13690.38850.97590.98770.6705
20399.296.494986.5495105.5070.27820.82490.90390.8613
204104.5102.151892.3224111.1150.30380.74070.98520.9901
205113107.667697.9851116.54850.11960.75770.26590.9998
206100.4101.03190.2319110.78240.44950.00810.43860.9723
207101100.814789.595110.90510.48560.53210.10040.9648
20884.891.185378.1671102.56420.13570.04550.22870.4784
20986.589.06375.2421101.01020.33710.75780.77290.3447
21091.786.979272.320699.50130.230.52990.82130.2396
21194.888.981974.2975101.5650.18240.3360.66760.3474
2129589.08174.0055101.95110.18370.19190.35630.3563

\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.8006 & 80.1487 & 96.6813 & 0.1539 & 0.251 & 0.9996 & 0.251 \tabularnewline
202 & 92.2 & 93.4546 & 83.8783 & 102.1369 & 0.3885 & 0.9759 & 0.9877 & 0.6705 \tabularnewline
203 & 99.2 & 96.4949 & 86.5495 & 105.507 & 0.2782 & 0.8249 & 0.9039 & 0.8613 \tabularnewline
204 & 104.5 & 102.1518 & 92.3224 & 111.115 & 0.3038 & 0.7407 & 0.9852 & 0.9901 \tabularnewline
205 & 113 & 107.6676 & 97.9851 & 116.5485 & 0.1196 & 0.7577 & 0.2659 & 0.9998 \tabularnewline
206 & 100.4 & 101.031 & 90.2319 & 110.7824 & 0.4495 & 0.0081 & 0.4386 & 0.9723 \tabularnewline
207 & 101 & 100.8147 & 89.595 & 110.9051 & 0.4856 & 0.5321 & 0.1004 & 0.9648 \tabularnewline
208 & 84.8 & 91.1853 & 78.1671 & 102.5642 & 0.1357 & 0.0455 & 0.2287 & 0.4784 \tabularnewline
209 & 86.5 & 89.063 & 75.2421 & 101.0102 & 0.3371 & 0.7578 & 0.7729 & 0.3447 \tabularnewline
210 & 91.7 & 86.9792 & 72.3206 & 99.5013 & 0.23 & 0.5299 & 0.8213 & 0.2396 \tabularnewline
211 & 94.8 & 88.9819 & 74.2975 & 101.565 & 0.1824 & 0.336 & 0.6676 & 0.3474 \tabularnewline
212 & 95 & 89.081 & 74.0055 & 101.9511 & 0.1837 & 0.1919 & 0.3563 & 0.3563 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=315475&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.8006[/C][C]80.1487[/C][C]96.6813[/C][C]0.1539[/C][C]0.251[/C][C]0.9996[/C][C]0.251[/C][/ROW]
[ROW][C]202[/C][C]92.2[/C][C]93.4546[/C][C]83.8783[/C][C]102.1369[/C][C]0.3885[/C][C]0.9759[/C][C]0.9877[/C][C]0.6705[/C][/ROW]
[ROW][C]203[/C][C]99.2[/C][C]96.4949[/C][C]86.5495[/C][C]105.507[/C][C]0.2782[/C][C]0.8249[/C][C]0.9039[/C][C]0.8613[/C][/ROW]
[ROW][C]204[/C][C]104.5[/C][C]102.1518[/C][C]92.3224[/C][C]111.115[/C][C]0.3038[/C][C]0.7407[/C][C]0.9852[/C][C]0.9901[/C][/ROW]
[ROW][C]205[/C][C]113[/C][C]107.6676[/C][C]97.9851[/C][C]116.5485[/C][C]0.1196[/C][C]0.7577[/C][C]0.2659[/C][C]0.9998[/C][/ROW]
[ROW][C]206[/C][C]100.4[/C][C]101.031[/C][C]90.2319[/C][C]110.7824[/C][C]0.4495[/C][C]0.0081[/C][C]0.4386[/C][C]0.9723[/C][/ROW]
[ROW][C]207[/C][C]101[/C][C]100.8147[/C][C]89.595[/C][C]110.9051[/C][C]0.4856[/C][C]0.5321[/C][C]0.1004[/C][C]0.9648[/C][/ROW]
[ROW][C]208[/C][C]84.8[/C][C]91.1853[/C][C]78.1671[/C][C]102.5642[/C][C]0.1357[/C][C]0.0455[/C][C]0.2287[/C][C]0.4784[/C][/ROW]
[ROW][C]209[/C][C]86.5[/C][C]89.063[/C][C]75.2421[/C][C]101.0102[/C][C]0.3371[/C][C]0.7578[/C][C]0.7729[/C][C]0.3447[/C][/ROW]
[ROW][C]210[/C][C]91.7[/C][C]86.9792[/C][C]72.3206[/C][C]99.5013[/C][C]0.23[/C][C]0.5299[/C][C]0.8213[/C][C]0.2396[/C][/ROW]
[ROW][C]211[/C][C]94.8[/C][C]88.9819[/C][C]74.2975[/C][C]101.565[/C][C]0.1824[/C][C]0.336[/C][C]0.6676[/C][C]0.3474[/C][/ROW]
[ROW][C]212[/C][C]95[/C][C]89.081[/C][C]74.0055[/C][C]101.9511[/C][C]0.1837[/C][C]0.1919[/C][C]0.3563[/C][C]0.3563[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=315475&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=315475&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.800680.148796.68130.15390.2510.99960.251
20292.293.454683.8783102.13690.38850.97590.98770.6705
20399.296.494986.5495105.5070.27820.82490.90390.8613
204104.5102.151892.3224111.1150.30380.74070.98520.9901
205113107.667697.9851116.54850.11960.75770.26590.9998
206100.4101.03190.2319110.78240.44950.00810.43860.9723
207101100.814789.595110.90510.48560.53210.10040.9648
20884.891.185378.1671102.56420.13570.04550.22870.4784
20986.589.06375.2421101.01020.33710.75780.77290.3447
21091.786.979272.320699.50130.230.52990.82130.2396
21194.888.981974.2975101.5650.18240.3360.66760.3474
2129589.08174.0055101.95110.18370.19190.35630.3563







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0453-0.04840.04840.047316.814900-0.66430.6643
2020.0474-0.01360.0310.03041.5749.19453.0322-0.20330.4338
2030.04770.02730.02980.02957.31768.56882.92730.43820.4353
2040.04480.02250.02790.02785.51417.80522.79380.38040.4216
2050.04210.04720.03180.031928.434711.93113.45410.86390.51
2060.0492-0.00630.02750.02760.398110.00893.1637-0.10220.442
2070.05110.00180.02390.02390.03438.5842.92980.030.3832
2080.0637-0.07530.03030.0340.771812.60743.5507-1.03440.4646
2090.0684-0.02960.03020.02996.568911.93653.4549-0.41520.4591
2100.07350.05150.03230.032222.285912.97143.60160.76480.4897
2110.07210.06140.0350.03533.849814.86953.85610.94250.5308
2120.07370.06230.03730.037535.034616.54994.06820.95890.5665

\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.0453 & -0.0484 & 0.0484 & 0.0473 & 16.8149 & 0 & 0 & -0.6643 & 0.6643 \tabularnewline
202 & 0.0474 & -0.0136 & 0.031 & 0.0304 & 1.574 & 9.1945 & 3.0322 & -0.2033 & 0.4338 \tabularnewline
203 & 0.0477 & 0.0273 & 0.0298 & 0.0295 & 7.3176 & 8.5688 & 2.9273 & 0.4382 & 0.4353 \tabularnewline
204 & 0.0448 & 0.0225 & 0.0279 & 0.0278 & 5.5141 & 7.8052 & 2.7938 & 0.3804 & 0.4216 \tabularnewline
205 & 0.0421 & 0.0472 & 0.0318 & 0.0319 & 28.4347 & 11.9311 & 3.4541 & 0.8639 & 0.51 \tabularnewline
206 & 0.0492 & -0.0063 & 0.0275 & 0.0276 & 0.3981 & 10.0089 & 3.1637 & -0.1022 & 0.442 \tabularnewline
207 & 0.0511 & 0.0018 & 0.0239 & 0.0239 & 0.0343 & 8.584 & 2.9298 & 0.03 & 0.3832 \tabularnewline
208 & 0.0637 & -0.0753 & 0.0303 & 0.03 & 40.7718 & 12.6074 & 3.5507 & -1.0344 & 0.4646 \tabularnewline
209 & 0.0684 & -0.0296 & 0.0302 & 0.0299 & 6.5689 & 11.9365 & 3.4549 & -0.4152 & 0.4591 \tabularnewline
210 & 0.0735 & 0.0515 & 0.0323 & 0.0322 & 22.2859 & 12.9714 & 3.6016 & 0.7648 & 0.4897 \tabularnewline
211 & 0.0721 & 0.0614 & 0.035 & 0.035 & 33.8498 & 14.8695 & 3.8561 & 0.9425 & 0.5308 \tabularnewline
212 & 0.0737 & 0.0623 & 0.0373 & 0.0375 & 35.0346 & 16.5499 & 4.0682 & 0.9589 & 0.5665 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=315475&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.0453[/C][C]-0.0484[/C][C]0.0484[/C][C]0.0473[/C][C]16.8149[/C][C]0[/C][C]0[/C][C]-0.6643[/C][C]0.6643[/C][/ROW]
[ROW][C]202[/C][C]0.0474[/C][C]-0.0136[/C][C]0.031[/C][C]0.0304[/C][C]1.574[/C][C]9.1945[/C][C]3.0322[/C][C]-0.2033[/C][C]0.4338[/C][/ROW]
[ROW][C]203[/C][C]0.0477[/C][C]0.0273[/C][C]0.0298[/C][C]0.0295[/C][C]7.3176[/C][C]8.5688[/C][C]2.9273[/C][C]0.4382[/C][C]0.4353[/C][/ROW]
[ROW][C]204[/C][C]0.0448[/C][C]0.0225[/C][C]0.0279[/C][C]0.0278[/C][C]5.5141[/C][C]7.8052[/C][C]2.7938[/C][C]0.3804[/C][C]0.4216[/C][/ROW]
[ROW][C]205[/C][C]0.0421[/C][C]0.0472[/C][C]0.0318[/C][C]0.0319[/C][C]28.4347[/C][C]11.9311[/C][C]3.4541[/C][C]0.8639[/C][C]0.51[/C][/ROW]
[ROW][C]206[/C][C]0.0492[/C][C]-0.0063[/C][C]0.0275[/C][C]0.0276[/C][C]0.3981[/C][C]10.0089[/C][C]3.1637[/C][C]-0.1022[/C][C]0.442[/C][/ROW]
[ROW][C]207[/C][C]0.0511[/C][C]0.0018[/C][C]0.0239[/C][C]0.0239[/C][C]0.0343[/C][C]8.584[/C][C]2.9298[/C][C]0.03[/C][C]0.3832[/C][/ROW]
[ROW][C]208[/C][C]0.0637[/C][C]-0.0753[/C][C]0.0303[/C][C]0.03[/C][C]40.7718[/C][C]12.6074[/C][C]3.5507[/C][C]-1.0344[/C][C]0.4646[/C][/ROW]
[ROW][C]209[/C][C]0.0684[/C][C]-0.0296[/C][C]0.0302[/C][C]0.0299[/C][C]6.5689[/C][C]11.9365[/C][C]3.4549[/C][C]-0.4152[/C][C]0.4591[/C][/ROW]
[ROW][C]210[/C][C]0.0735[/C][C]0.0515[/C][C]0.0323[/C][C]0.0322[/C][C]22.2859[/C][C]12.9714[/C][C]3.6016[/C][C]0.7648[/C][C]0.4897[/C][/ROW]
[ROW][C]211[/C][C]0.0721[/C][C]0.0614[/C][C]0.035[/C][C]0.035[/C][C]33.8498[/C][C]14.8695[/C][C]3.8561[/C][C]0.9425[/C][C]0.5308[/C][/ROW]
[ROW][C]212[/C][C]0.0737[/C][C]0.0623[/C][C]0.0373[/C][C]0.0375[/C][C]35.0346[/C][C]16.5499[/C][C]4.0682[/C][C]0.9589[/C][C]0.5665[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=315475&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=315475&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.0453-0.04840.04840.047316.814900-0.66430.6643
2020.0474-0.01360.0310.03041.5749.19453.0322-0.20330.4338
2030.04770.02730.02980.02957.31768.56882.92730.43820.4353
2040.04480.02250.02790.02785.51417.80522.79380.38040.4216
2050.04210.04720.03180.031928.434711.93113.45410.86390.51
2060.0492-0.00630.02750.02760.398110.00893.1637-0.10220.442
2070.05110.00180.02390.02390.03438.5842.92980.030.3832
2080.0637-0.07530.03030.0340.771812.60743.5507-1.03440.4646
2090.0684-0.02960.03020.02996.568911.93653.4549-0.41520.4591
2100.07350.05150.03230.032222.285912.97143.60160.76480.4897
2110.07210.06140.0350.03533.849814.86953.85610.94250.5308
2120.07370.06230.03730.037535.034616.54994.06820.95890.5665



Parameters (Session):
Parameters (R input):
par1 = 12 ; par2 = 2.0 ; 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')