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, 21 Dec 2017 15:02:55 +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/21/t1513864993h3wfcq76np5ykwe.htm/, Retrieved Tue, 14 May 2024 09:38:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310644, Retrieved Tue, 14 May 2024 09:38:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact69
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2017-12-21 14:02:55] [71733e7e3fc4cdee2971288e32d35d04] [Current]
Feedback Forum

Post a new message
Dataseries X:
57,7
60,1
66,5
63,4
71,4
68,5
61,6
68,3
69,3
76,1
73,3
69,7
67,4
63,7
73
67,5
74,4
72,9
71,7
75,6
72,5
80
75,4
71
70,6
67,5
74,1
73,2
74
73
74
73
76
81,7
73,5
77
73,6
70,4
74,7
76,8
72,7
76
77,5
73,6
78,5
84,3
74,4
78,5
72,7
71,3
84,4
79,1
76,2
84,9
77,1
78,7
84,7
83,7
82,5
85,2
76
72,2
83,2
80,2
81,1
86
76
83,9
87,9
85
88,1
87,4
79,5
75,2
87,3
79,5
87,6
89,1
83
88,3
88,9
93,9
91,7
87,2
87,8
81
93,7
87,5
91,4
93,8
89,5
93,3
92,8
104,1
99,9
93,4
99
93,2
95,7
102,6
98,8
98
101,5
94,9
104,7
108,4
97
102,3
90,8
89,6
99,9
99,2
94
103
99,8
94,9
102
103,2
98
101,1
88,2
90,3
105,5
99,4
94,3
105,9
98
99
103,9
104,3
105,7
105,5
97,4
95,4
110,5
102,8
110
104,3
96,5
105,6
111,3
108,5
109,1
107,7
102,3
102,4
110,8
101,7
108,9
111,5
104
109,9
106,8
118,4
111,8
105
104,9
96,5
106,3
105,6
109,3
105,1
111,5
103,1
106,5
114,4
104,7
105,5
100,5
96,4
105,1
108,4
105,7
109
107,2
101,6
112,7
115,9
105
110,4
100,9
98,5
111,3
109,6
103,4
115,7
110,4
105,2
113,2
117,4
112,3
113,9
102,2
106,9
118
113,8
114,9
118,8
106,3
114,2
117,3
114,7
117
116,6
106,5
105,7
121
107,8
119,7
121
108,8
115




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310644&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])
199106.3-------
200114.2-------
201117.3115.0295106.2471123.81190.30620.57340.57340.5734
202114.7111.0197101.7771120.26220.21760.09150.09150.25
203117117.1886107.9241126.45320.48410.70070.70070.7364
204116.6114.2269104.6104123.84350.31430.2860.2860.5022
205106.5113.2544103.5885122.92040.08540.24880.24880.424
206105.7116.4377106.6446126.23080.01580.97660.97660.6729
207121113.9081103.6744124.14180.08720.9420.9420.4777
208107.8115.1963104.8859125.50680.07990.1350.1350.5751
209119.7116.4883105.7821127.19460.27830.94410.94410.6624
210121114.9786104.0575125.89980.13990.19840.19840.5556
211108.8116.4447105.4315127.45780.08680.20880.20880.6552
212115116.4885105.1678127.80920.39830.90840.90840.654

\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 & 106.3 & - & - & - & - & - & - & - \tabularnewline
200 & 114.2 & - & - & - & - & - & - & - \tabularnewline
201 & 117.3 & 115.0295 & 106.2471 & 123.8119 & 0.3062 & 0.5734 & 0.5734 & 0.5734 \tabularnewline
202 & 114.7 & 111.0197 & 101.7771 & 120.2622 & 0.2176 & 0.0915 & 0.0915 & 0.25 \tabularnewline
203 & 117 & 117.1886 & 107.9241 & 126.4532 & 0.4841 & 0.7007 & 0.7007 & 0.7364 \tabularnewline
204 & 116.6 & 114.2269 & 104.6104 & 123.8435 & 0.3143 & 0.286 & 0.286 & 0.5022 \tabularnewline
205 & 106.5 & 113.2544 & 103.5885 & 122.9204 & 0.0854 & 0.2488 & 0.2488 & 0.424 \tabularnewline
206 & 105.7 & 116.4377 & 106.6446 & 126.2308 & 0.0158 & 0.9766 & 0.9766 & 0.6729 \tabularnewline
207 & 121 & 113.9081 & 103.6744 & 124.1418 & 0.0872 & 0.942 & 0.942 & 0.4777 \tabularnewline
208 & 107.8 & 115.1963 & 104.8859 & 125.5068 & 0.0799 & 0.135 & 0.135 & 0.5751 \tabularnewline
209 & 119.7 & 116.4883 & 105.7821 & 127.1946 & 0.2783 & 0.9441 & 0.9441 & 0.6624 \tabularnewline
210 & 121 & 114.9786 & 104.0575 & 125.8998 & 0.1399 & 0.1984 & 0.1984 & 0.5556 \tabularnewline
211 & 108.8 & 116.4447 & 105.4315 & 127.4578 & 0.0868 & 0.2088 & 0.2088 & 0.6552 \tabularnewline
212 & 115 & 116.4885 & 105.1678 & 127.8092 & 0.3983 & 0.9084 & 0.9084 & 0.654 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310644&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]106.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]114.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]117.3[/C][C]115.0295[/C][C]106.2471[/C][C]123.8119[/C][C]0.3062[/C][C]0.5734[/C][C]0.5734[/C][C]0.5734[/C][/ROW]
[ROW][C]202[/C][C]114.7[/C][C]111.0197[/C][C]101.7771[/C][C]120.2622[/C][C]0.2176[/C][C]0.0915[/C][C]0.0915[/C][C]0.25[/C][/ROW]
[ROW][C]203[/C][C]117[/C][C]117.1886[/C][C]107.9241[/C][C]126.4532[/C][C]0.4841[/C][C]0.7007[/C][C]0.7007[/C][C]0.7364[/C][/ROW]
[ROW][C]204[/C][C]116.6[/C][C]114.2269[/C][C]104.6104[/C][C]123.8435[/C][C]0.3143[/C][C]0.286[/C][C]0.286[/C][C]0.5022[/C][/ROW]
[ROW][C]205[/C][C]106.5[/C][C]113.2544[/C][C]103.5885[/C][C]122.9204[/C][C]0.0854[/C][C]0.2488[/C][C]0.2488[/C][C]0.424[/C][/ROW]
[ROW][C]206[/C][C]105.7[/C][C]116.4377[/C][C]106.6446[/C][C]126.2308[/C][C]0.0158[/C][C]0.9766[/C][C]0.9766[/C][C]0.6729[/C][/ROW]
[ROW][C]207[/C][C]121[/C][C]113.9081[/C][C]103.6744[/C][C]124.1418[/C][C]0.0872[/C][C]0.942[/C][C]0.942[/C][C]0.4777[/C][/ROW]
[ROW][C]208[/C][C]107.8[/C][C]115.1963[/C][C]104.8859[/C][C]125.5068[/C][C]0.0799[/C][C]0.135[/C][C]0.135[/C][C]0.5751[/C][/ROW]
[ROW][C]209[/C][C]119.7[/C][C]116.4883[/C][C]105.7821[/C][C]127.1946[/C][C]0.2783[/C][C]0.9441[/C][C]0.9441[/C][C]0.6624[/C][/ROW]
[ROW][C]210[/C][C]121[/C][C]114.9786[/C][C]104.0575[/C][C]125.8998[/C][C]0.1399[/C][C]0.1984[/C][C]0.1984[/C][C]0.5556[/C][/ROW]
[ROW][C]211[/C][C]108.8[/C][C]116.4447[/C][C]105.4315[/C][C]127.4578[/C][C]0.0868[/C][C]0.2088[/C][C]0.2088[/C][C]0.6552[/C][/ROW]
[ROW][C]212[/C][C]115[/C][C]116.4885[/C][C]105.1678[/C][C]127.8092[/C][C]0.3983[/C][C]0.9084[/C][C]0.9084[/C][C]0.654[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310644&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310644&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])
199106.3-------
200114.2-------
201117.3115.0295106.2471123.81190.30620.57340.57340.5734
202114.7111.0197101.7771120.26220.21760.09150.09150.25
203117117.1886107.9241126.45320.48410.70070.70070.7364
204116.6114.2269104.6104123.84350.31430.2860.2860.5022
205106.5113.2544103.5885122.92040.08540.24880.24880.424
206105.7116.4377106.6446126.23080.01580.97660.97660.6729
207121113.9081103.6744124.14180.08720.9420.9420.4777
208107.8115.1963104.8859125.50680.07990.1350.1350.5751
209119.7116.4883105.7821127.19460.27830.94410.94410.6624
210121114.9786104.0575125.89980.13990.19840.19840.5556
211108.8116.4447105.4315127.45780.08680.20880.20880.6552
212115116.4885105.1678127.80920.39830.90840.90840.654







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0390.01940.01940.01955.1551000.32730.3273
2020.04250.03210.02570.026113.54499.353.05780.53060.429
2030.0403-0.00160.01770.01790.03566.24522.499-0.02720.295
2040.0430.02040.01840.01865.63156.09182.46820.34210.3068
2050.0435-0.06340.02740.027245.622213.99793.7414-0.97380.4402
2060.0429-0.10160.03970.0387115.298830.88135.5571-1.5480.6248
2070.04580.05860.04240.041850.295333.65485.80131.02240.6816
2080.0457-0.06860.04570.044954.705636.28616.0238-1.06630.7297
2090.04690.02680.04360.042910.31533.40045.77930.4630.7001
2100.04850.04980.04420.043736.256733.68615.8040.86810.7169
2110.0483-0.07030.04660.045958.441135.93655.9947-1.10210.7519
2120.0496-0.01290.04380.04322.215533.12645.7556-0.21460.7071

\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.039 & 0.0194 & 0.0194 & 0.0195 & 5.1551 & 0 & 0 & 0.3273 & 0.3273 \tabularnewline
202 & 0.0425 & 0.0321 & 0.0257 & 0.0261 & 13.5449 & 9.35 & 3.0578 & 0.5306 & 0.429 \tabularnewline
203 & 0.0403 & -0.0016 & 0.0177 & 0.0179 & 0.0356 & 6.2452 & 2.499 & -0.0272 & 0.295 \tabularnewline
204 & 0.043 & 0.0204 & 0.0184 & 0.0186 & 5.6315 & 6.0918 & 2.4682 & 0.3421 & 0.3068 \tabularnewline
205 & 0.0435 & -0.0634 & 0.0274 & 0.0272 & 45.6222 & 13.9979 & 3.7414 & -0.9738 & 0.4402 \tabularnewline
206 & 0.0429 & -0.1016 & 0.0397 & 0.0387 & 115.2988 & 30.8813 & 5.5571 & -1.548 & 0.6248 \tabularnewline
207 & 0.0458 & 0.0586 & 0.0424 & 0.0418 & 50.2953 & 33.6548 & 5.8013 & 1.0224 & 0.6816 \tabularnewline
208 & 0.0457 & -0.0686 & 0.0457 & 0.0449 & 54.7056 & 36.2861 & 6.0238 & -1.0663 & 0.7297 \tabularnewline
209 & 0.0469 & 0.0268 & 0.0436 & 0.0429 & 10.315 & 33.4004 & 5.7793 & 0.463 & 0.7001 \tabularnewline
210 & 0.0485 & 0.0498 & 0.0442 & 0.0437 & 36.2567 & 33.6861 & 5.804 & 0.8681 & 0.7169 \tabularnewline
211 & 0.0483 & -0.0703 & 0.0466 & 0.0459 & 58.4411 & 35.9365 & 5.9947 & -1.1021 & 0.7519 \tabularnewline
212 & 0.0496 & -0.0129 & 0.0438 & 0.0432 & 2.2155 & 33.1264 & 5.7556 & -0.2146 & 0.7071 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310644&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.039[/C][C]0.0194[/C][C]0.0194[/C][C]0.0195[/C][C]5.1551[/C][C]0[/C][C]0[/C][C]0.3273[/C][C]0.3273[/C][/ROW]
[ROW][C]202[/C][C]0.0425[/C][C]0.0321[/C][C]0.0257[/C][C]0.0261[/C][C]13.5449[/C][C]9.35[/C][C]3.0578[/C][C]0.5306[/C][C]0.429[/C][/ROW]
[ROW][C]203[/C][C]0.0403[/C][C]-0.0016[/C][C]0.0177[/C][C]0.0179[/C][C]0.0356[/C][C]6.2452[/C][C]2.499[/C][C]-0.0272[/C][C]0.295[/C][/ROW]
[ROW][C]204[/C][C]0.043[/C][C]0.0204[/C][C]0.0184[/C][C]0.0186[/C][C]5.6315[/C][C]6.0918[/C][C]2.4682[/C][C]0.3421[/C][C]0.3068[/C][/ROW]
[ROW][C]205[/C][C]0.0435[/C][C]-0.0634[/C][C]0.0274[/C][C]0.0272[/C][C]45.6222[/C][C]13.9979[/C][C]3.7414[/C][C]-0.9738[/C][C]0.4402[/C][/ROW]
[ROW][C]206[/C][C]0.0429[/C][C]-0.1016[/C][C]0.0397[/C][C]0.0387[/C][C]115.2988[/C][C]30.8813[/C][C]5.5571[/C][C]-1.548[/C][C]0.6248[/C][/ROW]
[ROW][C]207[/C][C]0.0458[/C][C]0.0586[/C][C]0.0424[/C][C]0.0418[/C][C]50.2953[/C][C]33.6548[/C][C]5.8013[/C][C]1.0224[/C][C]0.6816[/C][/ROW]
[ROW][C]208[/C][C]0.0457[/C][C]-0.0686[/C][C]0.0457[/C][C]0.0449[/C][C]54.7056[/C][C]36.2861[/C][C]6.0238[/C][C]-1.0663[/C][C]0.7297[/C][/ROW]
[ROW][C]209[/C][C]0.0469[/C][C]0.0268[/C][C]0.0436[/C][C]0.0429[/C][C]10.315[/C][C]33.4004[/C][C]5.7793[/C][C]0.463[/C][C]0.7001[/C][/ROW]
[ROW][C]210[/C][C]0.0485[/C][C]0.0498[/C][C]0.0442[/C][C]0.0437[/C][C]36.2567[/C][C]33.6861[/C][C]5.804[/C][C]0.8681[/C][C]0.7169[/C][/ROW]
[ROW][C]211[/C][C]0.0483[/C][C]-0.0703[/C][C]0.0466[/C][C]0.0459[/C][C]58.4411[/C][C]35.9365[/C][C]5.9947[/C][C]-1.1021[/C][C]0.7519[/C][/ROW]
[ROW][C]212[/C][C]0.0496[/C][C]-0.0129[/C][C]0.0438[/C][C]0.0432[/C][C]2.2155[/C][C]33.1264[/C][C]5.7556[/C][C]-0.2146[/C][C]0.7071[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310644&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310644&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.0390.01940.01940.01955.1551000.32730.3273
2020.04250.03210.02570.026113.54499.353.05780.53060.429
2030.0403-0.00160.01770.01790.03566.24522.499-0.02720.295
2040.0430.02040.01840.01865.63156.09182.46820.34210.3068
2050.0435-0.06340.02740.027245.622213.99793.7414-0.97380.4402
2060.0429-0.10160.03970.0387115.298830.88135.5571-1.5480.6248
2070.04580.05860.04240.041850.295333.65485.80131.02240.6816
2080.0457-0.06860.04570.044954.705636.28616.0238-1.06630.7297
2090.04690.02680.04360.042910.31533.40045.77930.4630.7001
2100.04850.04980.04420.043736.256733.68615.8040.86810.7169
2110.0483-0.07030.04660.045958.441135.93655.9947-1.10210.7519
2120.0496-0.01290.04380.04322.215533.12645.7556-0.21460.7071



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