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, 21 Dec 2009 14:27:55 -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/21/t12614309081byff1h73hjulkx.htm/, Retrieved Sun, 05 May 2024 09:27:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70396, Retrieved Sun, 05 May 2024 09:27:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact108
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Data Series] [Bivariate dataset] [2008-01-05 23:51:08] [74be16979710d4c4e7c6647856088456]
F RMPD  [Univariate Explorative Data Analysis] [Colombia Coffee] [2008-01-07 14:21:11] [74be16979710d4c4e7c6647856088456]
F RMPD    [Univariate Data Series] [] [2009-10-14 08:30:28] [74be16979710d4c4e7c6647856088456]
- RMPD        [ARIMA Forecasting] [Paper] [2009-12-21 21:27:55] [e339dd08bcbfc073ac7494f09a949034] [Current]
Feedback Forum

Post a new message
Dataseries X:
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




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70396&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])
3621.1-------
3720.5-------
3819.1-------
3918.1-------
4017-------
4117.1-------
4217.4-------
4316.8-------
4415.3-------
4514.3-------
4613.4-------
4715.3-------
4822.1-------
4923.724.167222.922425.41210.2310.999410.9994
5022.222.710720.147925.27360.3480.22470.99710.6798
5119.518.922915.247322.59850.37910.04030.66960.0451
5216.615.106510.84419.36910.24610.02170.1927e-04
5317.313.8419.379218.30280.06430.11280.07611e-04
5419.815.161610.641519.68180.02210.17690.16590.0013
5521.216.984712.390621.57880.03610.11490.53140.0145
5621.517.866913.037622.69610.07020.08810.85120.0429
5720.617.886812.565723.20790.15880.09160.90680.0603
5819.115.66469.74521.58410.12770.05110.77330.0166
5919.614.68428.293521.07490.06580.08780.42510.0115
6023.518.894212.228425.560.08780.41780.17290.1729

\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 & 21.1 & - & - & - & - & - & - & - \tabularnewline
37 & 20.5 & - & - & - & - & - & - & - \tabularnewline
38 & 19.1 & - & - & - & - & - & - & - \tabularnewline
39 & 18.1 & - & - & - & - & - & - & - \tabularnewline
40 & 17 & - & - & - & - & - & - & - \tabularnewline
41 & 17.1 & - & - & - & - & - & - & - \tabularnewline
42 & 17.4 & - & - & - & - & - & - & - \tabularnewline
43 & 16.8 & - & - & - & - & - & - & - \tabularnewline
44 & 15.3 & - & - & - & - & - & - & - \tabularnewline
45 & 14.3 & - & - & - & - & - & - & - \tabularnewline
46 & 13.4 & - & - & - & - & - & - & - \tabularnewline
47 & 15.3 & - & - & - & - & - & - & - \tabularnewline
48 & 22.1 & - & - & - & - & - & - & - \tabularnewline
49 & 23.7 & 24.1672 & 22.9224 & 25.4121 & 0.231 & 0.9994 & 1 & 0.9994 \tabularnewline
50 & 22.2 & 22.7107 & 20.1479 & 25.2736 & 0.348 & 0.2247 & 0.9971 & 0.6798 \tabularnewline
51 & 19.5 & 18.9229 & 15.2473 & 22.5985 & 0.3791 & 0.0403 & 0.6696 & 0.0451 \tabularnewline
52 & 16.6 & 15.1065 & 10.844 & 19.3691 & 0.2461 & 0.0217 & 0.192 & 7e-04 \tabularnewline
53 & 17.3 & 13.841 & 9.3792 & 18.3028 & 0.0643 & 0.1128 & 0.0761 & 1e-04 \tabularnewline
54 & 19.8 & 15.1616 & 10.6415 & 19.6818 & 0.0221 & 0.1769 & 0.1659 & 0.0013 \tabularnewline
55 & 21.2 & 16.9847 & 12.3906 & 21.5788 & 0.0361 & 0.1149 & 0.5314 & 0.0145 \tabularnewline
56 & 21.5 & 17.8669 & 13.0376 & 22.6961 & 0.0702 & 0.0881 & 0.8512 & 0.0429 \tabularnewline
57 & 20.6 & 17.8868 & 12.5657 & 23.2079 & 0.1588 & 0.0916 & 0.9068 & 0.0603 \tabularnewline
58 & 19.1 & 15.6646 & 9.745 & 21.5841 & 0.1277 & 0.0511 & 0.7733 & 0.0166 \tabularnewline
59 & 19.6 & 14.6842 & 8.2935 & 21.0749 & 0.0658 & 0.0878 & 0.4251 & 0.0115 \tabularnewline
60 & 23.5 & 18.8942 & 12.2284 & 25.56 & 0.0878 & 0.4178 & 0.1729 & 0.1729 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70396&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]21.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]20.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]19.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]18.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]17.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]17.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]16.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]15.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]14.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]13.4[/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]22.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]23.7[/C][C]24.1672[/C][C]22.9224[/C][C]25.4121[/C][C]0.231[/C][C]0.9994[/C][C]1[/C][C]0.9994[/C][/ROW]
[ROW][C]50[/C][C]22.2[/C][C]22.7107[/C][C]20.1479[/C][C]25.2736[/C][C]0.348[/C][C]0.2247[/C][C]0.9971[/C][C]0.6798[/C][/ROW]
[ROW][C]51[/C][C]19.5[/C][C]18.9229[/C][C]15.2473[/C][C]22.5985[/C][C]0.3791[/C][C]0.0403[/C][C]0.6696[/C][C]0.0451[/C][/ROW]
[ROW][C]52[/C][C]16.6[/C][C]15.1065[/C][C]10.844[/C][C]19.3691[/C][C]0.2461[/C][C]0.0217[/C][C]0.192[/C][C]7e-04[/C][/ROW]
[ROW][C]53[/C][C]17.3[/C][C]13.841[/C][C]9.3792[/C][C]18.3028[/C][C]0.0643[/C][C]0.1128[/C][C]0.0761[/C][C]1e-04[/C][/ROW]
[ROW][C]54[/C][C]19.8[/C][C]15.1616[/C][C]10.6415[/C][C]19.6818[/C][C]0.0221[/C][C]0.1769[/C][C]0.1659[/C][C]0.0013[/C][/ROW]
[ROW][C]55[/C][C]21.2[/C][C]16.9847[/C][C]12.3906[/C][C]21.5788[/C][C]0.0361[/C][C]0.1149[/C][C]0.5314[/C][C]0.0145[/C][/ROW]
[ROW][C]56[/C][C]21.5[/C][C]17.8669[/C][C]13.0376[/C][C]22.6961[/C][C]0.0702[/C][C]0.0881[/C][C]0.8512[/C][C]0.0429[/C][/ROW]
[ROW][C]57[/C][C]20.6[/C][C]17.8868[/C][C]12.5657[/C][C]23.2079[/C][C]0.1588[/C][C]0.0916[/C][C]0.9068[/C][C]0.0603[/C][/ROW]
[ROW][C]58[/C][C]19.1[/C][C]15.6646[/C][C]9.745[/C][C]21.5841[/C][C]0.1277[/C][C]0.0511[/C][C]0.7733[/C][C]0.0166[/C][/ROW]
[ROW][C]59[/C][C]19.6[/C][C]14.6842[/C][C]8.2935[/C][C]21.0749[/C][C]0.0658[/C][C]0.0878[/C][C]0.4251[/C][C]0.0115[/C][/ROW]
[ROW][C]60[/C][C]23.5[/C][C]18.8942[/C][C]12.2284[/C][C]25.56[/C][C]0.0878[/C][C]0.4178[/C][C]0.1729[/C][C]0.1729[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70396&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70396&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])
3621.1-------
3720.5-------
3819.1-------
3918.1-------
4017-------
4117.1-------
4217.4-------
4316.8-------
4415.3-------
4514.3-------
4613.4-------
4715.3-------
4822.1-------
4923.724.167222.922425.41210.2310.999410.9994
5022.222.710720.147925.27360.3480.22470.99710.6798
5119.518.922915.247322.59850.37910.04030.66960.0451
5216.615.106510.84419.36910.24610.02170.1927e-04
5317.313.8419.379218.30280.06430.11280.07611e-04
5419.815.161610.641519.68180.02210.17690.16590.0013
5521.216.984712.390621.57880.03610.11490.53140.0145
5621.517.866913.037622.69610.07020.08810.85120.0429
5720.617.886812.565723.20790.15880.09160.90680.0603
5819.115.66469.74521.58410.12770.05110.77330.0166
5919.614.68428.293521.07490.06580.08780.42510.0115
6023.518.894212.228425.560.08780.41780.17290.1729







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0263-0.019300.218300
500.0576-0.02250.02090.26090.23960.4895
510.09910.03050.02410.3330.27070.5203
520.1440.09890.04282.23040.76070.8722
530.16450.24990.084211.96473.00151.7325
540.15210.30590.121221.51446.08692.4672
550.1380.24820.139317.76847.75572.7849
560.13790.20330.147313.19978.43622.9045
570.15180.15170.14787.36138.31682.8839
580.19280.21930.15511.80218.66532.9437
590.2220.33480.171324.165410.07443.174
600.180.24380.177321.213711.00273.317

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0263 & -0.0193 & 0 & 0.2183 & 0 & 0 \tabularnewline
50 & 0.0576 & -0.0225 & 0.0209 & 0.2609 & 0.2396 & 0.4895 \tabularnewline
51 & 0.0991 & 0.0305 & 0.0241 & 0.333 & 0.2707 & 0.5203 \tabularnewline
52 & 0.144 & 0.0989 & 0.0428 & 2.2304 & 0.7607 & 0.8722 \tabularnewline
53 & 0.1645 & 0.2499 & 0.0842 & 11.9647 & 3.0015 & 1.7325 \tabularnewline
54 & 0.1521 & 0.3059 & 0.1212 & 21.5144 & 6.0869 & 2.4672 \tabularnewline
55 & 0.138 & 0.2482 & 0.1393 & 17.7684 & 7.7557 & 2.7849 \tabularnewline
56 & 0.1379 & 0.2033 & 0.1473 & 13.1997 & 8.4362 & 2.9045 \tabularnewline
57 & 0.1518 & 0.1517 & 0.1478 & 7.3613 & 8.3168 & 2.8839 \tabularnewline
58 & 0.1928 & 0.2193 & 0.155 & 11.8021 & 8.6653 & 2.9437 \tabularnewline
59 & 0.222 & 0.3348 & 0.1713 & 24.1654 & 10.0744 & 3.174 \tabularnewline
60 & 0.18 & 0.2438 & 0.1773 & 21.2137 & 11.0027 & 3.317 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70396&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.0263[/C][C]-0.0193[/C][C]0[/C][C]0.2183[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0576[/C][C]-0.0225[/C][C]0.0209[/C][C]0.2609[/C][C]0.2396[/C][C]0.4895[/C][/ROW]
[ROW][C]51[/C][C]0.0991[/C][C]0.0305[/C][C]0.0241[/C][C]0.333[/C][C]0.2707[/C][C]0.5203[/C][/ROW]
[ROW][C]52[/C][C]0.144[/C][C]0.0989[/C][C]0.0428[/C][C]2.2304[/C][C]0.7607[/C][C]0.8722[/C][/ROW]
[ROW][C]53[/C][C]0.1645[/C][C]0.2499[/C][C]0.0842[/C][C]11.9647[/C][C]3.0015[/C][C]1.7325[/C][/ROW]
[ROW][C]54[/C][C]0.1521[/C][C]0.3059[/C][C]0.1212[/C][C]21.5144[/C][C]6.0869[/C][C]2.4672[/C][/ROW]
[ROW][C]55[/C][C]0.138[/C][C]0.2482[/C][C]0.1393[/C][C]17.7684[/C][C]7.7557[/C][C]2.7849[/C][/ROW]
[ROW][C]56[/C][C]0.1379[/C][C]0.2033[/C][C]0.1473[/C][C]13.1997[/C][C]8.4362[/C][C]2.9045[/C][/ROW]
[ROW][C]57[/C][C]0.1518[/C][C]0.1517[/C][C]0.1478[/C][C]7.3613[/C][C]8.3168[/C][C]2.8839[/C][/ROW]
[ROW][C]58[/C][C]0.1928[/C][C]0.2193[/C][C]0.155[/C][C]11.8021[/C][C]8.6653[/C][C]2.9437[/C][/ROW]
[ROW][C]59[/C][C]0.222[/C][C]0.3348[/C][C]0.1713[/C][C]24.1654[/C][C]10.0744[/C][C]3.174[/C][/ROW]
[ROW][C]60[/C][C]0.18[/C][C]0.2438[/C][C]0.1773[/C][C]21.2137[/C][C]11.0027[/C][C]3.317[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70396&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70396&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.0263-0.019300.218300
500.0576-0.02250.02090.26090.23960.4895
510.09910.03050.02410.3330.27070.5203
520.1440.09890.04282.23040.76070.8722
530.16450.24990.084211.96473.00151.7325
540.15210.30590.121221.51446.08692.4672
550.1380.24820.139317.76847.75572.7849
560.13790.20330.147313.19978.43622.9045
570.15180.15170.14787.36138.31682.8839
580.19280.21930.15511.80218.66532.9437
590.2220.33480.171324.165410.07443.174
600.180.24380.177321.213711.00273.317



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