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, 06 Dec 2017 09:54:11 +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/06/t1512550508d0524vdve16de13.htm/, Retrieved Tue, 14 May 2024 11:06:01 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=308579, Retrieved Tue, 14 May 2024 11:06:01 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact106
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-12-06 08:54:11] [00446966c981c20899b3ab1dc0dd23cd] [Current]
Feedback Forum

Post a new message
Dataseries X:
62.4
67.4
76.1
67.4
74.5
72.6
60.5
66.1
76.5
76.8
77
71
74.8
73.7
80.5
71.8
76.9
79.9
65.9
69.5
75.1
79.6
75.2
68
72.8
71.5
78.5
76.8
75.3
76.7
69.7
67.8
77.5
82.5
75.3
70.9
76
73.7
79.7
77.8
73.3
78.3
71.9
67
82
83.7
74.8
80
74.3
76.8
89
81.9
76.8
88.9
75.8
75.5
89.1
88
85.9
89.3
82.9
81.2
90.5
86.4
81.8
91.3
73.4
76.6
91
87
89.7
90.7
86.5
86.6
98.8
84.4
91.4
95.7
78.5
81.7
94.3
98.5
95.4
91.7
92.8
90.5
102.2
91.8
95
102
88.9
89.6
97.9
108.6
100.8
95.1
101
100.9
102.5
105.4
98.4
105.3
96.5
88.1
107.9
107
92.5
95.7
85.2
85.5
94.7
86.2
88.8
93.4
83.4
82.9
96.7
96.2
92.8
92.8
90
95.4
108.3
96.3
95
109
92
92.3
107
105.5
105.4
103.9
99.2
102.2
121.5
102.3
110
105.9
91.9
100
111.7
104.9
103.3
101.8
100.8
104.2
116.5
97.9
100.7
107
96.3
96
104.5
107.4
102.4
94.9
98.8
96.8
108.2
103.8
102.3
107.2
102
92.6
105.2
113
105.6
101.6
101.7
102.7
109
105.5
103.3
108.6
98.2
90
112.4
111.9
102.1
102.4
101.7
98.7
114
105.1
98.3
110
96.5
92.2
112
111.4
107.5
103.4
103.5
107.4
117.6
110.2
104.3
115.9
98.9
101.9
113.5
109.5
110
114.2
106.9
109.2
124.2
104.7
111.9
119
102.9
106.3




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308579&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])
19998.9-------
200101.9-------
201113.5111.038298.189125.02060.3650.89990.89990.8999
202109.5105.846992.6669120.28610.310.14940.14940.7039
203110104.838291.7304119.2040.24060.26240.26240.6557
204114.2108.836194.7372124.34190.24890.44150.44150.8097
205106.9107.640393.3342123.41480.46340.20750.20750.7621
206109.2106.496292.293122.16290.36760.47990.47990.7174
207124.2108.049493.5344124.0720.02410.4440.4440.774
208104.7108.068193.3376124.35350.34260.02610.02610.7711
209111.9107.469292.733123.77110.29710.63040.63040.7484
210119108.027193.1195124.52980.09620.32280.32280.7666
211102.9108.277893.1753125.01570.26440.10460.10460.7724
212106.3108.075992.8801124.93190.41820.72640.72640.7637

\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
199 & 98.9 & - & - & - & - & - & - & - \tabularnewline
200 & 101.9 & - & - & - & - & - & - & - \tabularnewline
201 & 113.5 & 111.0382 & 98.189 & 125.0206 & 0.365 & 0.8999 & 0.8999 & 0.8999 \tabularnewline
202 & 109.5 & 105.8469 & 92.6669 & 120.2861 & 0.31 & 0.1494 & 0.1494 & 0.7039 \tabularnewline
203 & 110 & 104.8382 & 91.7304 & 119.204 & 0.2406 & 0.2624 & 0.2624 & 0.6557 \tabularnewline
204 & 114.2 & 108.8361 & 94.7372 & 124.3419 & 0.2489 & 0.4415 & 0.4415 & 0.8097 \tabularnewline
205 & 106.9 & 107.6403 & 93.3342 & 123.4148 & 0.4634 & 0.2075 & 0.2075 & 0.7621 \tabularnewline
206 & 109.2 & 106.4962 & 92.293 & 122.1629 & 0.3676 & 0.4799 & 0.4799 & 0.7174 \tabularnewline
207 & 124.2 & 108.0494 & 93.5344 & 124.072 & 0.0241 & 0.444 & 0.444 & 0.774 \tabularnewline
208 & 104.7 & 108.0681 & 93.3376 & 124.3535 & 0.3426 & 0.0261 & 0.0261 & 0.7711 \tabularnewline
209 & 111.9 & 107.4692 & 92.733 & 123.7711 & 0.2971 & 0.6304 & 0.6304 & 0.7484 \tabularnewline
210 & 119 & 108.0271 & 93.1195 & 124.5298 & 0.0962 & 0.3228 & 0.3228 & 0.7666 \tabularnewline
211 & 102.9 & 108.2778 & 93.1753 & 125.0157 & 0.2644 & 0.1046 & 0.1046 & 0.7724 \tabularnewline
212 & 106.3 & 108.0759 & 92.8801 & 124.9319 & 0.4182 & 0.7264 & 0.7264 & 0.7637 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308579&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]199[/C][C]98.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]101.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]113.5[/C][C]111.0382[/C][C]98.189[/C][C]125.0206[/C][C]0.365[/C][C]0.8999[/C][C]0.8999[/C][C]0.8999[/C][/ROW]
[ROW][C]202[/C][C]109.5[/C][C]105.8469[/C][C]92.6669[/C][C]120.2861[/C][C]0.31[/C][C]0.1494[/C][C]0.1494[/C][C]0.7039[/C][/ROW]
[ROW][C]203[/C][C]110[/C][C]104.8382[/C][C]91.7304[/C][C]119.204[/C][C]0.2406[/C][C]0.2624[/C][C]0.2624[/C][C]0.6557[/C][/ROW]
[ROW][C]204[/C][C]114.2[/C][C]108.8361[/C][C]94.7372[/C][C]124.3419[/C][C]0.2489[/C][C]0.4415[/C][C]0.4415[/C][C]0.8097[/C][/ROW]
[ROW][C]205[/C][C]106.9[/C][C]107.6403[/C][C]93.3342[/C][C]123.4148[/C][C]0.4634[/C][C]0.2075[/C][C]0.2075[/C][C]0.7621[/C][/ROW]
[ROW][C]206[/C][C]109.2[/C][C]106.4962[/C][C]92.293[/C][C]122.1629[/C][C]0.3676[/C][C]0.4799[/C][C]0.4799[/C][C]0.7174[/C][/ROW]
[ROW][C]207[/C][C]124.2[/C][C]108.0494[/C][C]93.5344[/C][C]124.072[/C][C]0.0241[/C][C]0.444[/C][C]0.444[/C][C]0.774[/C][/ROW]
[ROW][C]208[/C][C]104.7[/C][C]108.0681[/C][C]93.3376[/C][C]124.3535[/C][C]0.3426[/C][C]0.0261[/C][C]0.0261[/C][C]0.7711[/C][/ROW]
[ROW][C]209[/C][C]111.9[/C][C]107.4692[/C][C]92.733[/C][C]123.7711[/C][C]0.2971[/C][C]0.6304[/C][C]0.6304[/C][C]0.7484[/C][/ROW]
[ROW][C]210[/C][C]119[/C][C]108.0271[/C][C]93.1195[/C][C]124.5298[/C][C]0.0962[/C][C]0.3228[/C][C]0.3228[/C][C]0.7666[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]108.2778[/C][C]93.1753[/C][C]125.0157[/C][C]0.2644[/C][C]0.1046[/C][C]0.1046[/C][C]0.7724[/C][/ROW]
[ROW][C]212[/C][C]106.3[/C][C]108.0759[/C][C]92.8801[/C][C]124.9319[/C][C]0.4182[/C][C]0.7264[/C][C]0.7264[/C][C]0.7637[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308579&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308579&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])
19998.9-------
200101.9-------
201113.5111.038298.189125.02060.3650.89990.89990.8999
202109.5105.846992.6669120.28610.310.14940.14940.7039
203110104.838291.7304119.2040.24060.26240.26240.6557
204114.2108.836194.7372124.34190.24890.44150.44150.8097
205106.9107.640393.3342123.41480.46340.20750.20750.7621
206109.2106.496292.293122.16290.36760.47990.47990.7174
207124.2108.049493.5344124.0720.02410.4440.4440.774
208104.7108.068193.3376124.35350.34260.02610.02610.7711
209111.9107.469292.733123.77110.29710.63040.63040.7484
210119108.027193.1195124.52980.09620.32280.32280.7666
211102.9108.277893.1753125.01570.26440.10460.10460.7724
212106.3108.075992.8801124.93190.41820.72640.72640.7637







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.06420.02170.02170.02196.0604000.31270.3127
2020.06960.03340.02750.027913.34549.70293.11490.4640.3884
2030.06990.04690.0340.034626.644215.353.91790.65570.4775
2040.07270.0470.03720.03828.771218.70534.3250.68130.5284
2050.0748-0.00690.03120.03180.54815.07383.8825-0.0940.4415
2060.07510.02480.03010.03077.310713.783.71210.34340.4252
2070.07570.130.04440.0462260.842549.07467.00532.05150.6575
2080.0769-0.03220.04290.044311.34444.35836.6602-0.42780.6288
2090.07740.03960.04250.043919.632441.6116.45070.56280.6215
2100.07790.09220.04750.0492120.405249.49047.03491.39380.6987
2110.0789-0.05230.04790.049328.921247.62056.9008-0.68310.6973
2120.0796-0.01670.04530.04663.153843.91496.6268-0.22560.658

\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.0642 & 0.0217 & 0.0217 & 0.0219 & 6.0604 & 0 & 0 & 0.3127 & 0.3127 \tabularnewline
202 & 0.0696 & 0.0334 & 0.0275 & 0.0279 & 13.3454 & 9.7029 & 3.1149 & 0.464 & 0.3884 \tabularnewline
203 & 0.0699 & 0.0469 & 0.034 & 0.0346 & 26.6442 & 15.35 & 3.9179 & 0.6557 & 0.4775 \tabularnewline
204 & 0.0727 & 0.047 & 0.0372 & 0.038 & 28.7712 & 18.7053 & 4.325 & 0.6813 & 0.5284 \tabularnewline
205 & 0.0748 & -0.0069 & 0.0312 & 0.0318 & 0.548 & 15.0738 & 3.8825 & -0.094 & 0.4415 \tabularnewline
206 & 0.0751 & 0.0248 & 0.0301 & 0.0307 & 7.3107 & 13.78 & 3.7121 & 0.3434 & 0.4252 \tabularnewline
207 & 0.0757 & 0.13 & 0.0444 & 0.0462 & 260.8425 & 49.0746 & 7.0053 & 2.0515 & 0.6575 \tabularnewline
208 & 0.0769 & -0.0322 & 0.0429 & 0.0443 & 11.344 & 44.3583 & 6.6602 & -0.4278 & 0.6288 \tabularnewline
209 & 0.0774 & 0.0396 & 0.0425 & 0.0439 & 19.6324 & 41.611 & 6.4507 & 0.5628 & 0.6215 \tabularnewline
210 & 0.0779 & 0.0922 & 0.0475 & 0.0492 & 120.4052 & 49.4904 & 7.0349 & 1.3938 & 0.6987 \tabularnewline
211 & 0.0789 & -0.0523 & 0.0479 & 0.0493 & 28.9212 & 47.6205 & 6.9008 & -0.6831 & 0.6973 \tabularnewline
212 & 0.0796 & -0.0167 & 0.0453 & 0.0466 & 3.1538 & 43.9149 & 6.6268 & -0.2256 & 0.658 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308579&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.0642[/C][C]0.0217[/C][C]0.0217[/C][C]0.0219[/C][C]6.0604[/C][C]0[/C][C]0[/C][C]0.3127[/C][C]0.3127[/C][/ROW]
[ROW][C]202[/C][C]0.0696[/C][C]0.0334[/C][C]0.0275[/C][C]0.0279[/C][C]13.3454[/C][C]9.7029[/C][C]3.1149[/C][C]0.464[/C][C]0.3884[/C][/ROW]
[ROW][C]203[/C][C]0.0699[/C][C]0.0469[/C][C]0.034[/C][C]0.0346[/C][C]26.6442[/C][C]15.35[/C][C]3.9179[/C][C]0.6557[/C][C]0.4775[/C][/ROW]
[ROW][C]204[/C][C]0.0727[/C][C]0.047[/C][C]0.0372[/C][C]0.038[/C][C]28.7712[/C][C]18.7053[/C][C]4.325[/C][C]0.6813[/C][C]0.5284[/C][/ROW]
[ROW][C]205[/C][C]0.0748[/C][C]-0.0069[/C][C]0.0312[/C][C]0.0318[/C][C]0.548[/C][C]15.0738[/C][C]3.8825[/C][C]-0.094[/C][C]0.4415[/C][/ROW]
[ROW][C]206[/C][C]0.0751[/C][C]0.0248[/C][C]0.0301[/C][C]0.0307[/C][C]7.3107[/C][C]13.78[/C][C]3.7121[/C][C]0.3434[/C][C]0.4252[/C][/ROW]
[ROW][C]207[/C][C]0.0757[/C][C]0.13[/C][C]0.0444[/C][C]0.0462[/C][C]260.8425[/C][C]49.0746[/C][C]7.0053[/C][C]2.0515[/C][C]0.6575[/C][/ROW]
[ROW][C]208[/C][C]0.0769[/C][C]-0.0322[/C][C]0.0429[/C][C]0.0443[/C][C]11.344[/C][C]44.3583[/C][C]6.6602[/C][C]-0.4278[/C][C]0.6288[/C][/ROW]
[ROW][C]209[/C][C]0.0774[/C][C]0.0396[/C][C]0.0425[/C][C]0.0439[/C][C]19.6324[/C][C]41.611[/C][C]6.4507[/C][C]0.5628[/C][C]0.6215[/C][/ROW]
[ROW][C]210[/C][C]0.0779[/C][C]0.0922[/C][C]0.0475[/C][C]0.0492[/C][C]120.4052[/C][C]49.4904[/C][C]7.0349[/C][C]1.3938[/C][C]0.6987[/C][/ROW]
[ROW][C]211[/C][C]0.0789[/C][C]-0.0523[/C][C]0.0479[/C][C]0.0493[/C][C]28.9212[/C][C]47.6205[/C][C]6.9008[/C][C]-0.6831[/C][C]0.6973[/C][/ROW]
[ROW][C]212[/C][C]0.0796[/C][C]-0.0167[/C][C]0.0453[/C][C]0.0466[/C][C]3.1538[/C][C]43.9149[/C][C]6.6268[/C][C]-0.2256[/C][C]0.658[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308579&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308579&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.06420.02170.02170.02196.0604000.31270.3127
2020.06960.03340.02750.027913.34549.70293.11490.4640.3884
2030.06990.04690.0340.034626.644215.353.91790.65570.4775
2040.07270.0470.03720.03828.771218.70534.3250.68130.5284
2050.0748-0.00690.03120.03180.54815.07383.8825-0.0940.4415
2060.07510.02480.03010.03077.310713.783.71210.34340.4252
2070.07570.130.04440.0462260.842549.07467.00532.05150.6575
2080.0769-0.03220.04290.044311.34444.35836.6602-0.42780.6288
2090.07740.03960.04250.043919.632441.6116.45070.56280.6215
2100.07790.09220.04750.0492120.405249.49047.03491.39380.6987
2110.0789-0.05230.04790.049328.921247.62056.9008-0.68310.6973
2120.0796-0.01670.04530.04663.153843.91496.6268-0.22560.658



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