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, 31 Jan 2018 20:27:07 +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/Jan/31/t15174268611ovzq0umqenx9db.htm/, Retrieved Mon, 06 May 2024 17:20:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=313117, Retrieved Mon, 06 May 2024 17:20:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact67
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-01-31 19:27:07] [35c2fdc9317f6a3f613a5f776b9bd76b] [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=313117&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=313117&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313117&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.5110.112195.3497127.98920.35520.8160.8160.816
202109.5104.832289.3428124.0020.31660.18770.18770.6178
203110103.347987.9089122.50560.24810.26450.26450.5589
204114.2107.425589.2152130.77880.28480.41450.41450.6786
205106.9106.808987.1164132.70290.49720.28790.28790.6449
206109.2105.357685.3976131.83260.3880.45450.45450.601
207124.2106.912685.5874135.69410.11950.43810.43810.6336
208104.7107.499284.8402138.69840.43020.1470.1470.6375
209111.9106.880883.6102139.32380.38090.55240.55240.6183
210119107.384183.1959141.57060.25270.39790.39790.6234
211102.9108.017982.7485144.30950.39110.27660.27660.6295
212106.3107.968781.9384145.85670.46560.60340.60340.6232

\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 & 110.1121 & 95.3497 & 127.9892 & 0.3552 & 0.816 & 0.816 & 0.816 \tabularnewline
202 & 109.5 & 104.8322 & 89.3428 & 124.002 & 0.3166 & 0.1877 & 0.1877 & 0.6178 \tabularnewline
203 & 110 & 103.3479 & 87.9089 & 122.5056 & 0.2481 & 0.2645 & 0.2645 & 0.5589 \tabularnewline
204 & 114.2 & 107.4255 & 89.2152 & 130.7788 & 0.2848 & 0.4145 & 0.4145 & 0.6786 \tabularnewline
205 & 106.9 & 106.8089 & 87.1164 & 132.7029 & 0.4972 & 0.2879 & 0.2879 & 0.6449 \tabularnewline
206 & 109.2 & 105.3576 & 85.3976 & 131.8326 & 0.388 & 0.4545 & 0.4545 & 0.601 \tabularnewline
207 & 124.2 & 106.9126 & 85.5874 & 135.6941 & 0.1195 & 0.4381 & 0.4381 & 0.6336 \tabularnewline
208 & 104.7 & 107.4992 & 84.8402 & 138.6984 & 0.4302 & 0.147 & 0.147 & 0.6375 \tabularnewline
209 & 111.9 & 106.8808 & 83.6102 & 139.3238 & 0.3809 & 0.5524 & 0.5524 & 0.6183 \tabularnewline
210 & 119 & 107.3841 & 83.1959 & 141.5706 & 0.2527 & 0.3979 & 0.3979 & 0.6234 \tabularnewline
211 & 102.9 & 108.0179 & 82.7485 & 144.3095 & 0.3911 & 0.2766 & 0.2766 & 0.6295 \tabularnewline
212 & 106.3 & 107.9687 & 81.9384 & 145.8567 & 0.4656 & 0.6034 & 0.6034 & 0.6232 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=313117&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]110.1121[/C][C]95.3497[/C][C]127.9892[/C][C]0.3552[/C][C]0.816[/C][C]0.816[/C][C]0.816[/C][/ROW]
[ROW][C]202[/C][C]109.5[/C][C]104.8322[/C][C]89.3428[/C][C]124.002[/C][C]0.3166[/C][C]0.1877[/C][C]0.1877[/C][C]0.6178[/C][/ROW]
[ROW][C]203[/C][C]110[/C][C]103.3479[/C][C]87.9089[/C][C]122.5056[/C][C]0.2481[/C][C]0.2645[/C][C]0.2645[/C][C]0.5589[/C][/ROW]
[ROW][C]204[/C][C]114.2[/C][C]107.4255[/C][C]89.2152[/C][C]130.7788[/C][C]0.2848[/C][C]0.4145[/C][C]0.4145[/C][C]0.6786[/C][/ROW]
[ROW][C]205[/C][C]106.9[/C][C]106.8089[/C][C]87.1164[/C][C]132.7029[/C][C]0.4972[/C][C]0.2879[/C][C]0.2879[/C][C]0.6449[/C][/ROW]
[ROW][C]206[/C][C]109.2[/C][C]105.3576[/C][C]85.3976[/C][C]131.8326[/C][C]0.388[/C][C]0.4545[/C][C]0.4545[/C][C]0.601[/C][/ROW]
[ROW][C]207[/C][C]124.2[/C][C]106.9126[/C][C]85.5874[/C][C]135.6941[/C][C]0.1195[/C][C]0.4381[/C][C]0.4381[/C][C]0.6336[/C][/ROW]
[ROW][C]208[/C][C]104.7[/C][C]107.4992[/C][C]84.8402[/C][C]138.6984[/C][C]0.4302[/C][C]0.147[/C][C]0.147[/C][C]0.6375[/C][/ROW]
[ROW][C]209[/C][C]111.9[/C][C]106.8808[/C][C]83.6102[/C][C]139.3238[/C][C]0.3809[/C][C]0.5524[/C][C]0.5524[/C][C]0.6183[/C][/ROW]
[ROW][C]210[/C][C]119[/C][C]107.3841[/C][C]83.1959[/C][C]141.5706[/C][C]0.2527[/C][C]0.3979[/C][C]0.3979[/C][C]0.6234[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]108.0179[/C][C]82.7485[/C][C]144.3095[/C][C]0.3911[/C][C]0.2766[/C][C]0.2766[/C][C]0.6295[/C][/ROW]
[ROW][C]212[/C][C]106.3[/C][C]107.9687[/C][C]81.9384[/C][C]145.8567[/C][C]0.4656[/C][C]0.6034[/C][C]0.6034[/C][C]0.6232[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=313117&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313117&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.5110.112195.3497127.98920.35520.8160.8160.816
202109.5104.832289.3428124.0020.31660.18770.18770.6178
203110103.347987.9089122.50560.24810.26450.26450.5589
204114.2107.425589.2152130.77880.28480.41450.41450.6786
205106.9106.808987.1164132.70290.49720.28790.28790.6449
206109.2105.357685.3976131.83260.3880.45450.45450.601
207124.2106.912685.5874135.69410.11950.43810.43810.6336
208104.7107.499284.8402138.69840.43020.1470.1470.6375
209111.9106.880883.6102139.32380.38090.55240.55240.6183
210119107.384183.1959141.57060.25270.39790.39790.6234
211102.9108.017982.7485144.30950.39110.27660.27660.6295
212106.3107.968781.9384145.85670.46560.60340.60340.6232







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.08280.02980.02980.030311.4777000.43030.4303
2020.09330.04260.03620.036921.788816.63324.07840.59290.5116
2030.09460.06050.04430.045444.250825.83915.08320.8450.6227
2040.11090.05930.04810.049345.894230.85295.55450.86050.6822
2050.12379e-040.03860.03960.008324.68394.96830.01160.5481
2060.12820.03520.03810.03914.764423.03074.7990.48810.5381
2070.13730.13920.05250.0548298.853462.43397.90152.19590.7749
2080.1481-0.02670.04930.05137.835555.60917.4572-0.35560.7225
2090.15490.04490.04880.050725.19252.22947.2270.63750.713
2100.16240.09760.05370.0559134.929860.49957.77811.47550.7893
2110.1714-0.04970.05330.055226.193357.38077.575-0.65010.7766
2120.179-0.01570.05020.05192.784652.83117.2685-0.2120.7296

\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.0828 & 0.0298 & 0.0298 & 0.0303 & 11.4777 & 0 & 0 & 0.4303 & 0.4303 \tabularnewline
202 & 0.0933 & 0.0426 & 0.0362 & 0.0369 & 21.7888 & 16.6332 & 4.0784 & 0.5929 & 0.5116 \tabularnewline
203 & 0.0946 & 0.0605 & 0.0443 & 0.0454 & 44.2508 & 25.8391 & 5.0832 & 0.845 & 0.6227 \tabularnewline
204 & 0.1109 & 0.0593 & 0.0481 & 0.0493 & 45.8942 & 30.8529 & 5.5545 & 0.8605 & 0.6822 \tabularnewline
205 & 0.1237 & 9e-04 & 0.0386 & 0.0396 & 0.0083 & 24.6839 & 4.9683 & 0.0116 & 0.5481 \tabularnewline
206 & 0.1282 & 0.0352 & 0.0381 & 0.039 & 14.7644 & 23.0307 & 4.799 & 0.4881 & 0.5381 \tabularnewline
207 & 0.1373 & 0.1392 & 0.0525 & 0.0548 & 298.8534 & 62.4339 & 7.9015 & 2.1959 & 0.7749 \tabularnewline
208 & 0.1481 & -0.0267 & 0.0493 & 0.0513 & 7.8355 & 55.6091 & 7.4572 & -0.3556 & 0.7225 \tabularnewline
209 & 0.1549 & 0.0449 & 0.0488 & 0.0507 & 25.192 & 52.2294 & 7.227 & 0.6375 & 0.713 \tabularnewline
210 & 0.1624 & 0.0976 & 0.0537 & 0.0559 & 134.9298 & 60.4995 & 7.7781 & 1.4755 & 0.7893 \tabularnewline
211 & 0.1714 & -0.0497 & 0.0533 & 0.0552 & 26.1933 & 57.3807 & 7.575 & -0.6501 & 0.7766 \tabularnewline
212 & 0.179 & -0.0157 & 0.0502 & 0.0519 & 2.7846 & 52.8311 & 7.2685 & -0.212 & 0.7296 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=313117&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.0828[/C][C]0.0298[/C][C]0.0298[/C][C]0.0303[/C][C]11.4777[/C][C]0[/C][C]0[/C][C]0.4303[/C][C]0.4303[/C][/ROW]
[ROW][C]202[/C][C]0.0933[/C][C]0.0426[/C][C]0.0362[/C][C]0.0369[/C][C]21.7888[/C][C]16.6332[/C][C]4.0784[/C][C]0.5929[/C][C]0.5116[/C][/ROW]
[ROW][C]203[/C][C]0.0946[/C][C]0.0605[/C][C]0.0443[/C][C]0.0454[/C][C]44.2508[/C][C]25.8391[/C][C]5.0832[/C][C]0.845[/C][C]0.6227[/C][/ROW]
[ROW][C]204[/C][C]0.1109[/C][C]0.0593[/C][C]0.0481[/C][C]0.0493[/C][C]45.8942[/C][C]30.8529[/C][C]5.5545[/C][C]0.8605[/C][C]0.6822[/C][/ROW]
[ROW][C]205[/C][C]0.1237[/C][C]9e-04[/C][C]0.0386[/C][C]0.0396[/C][C]0.0083[/C][C]24.6839[/C][C]4.9683[/C][C]0.0116[/C][C]0.5481[/C][/ROW]
[ROW][C]206[/C][C]0.1282[/C][C]0.0352[/C][C]0.0381[/C][C]0.039[/C][C]14.7644[/C][C]23.0307[/C][C]4.799[/C][C]0.4881[/C][C]0.5381[/C][/ROW]
[ROW][C]207[/C][C]0.1373[/C][C]0.1392[/C][C]0.0525[/C][C]0.0548[/C][C]298.8534[/C][C]62.4339[/C][C]7.9015[/C][C]2.1959[/C][C]0.7749[/C][/ROW]
[ROW][C]208[/C][C]0.1481[/C][C]-0.0267[/C][C]0.0493[/C][C]0.0513[/C][C]7.8355[/C][C]55.6091[/C][C]7.4572[/C][C]-0.3556[/C][C]0.7225[/C][/ROW]
[ROW][C]209[/C][C]0.1549[/C][C]0.0449[/C][C]0.0488[/C][C]0.0507[/C][C]25.192[/C][C]52.2294[/C][C]7.227[/C][C]0.6375[/C][C]0.713[/C][/ROW]
[ROW][C]210[/C][C]0.1624[/C][C]0.0976[/C][C]0.0537[/C][C]0.0559[/C][C]134.9298[/C][C]60.4995[/C][C]7.7781[/C][C]1.4755[/C][C]0.7893[/C][/ROW]
[ROW][C]211[/C][C]0.1714[/C][C]-0.0497[/C][C]0.0533[/C][C]0.0552[/C][C]26.1933[/C][C]57.3807[/C][C]7.575[/C][C]-0.6501[/C][C]0.7766[/C][/ROW]
[ROW][C]212[/C][C]0.179[/C][C]-0.0157[/C][C]0.0502[/C][C]0.0519[/C][C]2.7846[/C][C]52.8311[/C][C]7.2685[/C][C]-0.212[/C][C]0.7296[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=313117&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=313117&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.08280.02980.02980.030311.4777000.43030.4303
2020.09330.04260.03620.036921.788816.63324.07840.59290.5116
2030.09460.06050.04430.045444.250825.83915.08320.8450.6227
2040.11090.05930.04810.049345.894230.85295.55450.86050.6822
2050.12379e-040.03860.03960.008324.68394.96830.01160.5481
2060.12820.03520.03810.03914.764423.03074.7990.48810.5381
2070.13730.13920.05250.0548298.853462.43397.90152.19590.7749
2080.1481-0.02670.04930.05137.835555.60917.4572-0.35560.7225
2090.15490.04490.04880.050725.19252.22947.2270.63750.713
2100.16240.09760.05370.0559134.929860.49957.77811.47550.7893
2110.1714-0.04970.05330.055226.193357.38077.575-0.65010.7766
2120.179-0.01570.05020.05192.784652.83117.2685-0.2120.7296



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