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, 10 Dec 2009 14:16:20 -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/10/t1260479846skmd761jzgs2zud.htm/, Retrieved Thu, 28 Mar 2024 14:25:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65807, Retrieved Thu, 28 Mar 2024 14:25:57 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact143
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-12 13:32:37] [76963dc1903f0f612b6153510a3818cf]
- R  D  [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-17 12:14:40] [76963dc1903f0f612b6153510a3818cf]
-         [Univariate Explorative Data Analysis] [Run Sequence Plot...] [2008-12-22 18:19:51] [1ce0d16c8f4225c977b42c8fa93bc163]
- RMP       [Standard Deviation-Mean Plot] [Identifying Integ...] [2009-11-22 12:50:05] [b98453cac15ba1066b407e146608df68]
-    D        [Standard Deviation-Mean Plot] [Shwws8_v4] [2009-11-27 21:44:00] [5f89c040fdf1f8599c99d7f78a662321]
- RMPD            [ARIMA Forecasting] [Paper] [2009-12-10 21:16:20] [93b66894f6318f3da4fcda772f2ffa6f] [Current]
Feedback Forum

Post a new message
Dataseries X:
17
18
23.8
25.5
25.6
23.7
22
21.3
20.7
20.4
20.3
20.4
19.8
19.5
23.1
23.5
23.5
22.9
21.9
21.5
20.5
20.2
19.4
19.2
18.8
18.8
22.6
23.3
23
21.4
19.9
18.8
18.6
18.4
18.6
19.9
19.2
18.4
21.1
20.5
19.1
18.1
17
17.1
17.4
16.8
15.3
14.3
13.4
15.3
22.1
23.7
22.2
19.5
16.6
17.3
19.8
21.2
21.5
20.6
19.1
19.6
23.5
24




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65807&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[52])
4020.5-------
4119.1-------
4218.1-------
4317-------
4417.1-------
4517.4-------
4616.8-------
4715.3-------
4814.3-------
4913.4-------
5015.3-------
5122.1-------
5223.7-------
5322.222.319.836724.76330.46830.13260.99460.1326
5419.521.317.816424.78360.15560.30630.96410.0885
5516.620.215.933524.46650.04910.62610.92920.0539
5617.320.315.373425.22660.11630.92950.89850.0881
5719.820.615.091926.10810.38790.87990.87260.135
5821.22013.966226.03380.34830.52590.85070.1147
5921.518.511.982825.01720.18350.20840.83210.0589
6020.617.510.532824.46720.19160.13020.8160.0406
6119.116.69.210223.98980.25360.14440.8020.0298
6219.618.510.710426.28960.3910.440.78960.0954
6323.525.317.130233.46980.33290.91430.77870.6495
642426.918.366935.43310.25270.78260.76880.7688

\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[52]) \tabularnewline
40 & 20.5 & - & - & - & - & - & - & - \tabularnewline
41 & 19.1 & - & - & - & - & - & - & - \tabularnewline
42 & 18.1 & - & - & - & - & - & - & - \tabularnewline
43 & 17 & - & - & - & - & - & - & - \tabularnewline
44 & 17.1 & - & - & - & - & - & - & - \tabularnewline
45 & 17.4 & - & - & - & - & - & - & - \tabularnewline
46 & 16.8 & - & - & - & - & - & - & - \tabularnewline
47 & 15.3 & - & - & - & - & - & - & - \tabularnewline
48 & 14.3 & - & - & - & - & - & - & - \tabularnewline
49 & 13.4 & - & - & - & - & - & - & - \tabularnewline
50 & 15.3 & - & - & - & - & - & - & - \tabularnewline
51 & 22.1 & - & - & - & - & - & - & - \tabularnewline
52 & 23.7 & - & - & - & - & - & - & - \tabularnewline
53 & 22.2 & 22.3 & 19.8367 & 24.7633 & 0.4683 & 0.1326 & 0.9946 & 0.1326 \tabularnewline
54 & 19.5 & 21.3 & 17.8164 & 24.7836 & 0.1556 & 0.3063 & 0.9641 & 0.0885 \tabularnewline
55 & 16.6 & 20.2 & 15.9335 & 24.4665 & 0.0491 & 0.6261 & 0.9292 & 0.0539 \tabularnewline
56 & 17.3 & 20.3 & 15.3734 & 25.2266 & 0.1163 & 0.9295 & 0.8985 & 0.0881 \tabularnewline
57 & 19.8 & 20.6 & 15.0919 & 26.1081 & 0.3879 & 0.8799 & 0.8726 & 0.135 \tabularnewline
58 & 21.2 & 20 & 13.9662 & 26.0338 & 0.3483 & 0.5259 & 0.8507 & 0.1147 \tabularnewline
59 & 21.5 & 18.5 & 11.9828 & 25.0172 & 0.1835 & 0.2084 & 0.8321 & 0.0589 \tabularnewline
60 & 20.6 & 17.5 & 10.5328 & 24.4672 & 0.1916 & 0.1302 & 0.816 & 0.0406 \tabularnewline
61 & 19.1 & 16.6 & 9.2102 & 23.9898 & 0.2536 & 0.1444 & 0.802 & 0.0298 \tabularnewline
62 & 19.6 & 18.5 & 10.7104 & 26.2896 & 0.391 & 0.44 & 0.7896 & 0.0954 \tabularnewline
63 & 23.5 & 25.3 & 17.1302 & 33.4698 & 0.3329 & 0.9143 & 0.7787 & 0.6495 \tabularnewline
64 & 24 & 26.9 & 18.3669 & 35.4331 & 0.2527 & 0.7826 & 0.7688 & 0.7688 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65807&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[52])[/C][/ROW]
[ROW][C]40[/C][C]20.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]19.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]18.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]17.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]17.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]16.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]15.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]14.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]13.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]15.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]22.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]23.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]22.2[/C][C]22.3[/C][C]19.8367[/C][C]24.7633[/C][C]0.4683[/C][C]0.1326[/C][C]0.9946[/C][C]0.1326[/C][/ROW]
[ROW][C]54[/C][C]19.5[/C][C]21.3[/C][C]17.8164[/C][C]24.7836[/C][C]0.1556[/C][C]0.3063[/C][C]0.9641[/C][C]0.0885[/C][/ROW]
[ROW][C]55[/C][C]16.6[/C][C]20.2[/C][C]15.9335[/C][C]24.4665[/C][C]0.0491[/C][C]0.6261[/C][C]0.9292[/C][C]0.0539[/C][/ROW]
[ROW][C]56[/C][C]17.3[/C][C]20.3[/C][C]15.3734[/C][C]25.2266[/C][C]0.1163[/C][C]0.9295[/C][C]0.8985[/C][C]0.0881[/C][/ROW]
[ROW][C]57[/C][C]19.8[/C][C]20.6[/C][C]15.0919[/C][C]26.1081[/C][C]0.3879[/C][C]0.8799[/C][C]0.8726[/C][C]0.135[/C][/ROW]
[ROW][C]58[/C][C]21.2[/C][C]20[/C][C]13.9662[/C][C]26.0338[/C][C]0.3483[/C][C]0.5259[/C][C]0.8507[/C][C]0.1147[/C][/ROW]
[ROW][C]59[/C][C]21.5[/C][C]18.5[/C][C]11.9828[/C][C]25.0172[/C][C]0.1835[/C][C]0.2084[/C][C]0.8321[/C][C]0.0589[/C][/ROW]
[ROW][C]60[/C][C]20.6[/C][C]17.5[/C][C]10.5328[/C][C]24.4672[/C][C]0.1916[/C][C]0.1302[/C][C]0.816[/C][C]0.0406[/C][/ROW]
[ROW][C]61[/C][C]19.1[/C][C]16.6[/C][C]9.2102[/C][C]23.9898[/C][C]0.2536[/C][C]0.1444[/C][C]0.802[/C][C]0.0298[/C][/ROW]
[ROW][C]62[/C][C]19.6[/C][C]18.5[/C][C]10.7104[/C][C]26.2896[/C][C]0.391[/C][C]0.44[/C][C]0.7896[/C][C]0.0954[/C][/ROW]
[ROW][C]63[/C][C]23.5[/C][C]25.3[/C][C]17.1302[/C][C]33.4698[/C][C]0.3329[/C][C]0.9143[/C][C]0.7787[/C][C]0.6495[/C][/ROW]
[ROW][C]64[/C][C]24[/C][C]26.9[/C][C]18.3669[/C][C]35.4331[/C][C]0.2527[/C][C]0.7826[/C][C]0.7688[/C][C]0.7688[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65807&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65807&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[52])
4020.5-------
4119.1-------
4218.1-------
4317-------
4417.1-------
4517.4-------
4616.8-------
4715.3-------
4814.3-------
4913.4-------
5015.3-------
5122.1-------
5223.7-------
5322.222.319.836724.76330.46830.13260.99460.1326
5419.521.317.816424.78360.15560.30630.96410.0885
5516.620.215.933524.46650.04910.62610.92920.0539
5617.320.315.373425.22660.11630.92950.89850.0881
5719.820.615.091926.10810.38790.87990.87260.135
5821.22013.966226.03380.34830.52590.85070.1147
5921.518.511.982825.01720.18350.20840.83210.0589
6020.617.510.532824.46720.19160.13020.8160.0406
6119.116.69.210223.98980.25360.14440.8020.0298
6219.618.510.710426.28960.3910.440.78960.0954
6323.525.317.130233.46980.33290.91430.77870.6495
642426.918.366935.43310.25270.78260.76880.7688







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
530.0564-0.004500.0100
540.0834-0.08450.04453.241.6251.2748
550.1078-0.17820.089112.965.40332.3245
560.1238-0.14780.103796.30252.5105
570.1364-0.03880.09080.645.172.2738
580.15390.060.08561.444.54832.1327
590.17970.16220.096695.18432.2769
600.20310.17710.10669.615.73752.3953
610.22710.15060.11156.255.79442.4072
620.21480.05950.10631.215.3362.31
630.1648-0.07110.10313.245.14552.2684
640.1618-0.10780.10358.415.41752.3276

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
53 & 0.0564 & -0.0045 & 0 & 0.01 & 0 & 0 \tabularnewline
54 & 0.0834 & -0.0845 & 0.0445 & 3.24 & 1.625 & 1.2748 \tabularnewline
55 & 0.1078 & -0.1782 & 0.0891 & 12.96 & 5.4033 & 2.3245 \tabularnewline
56 & 0.1238 & -0.1478 & 0.1037 & 9 & 6.3025 & 2.5105 \tabularnewline
57 & 0.1364 & -0.0388 & 0.0908 & 0.64 & 5.17 & 2.2738 \tabularnewline
58 & 0.1539 & 0.06 & 0.0856 & 1.44 & 4.5483 & 2.1327 \tabularnewline
59 & 0.1797 & 0.1622 & 0.0966 & 9 & 5.1843 & 2.2769 \tabularnewline
60 & 0.2031 & 0.1771 & 0.1066 & 9.61 & 5.7375 & 2.3953 \tabularnewline
61 & 0.2271 & 0.1506 & 0.1115 & 6.25 & 5.7944 & 2.4072 \tabularnewline
62 & 0.2148 & 0.0595 & 0.1063 & 1.21 & 5.336 & 2.31 \tabularnewline
63 & 0.1648 & -0.0711 & 0.1031 & 3.24 & 5.1455 & 2.2684 \tabularnewline
64 & 0.1618 & -0.1078 & 0.1035 & 8.41 & 5.4175 & 2.3276 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65807&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]53[/C][C]0.0564[/C][C]-0.0045[/C][C]0[/C][C]0.01[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]54[/C][C]0.0834[/C][C]-0.0845[/C][C]0.0445[/C][C]3.24[/C][C]1.625[/C][C]1.2748[/C][/ROW]
[ROW][C]55[/C][C]0.1078[/C][C]-0.1782[/C][C]0.0891[/C][C]12.96[/C][C]5.4033[/C][C]2.3245[/C][/ROW]
[ROW][C]56[/C][C]0.1238[/C][C]-0.1478[/C][C]0.1037[/C][C]9[/C][C]6.3025[/C][C]2.5105[/C][/ROW]
[ROW][C]57[/C][C]0.1364[/C][C]-0.0388[/C][C]0.0908[/C][C]0.64[/C][C]5.17[/C][C]2.2738[/C][/ROW]
[ROW][C]58[/C][C]0.1539[/C][C]0.06[/C][C]0.0856[/C][C]1.44[/C][C]4.5483[/C][C]2.1327[/C][/ROW]
[ROW][C]59[/C][C]0.1797[/C][C]0.1622[/C][C]0.0966[/C][C]9[/C][C]5.1843[/C][C]2.2769[/C][/ROW]
[ROW][C]60[/C][C]0.2031[/C][C]0.1771[/C][C]0.1066[/C][C]9.61[/C][C]5.7375[/C][C]2.3953[/C][/ROW]
[ROW][C]61[/C][C]0.2271[/C][C]0.1506[/C][C]0.1115[/C][C]6.25[/C][C]5.7944[/C][C]2.4072[/C][/ROW]
[ROW][C]62[/C][C]0.2148[/C][C]0.0595[/C][C]0.1063[/C][C]1.21[/C][C]5.336[/C][C]2.31[/C][/ROW]
[ROW][C]63[/C][C]0.1648[/C][C]-0.0711[/C][C]0.1031[/C][C]3.24[/C][C]5.1455[/C][C]2.2684[/C][/ROW]
[ROW][C]64[/C][C]0.1618[/C][C]-0.1078[/C][C]0.1035[/C][C]8.41[/C][C]5.4175[/C][C]2.3276[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65807&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65807&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
530.0564-0.004500.0100
540.0834-0.08450.04453.241.6251.2748
550.1078-0.17820.089112.965.40332.3245
560.1238-0.14780.103796.30252.5105
570.1364-0.03880.09080.645.172.2738
580.15390.060.08561.444.54832.1327
590.17970.16220.096695.18432.2769
600.20310.17710.10669.615.73752.3953
610.22710.15060.11156.255.79442.4072
620.21480.05950.10631.215.3362.31
630.1648-0.07110.10313.245.14552.2684
640.1618-0.10780.10358.415.41752.3276



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