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 computationSat, 12 Dec 2009 07:06:49 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2009/Dec/12/t1260626923qm5rpcretoyaq7d.htm/, Retrieved Sun, 05 May 2024 23:54:27 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66968, Retrieved Sun, 05 May 2024 23:54:27 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact139
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Granger Causality] [] [2009-12-07 08:54:13] [b98453cac15ba1066b407e146608df68]
- R PD  [Bivariate Granger Causality] [] [2009-12-09 15:50:46] [4f76e114ed5e444b1133aad392380aad]
- RMPD      [ARIMA Forecasting] [workshop 10] [2009-12-12 14:06:49] [aef022288383377281176d9807aba5bf] [Current]
Feedback Forum

Post a new message
Dataseries X:
2.86
2.55
2.28
2.26
2.57
3.08
2.76
2.51
2.87
3.14
3.12
3.16
2.48
2.57
2.88
2.63
2.38
1.69
1.96
2.19
1.87
1.6
1.63
1.22
1.21
1.49
1.64
1.66
1.77
1.82
1.78
1.28
1.29
1.37
1.12
1.51
2.24
2.94
3.09
3.46
3.64
4.39
4.15
5.21
5.8
5.91
5.39
5.46
4.72
3.14
2.63
2.32
1.93
0.62
0.6
-0.37
-1.1
-1.68
-0.78
-1.19




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66968&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66968&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66968&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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







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[48])
361.51-------
372.24-------
382.94-------
393.09-------
403.46-------
413.64-------
424.39-------
434.15-------
445.21-------
455.8-------
465.91-------
475.39-------
485.46-------
494.725.04864.42245.67470.15190.098910.0989
503.144.5263.64055.41150.00110.33380.99980.0194
512.634.37433.28975.45888e-040.98710.98990.0249
522.324.15462.90235.40690.0020.99150.86150.0205
531.934.00352.60335.40360.00190.99080.69460.0207
540.623.55412.02035.08791e-040.9810.14270.0074
550.63.70852.05195.36521e-040.99990.30070.0191
56-0.373.32571.55465.096700.99870.01850.0091
57-1.12.98521.10674.863600.99980.00170.0049
58-1.682.88710.9074.8672010.00140.0054
59-0.783.29391.21715.37061e-0410.02390.0205
60-1.193.08160.91255.25071e-040.99980.01580.0158

\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[48]) \tabularnewline
36 & 1.51 & - & - & - & - & - & - & - \tabularnewline
37 & 2.24 & - & - & - & - & - & - & - \tabularnewline
38 & 2.94 & - & - & - & - & - & - & - \tabularnewline
39 & 3.09 & - & - & - & - & - & - & - \tabularnewline
40 & 3.46 & - & - & - & - & - & - & - \tabularnewline
41 & 3.64 & - & - & - & - & - & - & - \tabularnewline
42 & 4.39 & - & - & - & - & - & - & - \tabularnewline
43 & 4.15 & - & - & - & - & - & - & - \tabularnewline
44 & 5.21 & - & - & - & - & - & - & - \tabularnewline
45 & 5.8 & - & - & - & - & - & - & - \tabularnewline
46 & 5.91 & - & - & - & - & - & - & - \tabularnewline
47 & 5.39 & - & - & - & - & - & - & - \tabularnewline
48 & 5.46 & - & - & - & - & - & - & - \tabularnewline
49 & 4.72 & 5.0486 & 4.4224 & 5.6747 & 0.1519 & 0.0989 & 1 & 0.0989 \tabularnewline
50 & 3.14 & 4.526 & 3.6405 & 5.4115 & 0.0011 & 0.3338 & 0.9998 & 0.0194 \tabularnewline
51 & 2.63 & 4.3743 & 3.2897 & 5.4588 & 8e-04 & 0.9871 & 0.9899 & 0.0249 \tabularnewline
52 & 2.32 & 4.1546 & 2.9023 & 5.4069 & 0.002 & 0.9915 & 0.8615 & 0.0205 \tabularnewline
53 & 1.93 & 4.0035 & 2.6033 & 5.4036 & 0.0019 & 0.9908 & 0.6946 & 0.0207 \tabularnewline
54 & 0.62 & 3.5541 & 2.0203 & 5.0879 & 1e-04 & 0.981 & 0.1427 & 0.0074 \tabularnewline
55 & 0.6 & 3.7085 & 2.0519 & 5.3652 & 1e-04 & 0.9999 & 0.3007 & 0.0191 \tabularnewline
56 & -0.37 & 3.3257 & 1.5546 & 5.0967 & 0 & 0.9987 & 0.0185 & 0.0091 \tabularnewline
57 & -1.1 & 2.9852 & 1.1067 & 4.8636 & 0 & 0.9998 & 0.0017 & 0.0049 \tabularnewline
58 & -1.68 & 2.8871 & 0.907 & 4.8672 & 0 & 1 & 0.0014 & 0.0054 \tabularnewline
59 & -0.78 & 3.2939 & 1.2171 & 5.3706 & 1e-04 & 1 & 0.0239 & 0.0205 \tabularnewline
60 & -1.19 & 3.0816 & 0.9125 & 5.2507 & 1e-04 & 0.9998 & 0.0158 & 0.0158 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66968&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[48])[/C][/ROW]
[ROW][C]36[/C][C]1.51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2.24[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2.94[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3.09[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]3.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]3.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]4.39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]4.15[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]5.21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]5.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]5.91[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]5.39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]5.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]4.72[/C][C]5.0486[/C][C]4.4224[/C][C]5.6747[/C][C]0.1519[/C][C]0.0989[/C][C]1[/C][C]0.0989[/C][/ROW]
[ROW][C]50[/C][C]3.14[/C][C]4.526[/C][C]3.6405[/C][C]5.4115[/C][C]0.0011[/C][C]0.3338[/C][C]0.9998[/C][C]0.0194[/C][/ROW]
[ROW][C]51[/C][C]2.63[/C][C]4.3743[/C][C]3.2897[/C][C]5.4588[/C][C]8e-04[/C][C]0.9871[/C][C]0.9899[/C][C]0.0249[/C][/ROW]
[ROW][C]52[/C][C]2.32[/C][C]4.1546[/C][C]2.9023[/C][C]5.4069[/C][C]0.002[/C][C]0.9915[/C][C]0.8615[/C][C]0.0205[/C][/ROW]
[ROW][C]53[/C][C]1.93[/C][C]4.0035[/C][C]2.6033[/C][C]5.4036[/C][C]0.0019[/C][C]0.9908[/C][C]0.6946[/C][C]0.0207[/C][/ROW]
[ROW][C]54[/C][C]0.62[/C][C]3.5541[/C][C]2.0203[/C][C]5.0879[/C][C]1e-04[/C][C]0.981[/C][C]0.1427[/C][C]0.0074[/C][/ROW]
[ROW][C]55[/C][C]0.6[/C][C]3.7085[/C][C]2.0519[/C][C]5.3652[/C][C]1e-04[/C][C]0.9999[/C][C]0.3007[/C][C]0.0191[/C][/ROW]
[ROW][C]56[/C][C]-0.37[/C][C]3.3257[/C][C]1.5546[/C][C]5.0967[/C][C]0[/C][C]0.9987[/C][C]0.0185[/C][C]0.0091[/C][/ROW]
[ROW][C]57[/C][C]-1.1[/C][C]2.9852[/C][C]1.1067[/C][C]4.8636[/C][C]0[/C][C]0.9998[/C][C]0.0017[/C][C]0.0049[/C][/ROW]
[ROW][C]58[/C][C]-1.68[/C][C]2.8871[/C][C]0.907[/C][C]4.8672[/C][C]0[/C][C]1[/C][C]0.0014[/C][C]0.0054[/C][/ROW]
[ROW][C]59[/C][C]-0.78[/C][C]3.2939[/C][C]1.2171[/C][C]5.3706[/C][C]1e-04[/C][C]1[/C][C]0.0239[/C][C]0.0205[/C][/ROW]
[ROW][C]60[/C][C]-1.19[/C][C]3.0816[/C][C]0.9125[/C][C]5.2507[/C][C]1e-04[/C][C]0.9998[/C][C]0.0158[/C][C]0.0158[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66968&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66968&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[48])
361.51-------
372.24-------
382.94-------
393.09-------
403.46-------
413.64-------
424.39-------
434.15-------
445.21-------
455.8-------
465.91-------
475.39-------
485.46-------
494.725.04864.42245.67470.15190.098910.0989
503.144.5263.64055.41150.00110.33380.99980.0194
512.634.37433.28975.45888e-040.98710.98990.0249
522.324.15462.90235.40690.0020.99150.86150.0205
531.934.00352.60335.40360.00190.99080.69460.0207
540.623.55412.02035.08791e-040.9810.14270.0074
550.63.70852.05195.36521e-040.99990.30070.0191
56-0.373.32571.55465.096700.99870.01850.0091
57-1.12.98521.10674.863600.99980.00170.0049
58-1.682.88710.9074.8672010.00140.0054
59-0.783.29391.21715.37061e-0410.02390.0205
60-1.193.08160.91255.25071e-040.99980.01580.0158







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0633-0.065100.10800
500.0998-0.30620.18571.9211.01451.0072
510.1265-0.39880.25673.04241.69051.3002
520.1538-0.44160.30293.36592.10931.4524
530.1784-0.51790.34594.29932.54731.596
540.2202-0.82560.42598.6093.55761.8862
550.2279-0.83820.48489.66294.42982.1047
560.2717-1.11130.563113.65815.58332.3629
570.3211-1.36850.652616.68856.81722.611
580.3499-1.58190.745520.85878.22142.8673
590.3217-1.23680.790216.59658.98282.9971
600.3591-1.38620.839818.24659.75473.1233

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0633 & -0.0651 & 0 & 0.108 & 0 & 0 \tabularnewline
50 & 0.0998 & -0.3062 & 0.1857 & 1.921 & 1.0145 & 1.0072 \tabularnewline
51 & 0.1265 & -0.3988 & 0.2567 & 3.0424 & 1.6905 & 1.3002 \tabularnewline
52 & 0.1538 & -0.4416 & 0.3029 & 3.3659 & 2.1093 & 1.4524 \tabularnewline
53 & 0.1784 & -0.5179 & 0.3459 & 4.2993 & 2.5473 & 1.596 \tabularnewline
54 & 0.2202 & -0.8256 & 0.4259 & 8.609 & 3.5576 & 1.8862 \tabularnewline
55 & 0.2279 & -0.8382 & 0.4848 & 9.6629 & 4.4298 & 2.1047 \tabularnewline
56 & 0.2717 & -1.1113 & 0.5631 & 13.6581 & 5.5833 & 2.3629 \tabularnewline
57 & 0.3211 & -1.3685 & 0.6526 & 16.6885 & 6.8172 & 2.611 \tabularnewline
58 & 0.3499 & -1.5819 & 0.7455 & 20.8587 & 8.2214 & 2.8673 \tabularnewline
59 & 0.3217 & -1.2368 & 0.7902 & 16.5965 & 8.9828 & 2.9971 \tabularnewline
60 & 0.3591 & -1.3862 & 0.8398 & 18.2465 & 9.7547 & 3.1233 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66968&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]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]49[/C][C]0.0633[/C][C]-0.0651[/C][C]0[/C][C]0.108[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0998[/C][C]-0.3062[/C][C]0.1857[/C][C]1.921[/C][C]1.0145[/C][C]1.0072[/C][/ROW]
[ROW][C]51[/C][C]0.1265[/C][C]-0.3988[/C][C]0.2567[/C][C]3.0424[/C][C]1.6905[/C][C]1.3002[/C][/ROW]
[ROW][C]52[/C][C]0.1538[/C][C]-0.4416[/C][C]0.3029[/C][C]3.3659[/C][C]2.1093[/C][C]1.4524[/C][/ROW]
[ROW][C]53[/C][C]0.1784[/C][C]-0.5179[/C][C]0.3459[/C][C]4.2993[/C][C]2.5473[/C][C]1.596[/C][/ROW]
[ROW][C]54[/C][C]0.2202[/C][C]-0.8256[/C][C]0.4259[/C][C]8.609[/C][C]3.5576[/C][C]1.8862[/C][/ROW]
[ROW][C]55[/C][C]0.2279[/C][C]-0.8382[/C][C]0.4848[/C][C]9.6629[/C][C]4.4298[/C][C]2.1047[/C][/ROW]
[ROW][C]56[/C][C]0.2717[/C][C]-1.1113[/C][C]0.5631[/C][C]13.6581[/C][C]5.5833[/C][C]2.3629[/C][/ROW]
[ROW][C]57[/C][C]0.3211[/C][C]-1.3685[/C][C]0.6526[/C][C]16.6885[/C][C]6.8172[/C][C]2.611[/C][/ROW]
[ROW][C]58[/C][C]0.3499[/C][C]-1.5819[/C][C]0.7455[/C][C]20.8587[/C][C]8.2214[/C][C]2.8673[/C][/ROW]
[ROW][C]59[/C][C]0.3217[/C][C]-1.2368[/C][C]0.7902[/C][C]16.5965[/C][C]8.9828[/C][C]2.9971[/C][/ROW]
[ROW][C]60[/C][C]0.3591[/C][C]-1.3862[/C][C]0.8398[/C][C]18.2465[/C][C]9.7547[/C][C]3.1233[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66968&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66968&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.PEMAPESq.EMSERMSE
490.0633-0.065100.10800
500.0998-0.30620.18571.9211.01451.0072
510.1265-0.39880.25673.04241.69051.3002
520.1538-0.44160.30293.36592.10931.4524
530.1784-0.51790.34594.29932.54731.596
540.2202-0.82560.42598.6093.55761.8862
550.2279-0.83820.48489.66294.42982.1047
560.2717-1.11130.563113.65815.58332.3629
570.3211-1.36850.652616.68856.81722.611
580.3499-1.58190.745520.85878.22142.8673
590.3217-1.23680.790216.59658.98282.9971
600.3591-1.38620.839818.24659.75473.1233



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 2 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 2 ; 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
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,par1))
(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.mape <- array(0, dim=fx)
perf.mape1 <- 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)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[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.mse[1] = abs(perf.se[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.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[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',7,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,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',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.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')