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 10:42:36 +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/t15174782599kllufpg53zgypx.htm/, Retrieved Sun, 28 Apr 2024 20:01:54 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=314316, Retrieved Sun, 28 Apr 2024 20:01:54 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact32
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-02-01 09:42:36] [660d6cc7d16eb210a8f36714ddc434fa] [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 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=314316&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=314316&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314316&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])
19998.9-------
200101.9-------
201113.5109.531197.4927121.56950.25910.8930.8930.893
202109.5108.986896.6234121.35010.46760.23720.23720.8694
203110106.036993.6549118.4190.26520.29180.29180.7437
204114.2105.67493.1172118.23080.09160.24980.24980.7221
205106.9106.704393.5491119.85950.48840.1320.1320.7629
206109.2107.037393.4884120.58610.37720.50790.50790.7713
207124.2106.71792.9524120.48160.00640.36180.36180.7536
208104.7106.531492.5371120.52570.39880.00670.00670.7417
209111.9106.615292.3341120.89620.23410.60370.60370.7412
210119106.700592.1333121.26760.0490.24210.24210.7408
211102.9106.685691.8597121.51150.30840.05180.05180.7365
212106.3106.650991.5765121.72540.48180.68710.68710.7316

\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 & 109.5311 & 97.4927 & 121.5695 & 0.2591 & 0.893 & 0.893 & 0.893 \tabularnewline
202 & 109.5 & 108.9868 & 96.6234 & 121.3501 & 0.4676 & 0.2372 & 0.2372 & 0.8694 \tabularnewline
203 & 110 & 106.0369 & 93.6549 & 118.419 & 0.2652 & 0.2918 & 0.2918 & 0.7437 \tabularnewline
204 & 114.2 & 105.674 & 93.1172 & 118.2308 & 0.0916 & 0.2498 & 0.2498 & 0.7221 \tabularnewline
205 & 106.9 & 106.7043 & 93.5491 & 119.8595 & 0.4884 & 0.132 & 0.132 & 0.7629 \tabularnewline
206 & 109.2 & 107.0373 & 93.4884 & 120.5861 & 0.3772 & 0.5079 & 0.5079 & 0.7713 \tabularnewline
207 & 124.2 & 106.717 & 92.9524 & 120.4816 & 0.0064 & 0.3618 & 0.3618 & 0.7536 \tabularnewline
208 & 104.7 & 106.5314 & 92.5371 & 120.5257 & 0.3988 & 0.0067 & 0.0067 & 0.7417 \tabularnewline
209 & 111.9 & 106.6152 & 92.3341 & 120.8962 & 0.2341 & 0.6037 & 0.6037 & 0.7412 \tabularnewline
210 & 119 & 106.7005 & 92.1333 & 121.2676 & 0.049 & 0.2421 & 0.2421 & 0.7408 \tabularnewline
211 & 102.9 & 106.6856 & 91.8597 & 121.5115 & 0.3084 & 0.0518 & 0.0518 & 0.7365 \tabularnewline
212 & 106.3 & 106.6509 & 91.5765 & 121.7254 & 0.4818 & 0.6871 & 0.6871 & 0.7316 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=314316&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]109.5311[/C][C]97.4927[/C][C]121.5695[/C][C]0.2591[/C][C]0.893[/C][C]0.893[/C][C]0.893[/C][/ROW]
[ROW][C]202[/C][C]109.5[/C][C]108.9868[/C][C]96.6234[/C][C]121.3501[/C][C]0.4676[/C][C]0.2372[/C][C]0.2372[/C][C]0.8694[/C][/ROW]
[ROW][C]203[/C][C]110[/C][C]106.0369[/C][C]93.6549[/C][C]118.419[/C][C]0.2652[/C][C]0.2918[/C][C]0.2918[/C][C]0.7437[/C][/ROW]
[ROW][C]204[/C][C]114.2[/C][C]105.674[/C][C]93.1172[/C][C]118.2308[/C][C]0.0916[/C][C]0.2498[/C][C]0.2498[/C][C]0.7221[/C][/ROW]
[ROW][C]205[/C][C]106.9[/C][C]106.7043[/C][C]93.5491[/C][C]119.8595[/C][C]0.4884[/C][C]0.132[/C][C]0.132[/C][C]0.7629[/C][/ROW]
[ROW][C]206[/C][C]109.2[/C][C]107.0373[/C][C]93.4884[/C][C]120.5861[/C][C]0.3772[/C][C]0.5079[/C][C]0.5079[/C][C]0.7713[/C][/ROW]
[ROW][C]207[/C][C]124.2[/C][C]106.717[/C][C]92.9524[/C][C]120.4816[/C][C]0.0064[/C][C]0.3618[/C][C]0.3618[/C][C]0.7536[/C][/ROW]
[ROW][C]208[/C][C]104.7[/C][C]106.5314[/C][C]92.5371[/C][C]120.5257[/C][C]0.3988[/C][C]0.0067[/C][C]0.0067[/C][C]0.7417[/C][/ROW]
[ROW][C]209[/C][C]111.9[/C][C]106.6152[/C][C]92.3341[/C][C]120.8962[/C][C]0.2341[/C][C]0.6037[/C][C]0.6037[/C][C]0.7412[/C][/ROW]
[ROW][C]210[/C][C]119[/C][C]106.7005[/C][C]92.1333[/C][C]121.2676[/C][C]0.049[/C][C]0.2421[/C][C]0.2421[/C][C]0.7408[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]106.6856[/C][C]91.8597[/C][C]121.5115[/C][C]0.3084[/C][C]0.0518[/C][C]0.0518[/C][C]0.7365[/C][/ROW]
[ROW][C]212[/C][C]106.3[/C][C]106.6509[/C][C]91.5765[/C][C]121.7254[/C][C]0.4818[/C][C]0.6871[/C][C]0.6871[/C][C]0.7316[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=314316&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314316&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.5109.531197.4927121.56950.25910.8930.8930.893
202109.5108.986896.6234121.35010.46760.23720.23720.8694
203110106.036993.6549118.4190.26520.29180.29180.7437
204114.2105.67493.1172118.23080.09160.24980.24980.7221
205106.9106.704393.5491119.85950.48840.1320.1320.7629
206109.2107.037393.4884120.58610.37720.50790.50790.7713
207124.2106.71792.9524120.48160.00640.36180.36180.7536
208104.7106.531492.5371120.52570.39880.00670.00670.7417
209111.9106.615292.3341120.89620.23410.60370.60370.7412
210119106.700592.1333121.26760.0490.24210.24210.7408
211102.9106.685691.8597121.51150.30840.05180.05180.7365
212106.3106.650991.5765121.72540.48180.68710.68710.7316







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.05610.0350.0350.035615.7521000.50410.5041
2020.05790.00470.01980.02010.26348.00782.82980.06520.2847
2030.05960.0360.02520.025715.705910.57383.25170.50340.3576
2040.06060.07470.03760.038672.692426.10345.10921.0830.5389
2050.06290.00180.03040.03130.038320.89044.57060.02490.4361
2060.06460.01980.02870.02944.677518.18834.26480.27470.4092
2070.06580.14080.04470.0468305.656259.25517.69772.22070.668
2080.067-0.01750.04130.04313.35452.26757.2296-0.23260.6136
2090.06830.04720.04190.043727.929149.56327.04010.67130.62
2100.06970.10340.04810.0502151.278259.73477.72881.56230.7142
2110.0709-0.03680.04710.04914.330755.60717.457-0.48080.693
2120.0721-0.00330.04340.04520.123250.98347.1403-0.04460.639

\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.0561 & 0.035 & 0.035 & 0.0356 & 15.7521 & 0 & 0 & 0.5041 & 0.5041 \tabularnewline
202 & 0.0579 & 0.0047 & 0.0198 & 0.0201 & 0.2634 & 8.0078 & 2.8298 & 0.0652 & 0.2847 \tabularnewline
203 & 0.0596 & 0.036 & 0.0252 & 0.0257 & 15.7059 & 10.5738 & 3.2517 & 0.5034 & 0.3576 \tabularnewline
204 & 0.0606 & 0.0747 & 0.0376 & 0.0386 & 72.6924 & 26.1034 & 5.1092 & 1.083 & 0.5389 \tabularnewline
205 & 0.0629 & 0.0018 & 0.0304 & 0.0313 & 0.0383 & 20.8904 & 4.5706 & 0.0249 & 0.4361 \tabularnewline
206 & 0.0646 & 0.0198 & 0.0287 & 0.0294 & 4.6775 & 18.1883 & 4.2648 & 0.2747 & 0.4092 \tabularnewline
207 & 0.0658 & 0.1408 & 0.0447 & 0.0468 & 305.6562 & 59.2551 & 7.6977 & 2.2207 & 0.668 \tabularnewline
208 & 0.067 & -0.0175 & 0.0413 & 0.0431 & 3.354 & 52.2675 & 7.2296 & -0.2326 & 0.6136 \tabularnewline
209 & 0.0683 & 0.0472 & 0.0419 & 0.0437 & 27.9291 & 49.5632 & 7.0401 & 0.6713 & 0.62 \tabularnewline
210 & 0.0697 & 0.1034 & 0.0481 & 0.0502 & 151.2782 & 59.7347 & 7.7288 & 1.5623 & 0.7142 \tabularnewline
211 & 0.0709 & -0.0368 & 0.0471 & 0.049 & 14.3307 & 55.6071 & 7.457 & -0.4808 & 0.693 \tabularnewline
212 & 0.0721 & -0.0033 & 0.0434 & 0.0452 & 0.1232 & 50.9834 & 7.1403 & -0.0446 & 0.639 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=314316&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.0561[/C][C]0.035[/C][C]0.035[/C][C]0.0356[/C][C]15.7521[/C][C]0[/C][C]0[/C][C]0.5041[/C][C]0.5041[/C][/ROW]
[ROW][C]202[/C][C]0.0579[/C][C]0.0047[/C][C]0.0198[/C][C]0.0201[/C][C]0.2634[/C][C]8.0078[/C][C]2.8298[/C][C]0.0652[/C][C]0.2847[/C][/ROW]
[ROW][C]203[/C][C]0.0596[/C][C]0.036[/C][C]0.0252[/C][C]0.0257[/C][C]15.7059[/C][C]10.5738[/C][C]3.2517[/C][C]0.5034[/C][C]0.3576[/C][/ROW]
[ROW][C]204[/C][C]0.0606[/C][C]0.0747[/C][C]0.0376[/C][C]0.0386[/C][C]72.6924[/C][C]26.1034[/C][C]5.1092[/C][C]1.083[/C][C]0.5389[/C][/ROW]
[ROW][C]205[/C][C]0.0629[/C][C]0.0018[/C][C]0.0304[/C][C]0.0313[/C][C]0.0383[/C][C]20.8904[/C][C]4.5706[/C][C]0.0249[/C][C]0.4361[/C][/ROW]
[ROW][C]206[/C][C]0.0646[/C][C]0.0198[/C][C]0.0287[/C][C]0.0294[/C][C]4.6775[/C][C]18.1883[/C][C]4.2648[/C][C]0.2747[/C][C]0.4092[/C][/ROW]
[ROW][C]207[/C][C]0.0658[/C][C]0.1408[/C][C]0.0447[/C][C]0.0468[/C][C]305.6562[/C][C]59.2551[/C][C]7.6977[/C][C]2.2207[/C][C]0.668[/C][/ROW]
[ROW][C]208[/C][C]0.067[/C][C]-0.0175[/C][C]0.0413[/C][C]0.0431[/C][C]3.354[/C][C]52.2675[/C][C]7.2296[/C][C]-0.2326[/C][C]0.6136[/C][/ROW]
[ROW][C]209[/C][C]0.0683[/C][C]0.0472[/C][C]0.0419[/C][C]0.0437[/C][C]27.9291[/C][C]49.5632[/C][C]7.0401[/C][C]0.6713[/C][C]0.62[/C][/ROW]
[ROW][C]210[/C][C]0.0697[/C][C]0.1034[/C][C]0.0481[/C][C]0.0502[/C][C]151.2782[/C][C]59.7347[/C][C]7.7288[/C][C]1.5623[/C][C]0.7142[/C][/ROW]
[ROW][C]211[/C][C]0.0709[/C][C]-0.0368[/C][C]0.0471[/C][C]0.049[/C][C]14.3307[/C][C]55.6071[/C][C]7.457[/C][C]-0.4808[/C][C]0.693[/C][/ROW]
[ROW][C]212[/C][C]0.0721[/C][C]-0.0033[/C][C]0.0434[/C][C]0.0452[/C][C]0.1232[/C][C]50.9834[/C][C]7.1403[/C][C]-0.0446[/C][C]0.639[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=314316&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314316&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.05610.0350.0350.035615.7521000.50410.5041
2020.05790.00470.01980.02010.26348.00782.82980.06520.2847
2030.05960.0360.02520.025715.705910.57383.25170.50340.3576
2040.06060.07470.03760.038672.692426.10345.10921.0830.5389
2050.06290.00180.03040.03130.038320.89044.57060.02490.4361
2060.06460.01980.02870.02944.677518.18834.26480.27470.4092
2070.06580.14080.04470.0468305.656259.25517.69772.22070.668
2080.067-0.01750.04130.04313.35452.26757.2296-0.23260.6136
2090.06830.04720.04190.043727.929149.56327.04010.67130.62
2100.06970.10340.04810.0502151.278259.73477.72881.56230.7142
2110.0709-0.03680.04710.04914.330755.60717.457-0.48080.693
2120.0721-0.00330.04340.04520.123250.98347.1403-0.04460.639



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