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 computationMon, 18 Dec 2017 12:07: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/18/t1513595444jvh1os2lcxsfpdk.htm/, Retrieved Tue, 14 May 2024 17:08:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310132, Retrieved Tue, 14 May 2024 17:08:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact75
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Dataset 3: ARIMA ...] [2017-12-18 11:07:55] [d2f3f1c36efc482093437f9590ab82ed] [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 time1 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 time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310132&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]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=310132&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310132&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 time1 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.205196.5703125.13340.33270.86220.86220.8622
202109.5104.809890.0971121.12710.28660.14830.14830.6367
203110103.286788.5075119.71240.21150.22920.22920.5657
204114.2107.450890.2217126.86050.24780.39840.39840.7124
205106.9106.711787.9602128.09660.49310.24630.24630.6704
206109.2105.203586.0448127.16530.36070.43980.43980.6159
207124.2106.806686.4099130.35570.07390.42110.42110.6585
208104.7107.320185.6354132.58350.41950.09520.09520.6629
209111.9106.631384.261132.85990.34690.55740.55740.6382
210119107.142483.8836134.57780.19850.3670.3670.646
211102.9107.735983.4408136.59560.37130.22210.22210.6541
212106.3107.620782.5409137.60140.46560.62120.62120.6458

\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.2051 & 96.5703 & 125.1334 & 0.3327 & 0.8622 & 0.8622 & 0.8622 \tabularnewline
202 & 109.5 & 104.8098 & 90.0971 & 121.1271 & 0.2866 & 0.1483 & 0.1483 & 0.6367 \tabularnewline
203 & 110 & 103.2867 & 88.5075 & 119.7124 & 0.2115 & 0.2292 & 0.2292 & 0.5657 \tabularnewline
204 & 114.2 & 107.4508 & 90.2217 & 126.8605 & 0.2478 & 0.3984 & 0.3984 & 0.7124 \tabularnewline
205 & 106.9 & 106.7117 & 87.9602 & 128.0966 & 0.4931 & 0.2463 & 0.2463 & 0.6704 \tabularnewline
206 & 109.2 & 105.2035 & 86.0448 & 127.1653 & 0.3607 & 0.4398 & 0.4398 & 0.6159 \tabularnewline
207 & 124.2 & 106.8066 & 86.4099 & 130.3557 & 0.0739 & 0.4211 & 0.4211 & 0.6585 \tabularnewline
208 & 104.7 & 107.3201 & 85.6354 & 132.5835 & 0.4195 & 0.0952 & 0.0952 & 0.6629 \tabularnewline
209 & 111.9 & 106.6313 & 84.261 & 132.8599 & 0.3469 & 0.5574 & 0.5574 & 0.6382 \tabularnewline
210 & 119 & 107.1424 & 83.8836 & 134.5778 & 0.1985 & 0.367 & 0.367 & 0.646 \tabularnewline
211 & 102.9 & 107.7359 & 83.4408 & 136.5956 & 0.3713 & 0.2221 & 0.2221 & 0.6541 \tabularnewline
212 & 106.3 & 107.6207 & 82.5409 & 137.6014 & 0.4656 & 0.6212 & 0.6212 & 0.6458 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310132&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.2051[/C][C]96.5703[/C][C]125.1334[/C][C]0.3327[/C][C]0.8622[/C][C]0.8622[/C][C]0.8622[/C][/ROW]
[ROW][C]202[/C][C]109.5[/C][C]104.8098[/C][C]90.0971[/C][C]121.1271[/C][C]0.2866[/C][C]0.1483[/C][C]0.1483[/C][C]0.6367[/C][/ROW]
[ROW][C]203[/C][C]110[/C][C]103.2867[/C][C]88.5075[/C][C]119.7124[/C][C]0.2115[/C][C]0.2292[/C][C]0.2292[/C][C]0.5657[/C][/ROW]
[ROW][C]204[/C][C]114.2[/C][C]107.4508[/C][C]90.2217[/C][C]126.8605[/C][C]0.2478[/C][C]0.3984[/C][C]0.3984[/C][C]0.7124[/C][/ROW]
[ROW][C]205[/C][C]106.9[/C][C]106.7117[/C][C]87.9602[/C][C]128.0966[/C][C]0.4931[/C][C]0.2463[/C][C]0.2463[/C][C]0.6704[/C][/ROW]
[ROW][C]206[/C][C]109.2[/C][C]105.2035[/C][C]86.0448[/C][C]127.1653[/C][C]0.3607[/C][C]0.4398[/C][C]0.4398[/C][C]0.6159[/C][/ROW]
[ROW][C]207[/C][C]124.2[/C][C]106.8066[/C][C]86.4099[/C][C]130.3557[/C][C]0.0739[/C][C]0.4211[/C][C]0.4211[/C][C]0.6585[/C][/ROW]
[ROW][C]208[/C][C]104.7[/C][C]107.3201[/C][C]85.6354[/C][C]132.5835[/C][C]0.4195[/C][C]0.0952[/C][C]0.0952[/C][C]0.6629[/C][/ROW]
[ROW][C]209[/C][C]111.9[/C][C]106.6313[/C][C]84.261[/C][C]132.8599[/C][C]0.3469[/C][C]0.5574[/C][C]0.5574[/C][C]0.6382[/C][/ROW]
[ROW][C]210[/C][C]119[/C][C]107.1424[/C][C]83.8836[/C][C]134.5778[/C][C]0.1985[/C][C]0.367[/C][C]0.367[/C][C]0.646[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]107.7359[/C][C]83.4408[/C][C]136.5956[/C][C]0.3713[/C][C]0.2221[/C][C]0.2221[/C][C]0.6541[/C][/ROW]
[ROW][C]212[/C][C]106.3[/C][C]107.6207[/C][C]82.5409[/C][C]137.6014[/C][C]0.4656[/C][C]0.6212[/C][C]0.6212[/C][C]0.6458[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310132&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310132&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.205196.5703125.13340.33270.86220.86220.8622
202109.5104.809890.0971121.12710.28660.14830.14830.6367
203110103.286788.5075119.71240.21150.22920.22920.5657
204114.2107.450890.2217126.86050.24780.39840.39840.7124
205106.9106.711787.9602128.09660.49310.24630.24630.6704
206109.2105.203586.0448127.16530.36070.43980.43980.6159
207124.2106.806686.4099130.35570.07390.42110.42110.6585
208104.7107.320185.6354132.58350.41950.09520.09520.6629
209111.9106.631384.261132.85990.34690.55740.55740.6382
210119107.142483.8836134.57780.19850.3670.3670.646
211102.9107.735983.4408136.59560.37130.22210.22210.6541
212106.3107.620782.5409137.60140.46560.62120.62120.6458







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.06910.0290.0290.029510.8565000.41850.4185
2020.07940.04280.03590.036621.997616.42714.0530.59570.5071
2030.08110.0610.04430.045445.068625.97425.09650.85270.6223
2040.09220.05910.0480.049345.552230.86875.5560.85730.6811
2050.10220.00180.03880.03980.035524.70214.97010.02390.5496
2060.10650.03660.03840.039415.972223.24714.82150.50760.5426
2070.11250.140.05290.0552302.528963.14457.94642.20930.7807
2080.1201-0.0250.04940.05146.864756.10957.4906-0.33280.7247
2090.12550.04710.04920.051127.759352.95957.27730.66920.7186
2100.13060.09960.05420.0565140.60261.72387.85641.50620.7973
2110.1367-0.0470.05360.055523.386258.23857.6314-0.61430.7807
2120.1421-0.01240.05010.05191.744253.53077.3165-0.16780.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.0691 & 0.029 & 0.029 & 0.0295 & 10.8565 & 0 & 0 & 0.4185 & 0.4185 \tabularnewline
202 & 0.0794 & 0.0428 & 0.0359 & 0.0366 & 21.9976 & 16.4271 & 4.053 & 0.5957 & 0.5071 \tabularnewline
203 & 0.0811 & 0.061 & 0.0443 & 0.0454 & 45.0686 & 25.9742 & 5.0965 & 0.8527 & 0.6223 \tabularnewline
204 & 0.0922 & 0.0591 & 0.048 & 0.0493 & 45.5522 & 30.8687 & 5.556 & 0.8573 & 0.6811 \tabularnewline
205 & 0.1022 & 0.0018 & 0.0388 & 0.0398 & 0.0355 & 24.7021 & 4.9701 & 0.0239 & 0.5496 \tabularnewline
206 & 0.1065 & 0.0366 & 0.0384 & 0.0394 & 15.9722 & 23.2471 & 4.8215 & 0.5076 & 0.5426 \tabularnewline
207 & 0.1125 & 0.14 & 0.0529 & 0.0552 & 302.5289 & 63.1445 & 7.9464 & 2.2093 & 0.7807 \tabularnewline
208 & 0.1201 & -0.025 & 0.0494 & 0.0514 & 6.8647 & 56.1095 & 7.4906 & -0.3328 & 0.7247 \tabularnewline
209 & 0.1255 & 0.0471 & 0.0492 & 0.0511 & 27.7593 & 52.9595 & 7.2773 & 0.6692 & 0.7186 \tabularnewline
210 & 0.1306 & 0.0996 & 0.0542 & 0.0565 & 140.602 & 61.7238 & 7.8564 & 1.5062 & 0.7973 \tabularnewline
211 & 0.1367 & -0.047 & 0.0536 & 0.0555 & 23.3862 & 58.2385 & 7.6314 & -0.6143 & 0.7807 \tabularnewline
212 & 0.1421 & -0.0124 & 0.0501 & 0.0519 & 1.7442 & 53.5307 & 7.3165 & -0.1678 & 0.7296 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310132&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.0691[/C][C]0.029[/C][C]0.029[/C][C]0.0295[/C][C]10.8565[/C][C]0[/C][C]0[/C][C]0.4185[/C][C]0.4185[/C][/ROW]
[ROW][C]202[/C][C]0.0794[/C][C]0.0428[/C][C]0.0359[/C][C]0.0366[/C][C]21.9976[/C][C]16.4271[/C][C]4.053[/C][C]0.5957[/C][C]0.5071[/C][/ROW]
[ROW][C]203[/C][C]0.0811[/C][C]0.061[/C][C]0.0443[/C][C]0.0454[/C][C]45.0686[/C][C]25.9742[/C][C]5.0965[/C][C]0.8527[/C][C]0.6223[/C][/ROW]
[ROW][C]204[/C][C]0.0922[/C][C]0.0591[/C][C]0.048[/C][C]0.0493[/C][C]45.5522[/C][C]30.8687[/C][C]5.556[/C][C]0.8573[/C][C]0.6811[/C][/ROW]
[ROW][C]205[/C][C]0.1022[/C][C]0.0018[/C][C]0.0388[/C][C]0.0398[/C][C]0.0355[/C][C]24.7021[/C][C]4.9701[/C][C]0.0239[/C][C]0.5496[/C][/ROW]
[ROW][C]206[/C][C]0.1065[/C][C]0.0366[/C][C]0.0384[/C][C]0.0394[/C][C]15.9722[/C][C]23.2471[/C][C]4.8215[/C][C]0.5076[/C][C]0.5426[/C][/ROW]
[ROW][C]207[/C][C]0.1125[/C][C]0.14[/C][C]0.0529[/C][C]0.0552[/C][C]302.5289[/C][C]63.1445[/C][C]7.9464[/C][C]2.2093[/C][C]0.7807[/C][/ROW]
[ROW][C]208[/C][C]0.1201[/C][C]-0.025[/C][C]0.0494[/C][C]0.0514[/C][C]6.8647[/C][C]56.1095[/C][C]7.4906[/C][C]-0.3328[/C][C]0.7247[/C][/ROW]
[ROW][C]209[/C][C]0.1255[/C][C]0.0471[/C][C]0.0492[/C][C]0.0511[/C][C]27.7593[/C][C]52.9595[/C][C]7.2773[/C][C]0.6692[/C][C]0.7186[/C][/ROW]
[ROW][C]210[/C][C]0.1306[/C][C]0.0996[/C][C]0.0542[/C][C]0.0565[/C][C]140.602[/C][C]61.7238[/C][C]7.8564[/C][C]1.5062[/C][C]0.7973[/C][/ROW]
[ROW][C]211[/C][C]0.1367[/C][C]-0.047[/C][C]0.0536[/C][C]0.0555[/C][C]23.3862[/C][C]58.2385[/C][C]7.6314[/C][C]-0.6143[/C][C]0.7807[/C][/ROW]
[ROW][C]212[/C][C]0.1421[/C][C]-0.0124[/C][C]0.0501[/C][C]0.0519[/C][C]1.7442[/C][C]53.5307[/C][C]7.3165[/C][C]-0.1678[/C][C]0.7296[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310132&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310132&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.06910.0290.0290.029510.8565000.41850.4185
2020.07940.04280.03590.036621.997616.42714.0530.59570.5071
2030.08110.0610.04430.045445.068625.97425.09650.85270.6223
2040.09220.05910.0480.049345.552230.86875.5560.85730.6811
2050.10220.00180.03880.03980.035524.70214.97010.02390.5496
2060.10650.03660.03840.039415.972223.24714.82150.50760.5426
2070.11250.140.05290.0552302.528963.14457.94642.20930.7807
2080.1201-0.0250.04940.05146.864756.10957.4906-0.33280.7247
2090.12550.04710.04920.051127.759352.95957.27730.66920.7186
2100.13060.09960.05420.0565140.60261.72387.85641.50620.7973
2110.1367-0.0470.05360.055523.386258.23857.6314-0.61430.7807
2120.1421-0.01240.05010.05191.744253.53077.3165-0.16780.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')