Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 18 Dec 2007 07:47:14 -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/2007/Dec/18/t11979882270jhstydxe0x027l.htm/, Retrieved Sat, 04 May 2024 19:29:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4532, Retrieved Sat, 04 May 2024 19:29:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact167
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecasting] [2007-12-18 14:47:14] [0c269222ff5238ed17e011dfedaec76b] [Current]
Feedback Forum

Post a new message
Dataseries X:
733.6
844.9
864.3
833.5
814.9
820.4
710.8
773.1
801.2
832.9
808.3
817.2
745.5
932.6
1057.0
879.9
1089.5
903.0
846.1
959.1
952.0
1092.5
1188.9
996.7
1034.3
898.2
1111.6
900.5
1049.2
1010.9
875.9
849.9
713.4
918.6
912.5
767.0
902.2
891.9
874.0
930.9
944.2
935.9
937.1
885.1
892.4
987.3
946.3
799.6
875.4
846.2
880.6
885.7
868.9
882.5
789.6
773.3
804.3
817.8
836.7
721.8




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

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

[TABLE]
[ROW][C]Summary of compuational 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]2 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=4532&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4532&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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])
36767-------
37902.2-------
38891.9-------
39874-------
40930.9-------
41944.2-------
42935.9-------
43937.1-------
44885.1-------
45892.4-------
46987.3-------
47946.3-------
48799.6-------
49875.4899.9516728.97011070.93320.38920.8750.48970.875
50846.2868.8799683.19861054.56130.40540.47260.4040.7677
51880.6872.8159661.90871083.72320.47120.59770.49560.7519
52885.7880.504647.32061113.68740.48260.49970.33590.7518
53868.9889.0389637.45791140.61990.43770.51040.33370.757
54882.5882.0565612.58061151.53240.49870.53810.34770.7257
55789.6872.6168586.77481158.45870.28460.4730.32920.6917
56773.3850.8762549.70531152.04710.30680.6550.41190.6307
57804.3843.5332527.8831159.18340.40380.66860.38080.6075
58817.8884.4772555.13831213.8160.34580.68340.27030.6933
59836.7867.6619525.30431210.01960.42970.61240.32630.6516
60721.8807.2606452.48441162.03680.31840.43540.51690.5169

\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 & 767 & - & - & - & - & - & - & - \tabularnewline
37 & 902.2 & - & - & - & - & - & - & - \tabularnewline
38 & 891.9 & - & - & - & - & - & - & - \tabularnewline
39 & 874 & - & - & - & - & - & - & - \tabularnewline
40 & 930.9 & - & - & - & - & - & - & - \tabularnewline
41 & 944.2 & - & - & - & - & - & - & - \tabularnewline
42 & 935.9 & - & - & - & - & - & - & - \tabularnewline
43 & 937.1 & - & - & - & - & - & - & - \tabularnewline
44 & 885.1 & - & - & - & - & - & - & - \tabularnewline
45 & 892.4 & - & - & - & - & - & - & - \tabularnewline
46 & 987.3 & - & - & - & - & - & - & - \tabularnewline
47 & 946.3 & - & - & - & - & - & - & - \tabularnewline
48 & 799.6 & - & - & - & - & - & - & - \tabularnewline
49 & 875.4 & 899.9516 & 728.9701 & 1070.9332 & 0.3892 & 0.875 & 0.4897 & 0.875 \tabularnewline
50 & 846.2 & 868.8799 & 683.1986 & 1054.5613 & 0.4054 & 0.4726 & 0.404 & 0.7677 \tabularnewline
51 & 880.6 & 872.8159 & 661.9087 & 1083.7232 & 0.4712 & 0.5977 & 0.4956 & 0.7519 \tabularnewline
52 & 885.7 & 880.504 & 647.3206 & 1113.6874 & 0.4826 & 0.4997 & 0.3359 & 0.7518 \tabularnewline
53 & 868.9 & 889.0389 & 637.4579 & 1140.6199 & 0.4377 & 0.5104 & 0.3337 & 0.757 \tabularnewline
54 & 882.5 & 882.0565 & 612.5806 & 1151.5324 & 0.4987 & 0.5381 & 0.3477 & 0.7257 \tabularnewline
55 & 789.6 & 872.6168 & 586.7748 & 1158.4587 & 0.2846 & 0.473 & 0.3292 & 0.6917 \tabularnewline
56 & 773.3 & 850.8762 & 549.7053 & 1152.0471 & 0.3068 & 0.655 & 0.4119 & 0.6307 \tabularnewline
57 & 804.3 & 843.5332 & 527.883 & 1159.1834 & 0.4038 & 0.6686 & 0.3808 & 0.6075 \tabularnewline
58 & 817.8 & 884.4772 & 555.1383 & 1213.816 & 0.3458 & 0.6834 & 0.2703 & 0.6933 \tabularnewline
59 & 836.7 & 867.6619 & 525.3043 & 1210.0196 & 0.4297 & 0.6124 & 0.3263 & 0.6516 \tabularnewline
60 & 721.8 & 807.2606 & 452.4844 & 1162.0368 & 0.3184 & 0.4354 & 0.5169 & 0.5169 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4532&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]767[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]902.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]891.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]874[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]930.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]944.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]935.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]937.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]885.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]892.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]987.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]946.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]799.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]875.4[/C][C]899.9516[/C][C]728.9701[/C][C]1070.9332[/C][C]0.3892[/C][C]0.875[/C][C]0.4897[/C][C]0.875[/C][/ROW]
[ROW][C]50[/C][C]846.2[/C][C]868.8799[/C][C]683.1986[/C][C]1054.5613[/C][C]0.4054[/C][C]0.4726[/C][C]0.404[/C][C]0.7677[/C][/ROW]
[ROW][C]51[/C][C]880.6[/C][C]872.8159[/C][C]661.9087[/C][C]1083.7232[/C][C]0.4712[/C][C]0.5977[/C][C]0.4956[/C][C]0.7519[/C][/ROW]
[ROW][C]52[/C][C]885.7[/C][C]880.504[/C][C]647.3206[/C][C]1113.6874[/C][C]0.4826[/C][C]0.4997[/C][C]0.3359[/C][C]0.7518[/C][/ROW]
[ROW][C]53[/C][C]868.9[/C][C]889.0389[/C][C]637.4579[/C][C]1140.6199[/C][C]0.4377[/C][C]0.5104[/C][C]0.3337[/C][C]0.757[/C][/ROW]
[ROW][C]54[/C][C]882.5[/C][C]882.0565[/C][C]612.5806[/C][C]1151.5324[/C][C]0.4987[/C][C]0.5381[/C][C]0.3477[/C][C]0.7257[/C][/ROW]
[ROW][C]55[/C][C]789.6[/C][C]872.6168[/C][C]586.7748[/C][C]1158.4587[/C][C]0.2846[/C][C]0.473[/C][C]0.3292[/C][C]0.6917[/C][/ROW]
[ROW][C]56[/C][C]773.3[/C][C]850.8762[/C][C]549.7053[/C][C]1152.0471[/C][C]0.3068[/C][C]0.655[/C][C]0.4119[/C][C]0.6307[/C][/ROW]
[ROW][C]57[/C][C]804.3[/C][C]843.5332[/C][C]527.883[/C][C]1159.1834[/C][C]0.4038[/C][C]0.6686[/C][C]0.3808[/C][C]0.6075[/C][/ROW]
[ROW][C]58[/C][C]817.8[/C][C]884.4772[/C][C]555.1383[/C][C]1213.816[/C][C]0.3458[/C][C]0.6834[/C][C]0.2703[/C][C]0.6933[/C][/ROW]
[ROW][C]59[/C][C]836.7[/C][C]867.6619[/C][C]525.3043[/C][C]1210.0196[/C][C]0.4297[/C][C]0.6124[/C][C]0.3263[/C][C]0.6516[/C][/ROW]
[ROW][C]60[/C][C]721.8[/C][C]807.2606[/C][C]452.4844[/C][C]1162.0368[/C][C]0.3184[/C][C]0.4354[/C][C]0.5169[/C][C]0.5169[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4532&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4532&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])
36767-------
37902.2-------
38891.9-------
39874-------
40930.9-------
41944.2-------
42935.9-------
43937.1-------
44885.1-------
45892.4-------
46987.3-------
47946.3-------
48799.6-------
49875.4899.9516728.97011070.93320.38920.8750.48970.875
50846.2868.8799683.19861054.56130.40540.47260.4040.7677
51880.6872.8159661.90871083.72320.47120.59770.49560.7519
52885.7880.504647.32061113.68740.48260.49970.33590.7518
53868.9889.0389637.45791140.61990.43770.51040.33370.757
54882.5882.0565612.58061151.53240.49870.53810.34770.7257
55789.6872.6168586.77481158.45870.28460.4730.32920.6917
56773.3850.8762549.70531152.04710.30680.6550.41190.6307
57804.3843.5332527.8831159.18340.40380.66860.38080.6075
58817.8884.4772555.13831213.8160.34580.68340.27030.6933
59836.7867.6619525.30431210.01960.42970.61240.32630.6516
60721.8807.2606452.48441162.03680.31840.43540.51690.5169







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0969-0.02730.0023602.783350.23197.0874
500.109-0.02610.0022514.379942.8656.5471
510.12330.00897e-0460.59155.04932.2471
520.13510.00595e-0426.99842.24991.5
530.1444-0.02270.0019405.574333.79795.8136
540.15595e-0400.19670.01640.128
550.1671-0.09510.00796891.7885574.315723.9649
560.1806-0.09120.00766018.0681501.505722.3943
570.1909-0.04650.00391539.2407128.270111.3256
580.19-0.07540.00634445.8429370.486919.248
590.2013-0.03570.003958.641679.88688.9379
600.2242-0.10590.00887303.5164608.626424.6704

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0969 & -0.0273 & 0.0023 & 602.7833 & 50.2319 & 7.0874 \tabularnewline
50 & 0.109 & -0.0261 & 0.0022 & 514.3799 & 42.865 & 6.5471 \tabularnewline
51 & 0.1233 & 0.0089 & 7e-04 & 60.5915 & 5.0493 & 2.2471 \tabularnewline
52 & 0.1351 & 0.0059 & 5e-04 & 26.9984 & 2.2499 & 1.5 \tabularnewline
53 & 0.1444 & -0.0227 & 0.0019 & 405.5743 & 33.7979 & 5.8136 \tabularnewline
54 & 0.1559 & 5e-04 & 0 & 0.1967 & 0.0164 & 0.128 \tabularnewline
55 & 0.1671 & -0.0951 & 0.0079 & 6891.7885 & 574.3157 & 23.9649 \tabularnewline
56 & 0.1806 & -0.0912 & 0.0076 & 6018.0681 & 501.5057 & 22.3943 \tabularnewline
57 & 0.1909 & -0.0465 & 0.0039 & 1539.2407 & 128.2701 & 11.3256 \tabularnewline
58 & 0.19 & -0.0754 & 0.0063 & 4445.8429 & 370.4869 & 19.248 \tabularnewline
59 & 0.2013 & -0.0357 & 0.003 & 958.6416 & 79.8868 & 8.9379 \tabularnewline
60 & 0.2242 & -0.1059 & 0.0088 & 7303.5164 & 608.6264 & 24.6704 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4532&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.0969[/C][C]-0.0273[/C][C]0.0023[/C][C]602.7833[/C][C]50.2319[/C][C]7.0874[/C][/ROW]
[ROW][C]50[/C][C]0.109[/C][C]-0.0261[/C][C]0.0022[/C][C]514.3799[/C][C]42.865[/C][C]6.5471[/C][/ROW]
[ROW][C]51[/C][C]0.1233[/C][C]0.0089[/C][C]7e-04[/C][C]60.5915[/C][C]5.0493[/C][C]2.2471[/C][/ROW]
[ROW][C]52[/C][C]0.1351[/C][C]0.0059[/C][C]5e-04[/C][C]26.9984[/C][C]2.2499[/C][C]1.5[/C][/ROW]
[ROW][C]53[/C][C]0.1444[/C][C]-0.0227[/C][C]0.0019[/C][C]405.5743[/C][C]33.7979[/C][C]5.8136[/C][/ROW]
[ROW][C]54[/C][C]0.1559[/C][C]5e-04[/C][C]0[/C][C]0.1967[/C][C]0.0164[/C][C]0.128[/C][/ROW]
[ROW][C]55[/C][C]0.1671[/C][C]-0.0951[/C][C]0.0079[/C][C]6891.7885[/C][C]574.3157[/C][C]23.9649[/C][/ROW]
[ROW][C]56[/C][C]0.1806[/C][C]-0.0912[/C][C]0.0076[/C][C]6018.0681[/C][C]501.5057[/C][C]22.3943[/C][/ROW]
[ROW][C]57[/C][C]0.1909[/C][C]-0.0465[/C][C]0.0039[/C][C]1539.2407[/C][C]128.2701[/C][C]11.3256[/C][/ROW]
[ROW][C]58[/C][C]0.19[/C][C]-0.0754[/C][C]0.0063[/C][C]4445.8429[/C][C]370.4869[/C][C]19.248[/C][/ROW]
[ROW][C]59[/C][C]0.2013[/C][C]-0.0357[/C][C]0.003[/C][C]958.6416[/C][C]79.8868[/C][C]8.9379[/C][/ROW]
[ROW][C]60[/C][C]0.2242[/C][C]-0.1059[/C][C]0.0088[/C][C]7303.5164[/C][C]608.6264[/C][C]24.6704[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4532&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4532&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.0969-0.02730.0023602.783350.23197.0874
500.109-0.02610.0022514.379942.8656.5471
510.12330.00897e-0460.59155.04932.2471
520.13510.00595e-0426.99842.24991.5
530.1444-0.02270.0019405.574333.79795.8136
540.15595e-0400.19670.01640.128
550.1671-0.09510.00796891.7885574.315723.9649
560.1806-0.09120.00766018.0681501.505722.3943
570.1909-0.04650.00391539.2407128.270111.3256
580.19-0.07540.00634445.8429370.486919.248
590.2013-0.03570.003958.641679.88688.9379
600.2242-0.10590.00887303.5164608.626424.6704



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; 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,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.mape <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')