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 computationFri, 16 Dec 2016 16:06:35 +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/2016/Dec/16/t1481901251rq9x4asjckrrwnm.htm/, Retrieved Fri, 03 May 2024 01:12:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300349, Retrieved Fri, 03 May 2024 01:12:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact58
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA C] [2016-12-16 15:06:35] [9fb47d69755d1f4b66b6f2591280f9e0] [Current]
Feedback Forum

Post a new message
Dataseries X:
2058.44
2163.84
2223.38
2126.36
1989.96
2115.1
2204.74
2197.16
2003.2
2100.46
2091.98
2027.38
1937.32
2145.32
2228.88
2367.04
2178.48
2417.94
2424.08
2517.46
2313
2595.96
2614.1
2604.26
2240.9
2514.2
2615.36
2638.56
2345.84
2625.46
2654.58
2850.46
2591.16
2868.08
2951.72
3046.74
2930.46
3161.2
3054.26
3289.48
3165.14
3317.62
3353.74
3571.6




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300349&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[32])
282638.56-------
292345.84-------
302625.46-------
312654.58-------
322850.46-------
332591.162531.84442373.82212689.86680.23100.98950
342868.082809.14762585.67023032.62490.30260.97210.94640.3586
352951.722864.67642590.97373138.37910.26650.49030.93380.5405
363046.742997.25442681.20973313.29910.37950.61120.81870.8187
372930.462688.13182280.07773096.18580.12220.04250.67930.2178
383161.22966.28432483.44683449.12170.21440.55780.65490.6809
393054.263012.1322464.63233559.63160.44010.29680.58560.7186
403289.483167.91562562.62253773.20870.34690.64360.65260.848
413165.142855.3132140.91913569.70690.19770.11680.41830.5053
423317.623133.15412324.24283942.06540.32750.46910.47290.7533
433353.743182.55082289.06534076.03630.35360.38350.61080.7668
443571.63329.82762359.10874300.54650.31270.48070.53250.8335

\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[32]) \tabularnewline
28 & 2638.56 & - & - & - & - & - & - & - \tabularnewline
29 & 2345.84 & - & - & - & - & - & - & - \tabularnewline
30 & 2625.46 & - & - & - & - & - & - & - \tabularnewline
31 & 2654.58 & - & - & - & - & - & - & - \tabularnewline
32 & 2850.46 & - & - & - & - & - & - & - \tabularnewline
33 & 2591.16 & 2531.8444 & 2373.8221 & 2689.8668 & 0.231 & 0 & 0.9895 & 0 \tabularnewline
34 & 2868.08 & 2809.1476 & 2585.6702 & 3032.6249 & 0.3026 & 0.9721 & 0.9464 & 0.3586 \tabularnewline
35 & 2951.72 & 2864.6764 & 2590.9737 & 3138.3791 & 0.2665 & 0.4903 & 0.9338 & 0.5405 \tabularnewline
36 & 3046.74 & 2997.2544 & 2681.2097 & 3313.2991 & 0.3795 & 0.6112 & 0.8187 & 0.8187 \tabularnewline
37 & 2930.46 & 2688.1318 & 2280.0777 & 3096.1858 & 0.1222 & 0.0425 & 0.6793 & 0.2178 \tabularnewline
38 & 3161.2 & 2966.2843 & 2483.4468 & 3449.1217 & 0.2144 & 0.5578 & 0.6549 & 0.6809 \tabularnewline
39 & 3054.26 & 3012.132 & 2464.6323 & 3559.6316 & 0.4401 & 0.2968 & 0.5856 & 0.7186 \tabularnewline
40 & 3289.48 & 3167.9156 & 2562.6225 & 3773.2087 & 0.3469 & 0.6436 & 0.6526 & 0.848 \tabularnewline
41 & 3165.14 & 2855.313 & 2140.9191 & 3569.7069 & 0.1977 & 0.1168 & 0.4183 & 0.5053 \tabularnewline
42 & 3317.62 & 3133.1541 & 2324.2428 & 3942.0654 & 0.3275 & 0.4691 & 0.4729 & 0.7533 \tabularnewline
43 & 3353.74 & 3182.5508 & 2289.0653 & 4076.0363 & 0.3536 & 0.3835 & 0.6108 & 0.7668 \tabularnewline
44 & 3571.6 & 3329.8276 & 2359.1087 & 4300.5465 & 0.3127 & 0.4807 & 0.5325 & 0.8335 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300349&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[32])[/C][/ROW]
[ROW][C]28[/C][C]2638.56[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]2345.84[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]2625.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]2654.58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]2850.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]2591.16[/C][C]2531.8444[/C][C]2373.8221[/C][C]2689.8668[/C][C]0.231[/C][C]0[/C][C]0.9895[/C][C]0[/C][/ROW]
[ROW][C]34[/C][C]2868.08[/C][C]2809.1476[/C][C]2585.6702[/C][C]3032.6249[/C][C]0.3026[/C][C]0.9721[/C][C]0.9464[/C][C]0.3586[/C][/ROW]
[ROW][C]35[/C][C]2951.72[/C][C]2864.6764[/C][C]2590.9737[/C][C]3138.3791[/C][C]0.2665[/C][C]0.4903[/C][C]0.9338[/C][C]0.5405[/C][/ROW]
[ROW][C]36[/C][C]3046.74[/C][C]2997.2544[/C][C]2681.2097[/C][C]3313.2991[/C][C]0.3795[/C][C]0.6112[/C][C]0.8187[/C][C]0.8187[/C][/ROW]
[ROW][C]37[/C][C]2930.46[/C][C]2688.1318[/C][C]2280.0777[/C][C]3096.1858[/C][C]0.1222[/C][C]0.0425[/C][C]0.6793[/C][C]0.2178[/C][/ROW]
[ROW][C]38[/C][C]3161.2[/C][C]2966.2843[/C][C]2483.4468[/C][C]3449.1217[/C][C]0.2144[/C][C]0.5578[/C][C]0.6549[/C][C]0.6809[/C][/ROW]
[ROW][C]39[/C][C]3054.26[/C][C]3012.132[/C][C]2464.6323[/C][C]3559.6316[/C][C]0.4401[/C][C]0.2968[/C][C]0.5856[/C][C]0.7186[/C][/ROW]
[ROW][C]40[/C][C]3289.48[/C][C]3167.9156[/C][C]2562.6225[/C][C]3773.2087[/C][C]0.3469[/C][C]0.6436[/C][C]0.6526[/C][C]0.848[/C][/ROW]
[ROW][C]41[/C][C]3165.14[/C][C]2855.313[/C][C]2140.9191[/C][C]3569.7069[/C][C]0.1977[/C][C]0.1168[/C][C]0.4183[/C][C]0.5053[/C][/ROW]
[ROW][C]42[/C][C]3317.62[/C][C]3133.1541[/C][C]2324.2428[/C][C]3942.0654[/C][C]0.3275[/C][C]0.4691[/C][C]0.4729[/C][C]0.7533[/C][/ROW]
[ROW][C]43[/C][C]3353.74[/C][C]3182.5508[/C][C]2289.0653[/C][C]4076.0363[/C][C]0.3536[/C][C]0.3835[/C][C]0.6108[/C][C]0.7668[/C][/ROW]
[ROW][C]44[/C][C]3571.6[/C][C]3329.8276[/C][C]2359.1087[/C][C]4300.5465[/C][C]0.3127[/C][C]0.4807[/C][C]0.5325[/C][C]0.8335[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300349&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300349&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[32])
282638.56-------
292345.84-------
302625.46-------
312654.58-------
322850.46-------
332591.162531.84442373.82212689.86680.23100.98950
342868.082809.14762585.67023032.62490.30260.97210.94640.3586
352951.722864.67642590.97373138.37910.26650.49030.93380.5405
363046.742997.25442681.20973313.29910.37950.61120.81870.8187
372930.462688.13182280.07773096.18580.12220.04250.67930.2178
383161.22966.28432483.44683449.12170.21440.55780.65490.6809
393054.263012.1322464.63233559.63160.44010.29680.58560.7186
403289.483167.91562562.62253773.20870.34690.64360.65260.848
413165.142855.3132140.91913569.70690.19770.11680.41830.5053
423317.623133.15412324.24283942.06540.32750.46910.47290.7533
433353.743182.55082289.06534076.03630.35360.38350.61080.7668
443571.63329.82762359.10874300.54650.31270.48070.53250.8335







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
330.03180.02290.02290.02323518.3401000.38940.3894
340.04060.02050.02170.0223473.02993495.68559.12430.38690.3881
350.04870.02950.02430.02467576.58844855.986169.68490.57140.4492
360.05380.01620.02230.02262448.82264254.195365.22420.32490.4182
370.07740.08270.03440.035358722.9715147.9502123.0771.59090.6527
380.0830.06170.03890.0437992.143918955.3158137.67831.27960.7572
390.09270.01380.03530.03631774.768916500.952128.4560.27660.6885
400.09750.0370.03550.036514777.903416285.5709127.61490.79810.7022
410.12770.09790.04250.043895992.785725141.9281158.56212.0340.8502
420.13170.05560.04380.045234027.660426030.5013161.33971.2110.8863
430.14320.0510.04440.045829305.743426328.2506162.25981.12390.9079
440.14870.06770.04640.047958453.906829005.3886170.30971.58720.9645

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
33 & 0.0318 & 0.0229 & 0.0229 & 0.0232 & 3518.3401 & 0 & 0 & 0.3894 & 0.3894 \tabularnewline
34 & 0.0406 & 0.0205 & 0.0217 & 0.022 & 3473.0299 & 3495.685 & 59.1243 & 0.3869 & 0.3881 \tabularnewline
35 & 0.0487 & 0.0295 & 0.0243 & 0.0246 & 7576.5884 & 4855.9861 & 69.6849 & 0.5714 & 0.4492 \tabularnewline
36 & 0.0538 & 0.0162 & 0.0223 & 0.0226 & 2448.8226 & 4254.1953 & 65.2242 & 0.3249 & 0.4182 \tabularnewline
37 & 0.0774 & 0.0827 & 0.0344 & 0.0353 & 58722.97 & 15147.9502 & 123.077 & 1.5909 & 0.6527 \tabularnewline
38 & 0.083 & 0.0617 & 0.0389 & 0.04 & 37992.1439 & 18955.3158 & 137.6783 & 1.2796 & 0.7572 \tabularnewline
39 & 0.0927 & 0.0138 & 0.0353 & 0.0363 & 1774.7689 & 16500.952 & 128.456 & 0.2766 & 0.6885 \tabularnewline
40 & 0.0975 & 0.037 & 0.0355 & 0.0365 & 14777.9034 & 16285.5709 & 127.6149 & 0.7981 & 0.7022 \tabularnewline
41 & 0.1277 & 0.0979 & 0.0425 & 0.0438 & 95992.7857 & 25141.9281 & 158.5621 & 2.034 & 0.8502 \tabularnewline
42 & 0.1317 & 0.0556 & 0.0438 & 0.0452 & 34027.6604 & 26030.5013 & 161.3397 & 1.211 & 0.8863 \tabularnewline
43 & 0.1432 & 0.051 & 0.0444 & 0.0458 & 29305.7434 & 26328.2506 & 162.2598 & 1.1239 & 0.9079 \tabularnewline
44 & 0.1487 & 0.0677 & 0.0464 & 0.0479 & 58453.9068 & 29005.3886 & 170.3097 & 1.5872 & 0.9645 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300349&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]33[/C][C]0.0318[/C][C]0.0229[/C][C]0.0229[/C][C]0.0232[/C][C]3518.3401[/C][C]0[/C][C]0[/C][C]0.3894[/C][C]0.3894[/C][/ROW]
[ROW][C]34[/C][C]0.0406[/C][C]0.0205[/C][C]0.0217[/C][C]0.022[/C][C]3473.0299[/C][C]3495.685[/C][C]59.1243[/C][C]0.3869[/C][C]0.3881[/C][/ROW]
[ROW][C]35[/C][C]0.0487[/C][C]0.0295[/C][C]0.0243[/C][C]0.0246[/C][C]7576.5884[/C][C]4855.9861[/C][C]69.6849[/C][C]0.5714[/C][C]0.4492[/C][/ROW]
[ROW][C]36[/C][C]0.0538[/C][C]0.0162[/C][C]0.0223[/C][C]0.0226[/C][C]2448.8226[/C][C]4254.1953[/C][C]65.2242[/C][C]0.3249[/C][C]0.4182[/C][/ROW]
[ROW][C]37[/C][C]0.0774[/C][C]0.0827[/C][C]0.0344[/C][C]0.0353[/C][C]58722.97[/C][C]15147.9502[/C][C]123.077[/C][C]1.5909[/C][C]0.6527[/C][/ROW]
[ROW][C]38[/C][C]0.083[/C][C]0.0617[/C][C]0.0389[/C][C]0.04[/C][C]37992.1439[/C][C]18955.3158[/C][C]137.6783[/C][C]1.2796[/C][C]0.7572[/C][/ROW]
[ROW][C]39[/C][C]0.0927[/C][C]0.0138[/C][C]0.0353[/C][C]0.0363[/C][C]1774.7689[/C][C]16500.952[/C][C]128.456[/C][C]0.2766[/C][C]0.6885[/C][/ROW]
[ROW][C]40[/C][C]0.0975[/C][C]0.037[/C][C]0.0355[/C][C]0.0365[/C][C]14777.9034[/C][C]16285.5709[/C][C]127.6149[/C][C]0.7981[/C][C]0.7022[/C][/ROW]
[ROW][C]41[/C][C]0.1277[/C][C]0.0979[/C][C]0.0425[/C][C]0.0438[/C][C]95992.7857[/C][C]25141.9281[/C][C]158.5621[/C][C]2.034[/C][C]0.8502[/C][/ROW]
[ROW][C]42[/C][C]0.1317[/C][C]0.0556[/C][C]0.0438[/C][C]0.0452[/C][C]34027.6604[/C][C]26030.5013[/C][C]161.3397[/C][C]1.211[/C][C]0.8863[/C][/ROW]
[ROW][C]43[/C][C]0.1432[/C][C]0.051[/C][C]0.0444[/C][C]0.0458[/C][C]29305.7434[/C][C]26328.2506[/C][C]162.2598[/C][C]1.1239[/C][C]0.9079[/C][/ROW]
[ROW][C]44[/C][C]0.1487[/C][C]0.0677[/C][C]0.0464[/C][C]0.0479[/C][C]58453.9068[/C][C]29005.3886[/C][C]170.3097[/C][C]1.5872[/C][C]0.9645[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300349&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300349&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
330.03180.02290.02290.02323518.3401000.38940.3894
340.04060.02050.02170.0223473.02993495.68559.12430.38690.3881
350.04870.02950.02430.02467576.58844855.986169.68490.57140.4492
360.05380.01620.02230.02262448.82264254.195365.22420.32490.4182
370.07740.08270.03440.035358722.9715147.9502123.0771.59090.6527
380.0830.06170.03890.0437992.143918955.3158137.67831.27960.7572
390.09270.01380.03530.03631774.768916500.952128.4560.27660.6885
400.09750.0370.03550.036514777.903416285.5709127.61490.79810.7022
410.12770.09790.04250.043895992.785725141.9281158.56212.0340.8502
420.13170.05560.04380.045234027.660426030.5013161.33971.2110.8863
430.14320.0510.04440.045829305.743426328.2506162.25981.12390.9079
440.14870.06770.04640.047958453.906829005.3886170.30971.58720.9645



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