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 09:50:27 +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/t1517475040gul5mm01djgaecz.htm/, Retrieved Sun, 28 Apr 2024 20:11:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=313806, Retrieved Sun, 28 Apr 2024 20:11:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact54
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-02-01 08:50:27] [c594df30d4ca3ffb9387e41ef17d0596] [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 time11 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 time11 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=313806&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]11 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=313806&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313806&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 time11 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.789.681681.978897.38440.10250.32180.99990.3218
20292.295.100786.0182104.18320.26570.98760.99390.7814
20399.298.592488.4878108.6970.45310.89250.94180.9155
204104.5103.610292.8156114.40480.43580.78840.98090.9861
205113110.186798.8168121.55660.31380.83650.47850.9994
206100.4103.371991.4931115.25080.31190.05610.60230.9749
207101103.790691.4381116.14320.3290.70470.28340.9744
20884.893.487780.6834106.2920.09180.12510.3790.6195
20986.590.522477.2805103.76430.27580.80150.81360.4425
21091.788.18674.5167101.85530.30720.59550.84520.3173
21194.890.902876.8139104.99170.29390.45580.74350.4669
2129591.565777.0637106.06770.32130.3310.50350.5035

\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 & 89.6816 & 81.9788 & 97.3844 & 0.1025 & 0.3218 & 0.9999 & 0.3218 \tabularnewline
202 & 92.2 & 95.1007 & 86.0182 & 104.1832 & 0.2657 & 0.9876 & 0.9939 & 0.7814 \tabularnewline
203 & 99.2 & 98.5924 & 88.4878 & 108.697 & 0.4531 & 0.8925 & 0.9418 & 0.9155 \tabularnewline
204 & 104.5 & 103.6102 & 92.8156 & 114.4048 & 0.4358 & 0.7884 & 0.9809 & 0.9861 \tabularnewline
205 & 113 & 110.1867 & 98.8168 & 121.5566 & 0.3138 & 0.8365 & 0.4785 & 0.9994 \tabularnewline
206 & 100.4 & 103.3719 & 91.4931 & 115.2508 & 0.3119 & 0.0561 & 0.6023 & 0.9749 \tabularnewline
207 & 101 & 103.7906 & 91.4381 & 116.1432 & 0.329 & 0.7047 & 0.2834 & 0.9744 \tabularnewline
208 & 84.8 & 93.4877 & 80.6834 & 106.292 & 0.0918 & 0.1251 & 0.379 & 0.6195 \tabularnewline
209 & 86.5 & 90.5224 & 77.2805 & 103.7643 & 0.2758 & 0.8015 & 0.8136 & 0.4425 \tabularnewline
210 & 91.7 & 88.186 & 74.5167 & 101.8553 & 0.3072 & 0.5955 & 0.8452 & 0.3173 \tabularnewline
211 & 94.8 & 90.9028 & 76.8139 & 104.9917 & 0.2939 & 0.4558 & 0.7435 & 0.4669 \tabularnewline
212 & 95 & 91.5657 & 77.0637 & 106.0677 & 0.3213 & 0.331 & 0.5035 & 0.5035 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=313806&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]89.6816[/C][C]81.9788[/C][C]97.3844[/C][C]0.1025[/C][C]0.3218[/C][C]0.9999[/C][C]0.3218[/C][/ROW]
[ROW][C]202[/C][C]92.2[/C][C]95.1007[/C][C]86.0182[/C][C]104.1832[/C][C]0.2657[/C][C]0.9876[/C][C]0.9939[/C][C]0.7814[/C][/ROW]
[ROW][C]203[/C][C]99.2[/C][C]98.5924[/C][C]88.4878[/C][C]108.697[/C][C]0.4531[/C][C]0.8925[/C][C]0.9418[/C][C]0.9155[/C][/ROW]
[ROW][C]204[/C][C]104.5[/C][C]103.6102[/C][C]92.8156[/C][C]114.4048[/C][C]0.4358[/C][C]0.7884[/C][C]0.9809[/C][C]0.9861[/C][/ROW]
[ROW][C]205[/C][C]113[/C][C]110.1867[/C][C]98.8168[/C][C]121.5566[/C][C]0.3138[/C][C]0.8365[/C][C]0.4785[/C][C]0.9994[/C][/ROW]
[ROW][C]206[/C][C]100.4[/C][C]103.3719[/C][C]91.4931[/C][C]115.2508[/C][C]0.3119[/C][C]0.0561[/C][C]0.6023[/C][C]0.9749[/C][/ROW]
[ROW][C]207[/C][C]101[/C][C]103.7906[/C][C]91.4381[/C][C]116.1432[/C][C]0.329[/C][C]0.7047[/C][C]0.2834[/C][C]0.9744[/C][/ROW]
[ROW][C]208[/C][C]84.8[/C][C]93.4877[/C][C]80.6834[/C][C]106.292[/C][C]0.0918[/C][C]0.1251[/C][C]0.379[/C][C]0.6195[/C][/ROW]
[ROW][C]209[/C][C]86.5[/C][C]90.5224[/C][C]77.2805[/C][C]103.7643[/C][C]0.2758[/C][C]0.8015[/C][C]0.8136[/C][C]0.4425[/C][/ROW]
[ROW][C]210[/C][C]91.7[/C][C]88.186[/C][C]74.5167[/C][C]101.8553[/C][C]0.3072[/C][C]0.5955[/C][C]0.8452[/C][C]0.3173[/C][/ROW]
[ROW][C]211[/C][C]94.8[/C][C]90.9028[/C][C]76.8139[/C][C]104.9917[/C][C]0.2939[/C][C]0.4558[/C][C]0.7435[/C][C]0.4669[/C][/ROW]
[ROW][C]212[/C][C]95[/C][C]91.5657[/C][C]77.0637[/C][C]106.0677[/C][C]0.3213[/C][C]0.331[/C][C]0.5035[/C][C]0.5035[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=313806&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313806&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.789.681681.978897.38440.10250.32180.99990.3218
20292.295.100786.0182104.18320.26570.98760.99390.7814
20399.298.592488.4878108.6970.45310.89250.94180.9155
204104.5103.610292.8156114.40480.43580.78840.98090.9861
205113110.186798.8168121.55660.31380.83650.47850.9994
206100.4103.371991.4931115.25080.31190.05610.60230.9749
207101103.790691.4381116.14320.3290.70470.28340.9744
20884.893.487780.6834106.2920.09180.12510.3790.6195
20986.590.522477.2805103.76430.27580.80150.81360.4425
21091.788.18674.5167101.85530.30720.59550.84520.3173
21194.890.902876.8139104.99170.29390.45580.74350.4669
2129591.565777.0637106.06770.32130.3310.50350.5035







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0438-0.05880.05880.057124.816500-0.8070.807
2020.0487-0.03150.04510.04418.414216.61544.0762-0.46990.6385
2030.05230.00610.03210.03140.369111.23.34660.09840.4585
2040.05320.00850.02620.02570.79178.59792.93220.14410.3799
2050.05260.02490.0260.02567.91468.46122.90880.45580.3951
2060.0586-0.02960.02660.02628.83238.52312.9194-0.48150.4095
2070.0607-0.02760.02670.02637.78778.4182.9014-0.45210.4156
2080.0699-0.10240.03620.035275.475716.80024.0988-1.40740.5395
2090.0746-0.04650.03730.036416.1816.73134.0904-0.65160.552
2100.07910.03830.03740.036612.348216.2934.03650.56930.5537
2110.07910.04110.03780.037115.18816.19254.0240.63140.5608
2120.08080.03620.03760.037111.794315.8263.97820.55640.5604

\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.0438 & -0.0588 & 0.0588 & 0.0571 & 24.8165 & 0 & 0 & -0.807 & 0.807 \tabularnewline
202 & 0.0487 & -0.0315 & 0.0451 & 0.0441 & 8.4142 & 16.6154 & 4.0762 & -0.4699 & 0.6385 \tabularnewline
203 & 0.0523 & 0.0061 & 0.0321 & 0.0314 & 0.3691 & 11.2 & 3.3466 & 0.0984 & 0.4585 \tabularnewline
204 & 0.0532 & 0.0085 & 0.0262 & 0.0257 & 0.7917 & 8.5979 & 2.9322 & 0.1441 & 0.3799 \tabularnewline
205 & 0.0526 & 0.0249 & 0.026 & 0.0256 & 7.9146 & 8.4612 & 2.9088 & 0.4558 & 0.3951 \tabularnewline
206 & 0.0586 & -0.0296 & 0.0266 & 0.0262 & 8.8323 & 8.5231 & 2.9194 & -0.4815 & 0.4095 \tabularnewline
207 & 0.0607 & -0.0276 & 0.0267 & 0.0263 & 7.7877 & 8.418 & 2.9014 & -0.4521 & 0.4156 \tabularnewline
208 & 0.0699 & -0.1024 & 0.0362 & 0.0352 & 75.4757 & 16.8002 & 4.0988 & -1.4074 & 0.5395 \tabularnewline
209 & 0.0746 & -0.0465 & 0.0373 & 0.0364 & 16.18 & 16.7313 & 4.0904 & -0.6516 & 0.552 \tabularnewline
210 & 0.0791 & 0.0383 & 0.0374 & 0.0366 & 12.3482 & 16.293 & 4.0365 & 0.5693 & 0.5537 \tabularnewline
211 & 0.0791 & 0.0411 & 0.0378 & 0.0371 & 15.188 & 16.1925 & 4.024 & 0.6314 & 0.5608 \tabularnewline
212 & 0.0808 & 0.0362 & 0.0376 & 0.0371 & 11.7943 & 15.826 & 3.9782 & 0.5564 & 0.5604 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=313806&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.0438[/C][C]-0.0588[/C][C]0.0588[/C][C]0.0571[/C][C]24.8165[/C][C]0[/C][C]0[/C][C]-0.807[/C][C]0.807[/C][/ROW]
[ROW][C]202[/C][C]0.0487[/C][C]-0.0315[/C][C]0.0451[/C][C]0.0441[/C][C]8.4142[/C][C]16.6154[/C][C]4.0762[/C][C]-0.4699[/C][C]0.6385[/C][/ROW]
[ROW][C]203[/C][C]0.0523[/C][C]0.0061[/C][C]0.0321[/C][C]0.0314[/C][C]0.3691[/C][C]11.2[/C][C]3.3466[/C][C]0.0984[/C][C]0.4585[/C][/ROW]
[ROW][C]204[/C][C]0.0532[/C][C]0.0085[/C][C]0.0262[/C][C]0.0257[/C][C]0.7917[/C][C]8.5979[/C][C]2.9322[/C][C]0.1441[/C][C]0.3799[/C][/ROW]
[ROW][C]205[/C][C]0.0526[/C][C]0.0249[/C][C]0.026[/C][C]0.0256[/C][C]7.9146[/C][C]8.4612[/C][C]2.9088[/C][C]0.4558[/C][C]0.3951[/C][/ROW]
[ROW][C]206[/C][C]0.0586[/C][C]-0.0296[/C][C]0.0266[/C][C]0.0262[/C][C]8.8323[/C][C]8.5231[/C][C]2.9194[/C][C]-0.4815[/C][C]0.4095[/C][/ROW]
[ROW][C]207[/C][C]0.0607[/C][C]-0.0276[/C][C]0.0267[/C][C]0.0263[/C][C]7.7877[/C][C]8.418[/C][C]2.9014[/C][C]-0.4521[/C][C]0.4156[/C][/ROW]
[ROW][C]208[/C][C]0.0699[/C][C]-0.1024[/C][C]0.0362[/C][C]0.0352[/C][C]75.4757[/C][C]16.8002[/C][C]4.0988[/C][C]-1.4074[/C][C]0.5395[/C][/ROW]
[ROW][C]209[/C][C]0.0746[/C][C]-0.0465[/C][C]0.0373[/C][C]0.0364[/C][C]16.18[/C][C]16.7313[/C][C]4.0904[/C][C]-0.6516[/C][C]0.552[/C][/ROW]
[ROW][C]210[/C][C]0.0791[/C][C]0.0383[/C][C]0.0374[/C][C]0.0366[/C][C]12.3482[/C][C]16.293[/C][C]4.0365[/C][C]0.5693[/C][C]0.5537[/C][/ROW]
[ROW][C]211[/C][C]0.0791[/C][C]0.0411[/C][C]0.0378[/C][C]0.0371[/C][C]15.188[/C][C]16.1925[/C][C]4.024[/C][C]0.6314[/C][C]0.5608[/C][/ROW]
[ROW][C]212[/C][C]0.0808[/C][C]0.0362[/C][C]0.0376[/C][C]0.0371[/C][C]11.7943[/C][C]15.826[/C][C]3.9782[/C][C]0.5564[/C][C]0.5604[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=313806&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313806&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.0438-0.05880.05880.057124.816500-0.8070.807
2020.0487-0.03150.04510.04418.414216.61544.0762-0.46990.6385
2030.05230.00610.03210.03140.369111.23.34660.09840.4585
2040.05320.00850.02620.02570.79178.59792.93220.14410.3799
2050.05260.02490.0260.02567.91468.46122.90880.45580.3951
2060.0586-0.02960.02660.02628.83238.52312.9194-0.48150.4095
2070.0607-0.02760.02670.02637.78778.4182.9014-0.45210.4156
2080.0699-0.10240.03620.035275.475716.80024.0988-1.40740.5395
2090.0746-0.04650.03730.036416.1816.73134.0904-0.65160.552
2100.07910.03830.03740.036612.348216.2934.03650.56930.5537
2110.07910.04110.03780.037115.18816.19254.0240.63140.5608
2120.08080.03620.03760.037111.794315.8263.97820.55640.5604



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