Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 13 Dec 2007 13:10: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/2007/Dec/13/t11975757378n8q3r69wm1pct6.htm/, Retrieved Sun, 05 May 2024 16:28:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3705, Retrieved Sun, 05 May 2024 16:28:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsLise Swinnen
Estimated Impact211
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [paper (forecast) ...] [2007-12-13 20:10:20] [a526d213baffe7453818dd375c9a7100] [Current]
Feedback Forum

Post a new message
Dataseries X:
37702
30364
32609
30212
29965
28352
25814
22414
20506
28806
22228
13971
36845
35338
35022
34777
26887
23970
22780
17351
21382
24561
17409
11514
31514
27071
29462
26105
22397
23843
21705
18089
20764
25316
17704
15548
28029
29383
36438
32034
22679
24319
18004
17537
20366
22782
19169
13807
29743
25591
29096
26482
22405
27044
17970
18730
19684
19785
18479
10698




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3705&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])
3615548-------
3728029-------
3829383-------
3936438-------
4032034-------
4122679-------
4224319-------
4318004-------
4417537-------
4520366-------
4622782-------
4719169-------
4813807-------
492974330639.669424004.240140461.01680.4290.99960.69880.9996
502559128304.378122255.675337201.03940.2750.37560.40610.9993
512909633609.350725450.448746426.8580.2450.88990.33270.9988
522648228833.190922198.79338955.55060.32450.47970.26770.9982
532240522301.812417642.59329083.49270.48810.11350.45660.993
542704424304.024919025.683532127.35010.24620.68290.49850.9957
551797019339.269315514.785324774.08840.31070.00270.68490.977
561873017916.646614483.664922732.23190.37030.49130.56140.9528
571968420498.967416338.680226476.90120.39470.7190.51740.9859
581978523886.064118716.914831534.50040.14660.85920.61140.9951
591847918633.047914999.722123766.09320.47650.330.41890.9673
601069815105.223212412.545518779.50.00940.0360.75570.7557

\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 & 15548 & - & - & - & - & - & - & - \tabularnewline
37 & 28029 & - & - & - & - & - & - & - \tabularnewline
38 & 29383 & - & - & - & - & - & - & - \tabularnewline
39 & 36438 & - & - & - & - & - & - & - \tabularnewline
40 & 32034 & - & - & - & - & - & - & - \tabularnewline
41 & 22679 & - & - & - & - & - & - & - \tabularnewline
42 & 24319 & - & - & - & - & - & - & - \tabularnewline
43 & 18004 & - & - & - & - & - & - & - \tabularnewline
44 & 17537 & - & - & - & - & - & - & - \tabularnewline
45 & 20366 & - & - & - & - & - & - & - \tabularnewline
46 & 22782 & - & - & - & - & - & - & - \tabularnewline
47 & 19169 & - & - & - & - & - & - & - \tabularnewline
48 & 13807 & - & - & - & - & - & - & - \tabularnewline
49 & 29743 & 30639.6694 & 24004.2401 & 40461.0168 & 0.429 & 0.9996 & 0.6988 & 0.9996 \tabularnewline
50 & 25591 & 28304.3781 & 22255.6753 & 37201.0394 & 0.275 & 0.3756 & 0.4061 & 0.9993 \tabularnewline
51 & 29096 & 33609.3507 & 25450.4487 & 46426.858 & 0.245 & 0.8899 & 0.3327 & 0.9988 \tabularnewline
52 & 26482 & 28833.1909 & 22198.793 & 38955.5506 & 0.3245 & 0.4797 & 0.2677 & 0.9982 \tabularnewline
53 & 22405 & 22301.8124 & 17642.593 & 29083.4927 & 0.4881 & 0.1135 & 0.4566 & 0.993 \tabularnewline
54 & 27044 & 24304.0249 & 19025.6835 & 32127.3501 & 0.2462 & 0.6829 & 0.4985 & 0.9957 \tabularnewline
55 & 17970 & 19339.2693 & 15514.7853 & 24774.0884 & 0.3107 & 0.0027 & 0.6849 & 0.977 \tabularnewline
56 & 18730 & 17916.6466 & 14483.6649 & 22732.2319 & 0.3703 & 0.4913 & 0.5614 & 0.9528 \tabularnewline
57 & 19684 & 20498.9674 & 16338.6802 & 26476.9012 & 0.3947 & 0.719 & 0.5174 & 0.9859 \tabularnewline
58 & 19785 & 23886.0641 & 18716.9148 & 31534.5004 & 0.1466 & 0.8592 & 0.6114 & 0.9951 \tabularnewline
59 & 18479 & 18633.0479 & 14999.7221 & 23766.0932 & 0.4765 & 0.33 & 0.4189 & 0.9673 \tabularnewline
60 & 10698 & 15105.2232 & 12412.5455 & 18779.5 & 0.0094 & 0.036 & 0.7557 & 0.7557 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3705&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]15548[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]28029[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]29383[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]36438[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]32034[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]22679[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]24319[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]18004[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]17537[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]20366[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]22782[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]19169[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]13807[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]29743[/C][C]30639.6694[/C][C]24004.2401[/C][C]40461.0168[/C][C]0.429[/C][C]0.9996[/C][C]0.6988[/C][C]0.9996[/C][/ROW]
[ROW][C]50[/C][C]25591[/C][C]28304.3781[/C][C]22255.6753[/C][C]37201.0394[/C][C]0.275[/C][C]0.3756[/C][C]0.4061[/C][C]0.9993[/C][/ROW]
[ROW][C]51[/C][C]29096[/C][C]33609.3507[/C][C]25450.4487[/C][C]46426.858[/C][C]0.245[/C][C]0.8899[/C][C]0.3327[/C][C]0.9988[/C][/ROW]
[ROW][C]52[/C][C]26482[/C][C]28833.1909[/C][C]22198.793[/C][C]38955.5506[/C][C]0.3245[/C][C]0.4797[/C][C]0.2677[/C][C]0.9982[/C][/ROW]
[ROW][C]53[/C][C]22405[/C][C]22301.8124[/C][C]17642.593[/C][C]29083.4927[/C][C]0.4881[/C][C]0.1135[/C][C]0.4566[/C][C]0.993[/C][/ROW]
[ROW][C]54[/C][C]27044[/C][C]24304.0249[/C][C]19025.6835[/C][C]32127.3501[/C][C]0.2462[/C][C]0.6829[/C][C]0.4985[/C][C]0.9957[/C][/ROW]
[ROW][C]55[/C][C]17970[/C][C]19339.2693[/C][C]15514.7853[/C][C]24774.0884[/C][C]0.3107[/C][C]0.0027[/C][C]0.6849[/C][C]0.977[/C][/ROW]
[ROW][C]56[/C][C]18730[/C][C]17916.6466[/C][C]14483.6649[/C][C]22732.2319[/C][C]0.3703[/C][C]0.4913[/C][C]0.5614[/C][C]0.9528[/C][/ROW]
[ROW][C]57[/C][C]19684[/C][C]20498.9674[/C][C]16338.6802[/C][C]26476.9012[/C][C]0.3947[/C][C]0.719[/C][C]0.5174[/C][C]0.9859[/C][/ROW]
[ROW][C]58[/C][C]19785[/C][C]23886.0641[/C][C]18716.9148[/C][C]31534.5004[/C][C]0.1466[/C][C]0.8592[/C][C]0.6114[/C][C]0.9951[/C][/ROW]
[ROW][C]59[/C][C]18479[/C][C]18633.0479[/C][C]14999.7221[/C][C]23766.0932[/C][C]0.4765[/C][C]0.33[/C][C]0.4189[/C][C]0.9673[/C][/ROW]
[ROW][C]60[/C][C]10698[/C][C]15105.2232[/C][C]12412.5455[/C][C]18779.5[/C][C]0.0094[/C][C]0.036[/C][C]0.7557[/C][C]0.7557[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3705&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3705&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])
3615548-------
3728029-------
3829383-------
3936438-------
4032034-------
4122679-------
4224319-------
4318004-------
4417537-------
4520366-------
4622782-------
4719169-------
4813807-------
492974330639.669424004.240140461.01680.4290.99960.69880.9996
502559128304.378122255.675337201.03940.2750.37560.40610.9993
512909633609.350725450.448746426.8580.2450.88990.33270.9988
522648228833.190922198.79338955.55060.32450.47970.26770.9982
532240522301.812417642.59329083.49270.48810.11350.45660.993
542704424304.024919025.683532127.35010.24620.68290.49850.9957
551797019339.269315514.785324774.08840.31070.00270.68490.977
561873017916.646614483.664922732.23190.37030.49130.56140.9528
571968420498.967416338.680226476.90120.39470.7190.51740.9859
581978523886.064118716.914831534.50040.14660.85920.61140.9951
591847918633.047914999.722123766.09320.47650.330.41890.9673
601069815105.223212412.545518779.50.00940.0360.75570.7557







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.1635-0.02930.0024804015.972267001.331258.8462
500.1604-0.09590.0087362420.9842613535.082783.2848
510.1946-0.13430.011220370334.87791697527.90651302.8921
520.1791-0.08150.00685528098.5287460674.8774678.7303
530.15510.00464e-0410647.6882887.307329.7877
540.16420.11270.00947507463.3621625621.9468790.9627
550.1434-0.07080.00591874898.5435156241.5453395.274
560.13710.04540.0038661543.733555128.6445234.7949
570.1488-0.03980.0033664171.916755347.6597235.2608
580.1634-0.17170.014316818727.06781401560.5891183.8752
590.1406-0.00837e-0423730.7551977.562944.4698
600.1241-0.29180.024319423616.69831618634.72491272.2558

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1635 & -0.0293 & 0.0024 & 804015.9722 & 67001.331 & 258.8462 \tabularnewline
50 & 0.1604 & -0.0959 & 0.008 & 7362420.9842 & 613535.082 & 783.2848 \tabularnewline
51 & 0.1946 & -0.1343 & 0.0112 & 20370334.8779 & 1697527.9065 & 1302.8921 \tabularnewline
52 & 0.1791 & -0.0815 & 0.0068 & 5528098.5287 & 460674.8774 & 678.7303 \tabularnewline
53 & 0.1551 & 0.0046 & 4e-04 & 10647.6882 & 887.3073 & 29.7877 \tabularnewline
54 & 0.1642 & 0.1127 & 0.0094 & 7507463.3621 & 625621.9468 & 790.9627 \tabularnewline
55 & 0.1434 & -0.0708 & 0.0059 & 1874898.5435 & 156241.5453 & 395.274 \tabularnewline
56 & 0.1371 & 0.0454 & 0.0038 & 661543.7335 & 55128.6445 & 234.7949 \tabularnewline
57 & 0.1488 & -0.0398 & 0.0033 & 664171.9167 & 55347.6597 & 235.2608 \tabularnewline
58 & 0.1634 & -0.1717 & 0.0143 & 16818727.0678 & 1401560.589 & 1183.8752 \tabularnewline
59 & 0.1406 & -0.0083 & 7e-04 & 23730.755 & 1977.5629 & 44.4698 \tabularnewline
60 & 0.1241 & -0.2918 & 0.0243 & 19423616.6983 & 1618634.7249 & 1272.2558 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3705&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.1635[/C][C]-0.0293[/C][C]0.0024[/C][C]804015.9722[/C][C]67001.331[/C][C]258.8462[/C][/ROW]
[ROW][C]50[/C][C]0.1604[/C][C]-0.0959[/C][C]0.008[/C][C]7362420.9842[/C][C]613535.082[/C][C]783.2848[/C][/ROW]
[ROW][C]51[/C][C]0.1946[/C][C]-0.1343[/C][C]0.0112[/C][C]20370334.8779[/C][C]1697527.9065[/C][C]1302.8921[/C][/ROW]
[ROW][C]52[/C][C]0.1791[/C][C]-0.0815[/C][C]0.0068[/C][C]5528098.5287[/C][C]460674.8774[/C][C]678.7303[/C][/ROW]
[ROW][C]53[/C][C]0.1551[/C][C]0.0046[/C][C]4e-04[/C][C]10647.6882[/C][C]887.3073[/C][C]29.7877[/C][/ROW]
[ROW][C]54[/C][C]0.1642[/C][C]0.1127[/C][C]0.0094[/C][C]7507463.3621[/C][C]625621.9468[/C][C]790.9627[/C][/ROW]
[ROW][C]55[/C][C]0.1434[/C][C]-0.0708[/C][C]0.0059[/C][C]1874898.5435[/C][C]156241.5453[/C][C]395.274[/C][/ROW]
[ROW][C]56[/C][C]0.1371[/C][C]0.0454[/C][C]0.0038[/C][C]661543.7335[/C][C]55128.6445[/C][C]234.7949[/C][/ROW]
[ROW][C]57[/C][C]0.1488[/C][C]-0.0398[/C][C]0.0033[/C][C]664171.9167[/C][C]55347.6597[/C][C]235.2608[/C][/ROW]
[ROW][C]58[/C][C]0.1634[/C][C]-0.1717[/C][C]0.0143[/C][C]16818727.0678[/C][C]1401560.589[/C][C]1183.8752[/C][/ROW]
[ROW][C]59[/C][C]0.1406[/C][C]-0.0083[/C][C]7e-04[/C][C]23730.755[/C][C]1977.5629[/C][C]44.4698[/C][/ROW]
[ROW][C]60[/C][C]0.1241[/C][C]-0.2918[/C][C]0.0243[/C][C]19423616.6983[/C][C]1618634.7249[/C][C]1272.2558[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3705&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3705&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.1635-0.02930.0024804015.972267001.331258.8462
500.1604-0.09590.0087362420.9842613535.082783.2848
510.1946-0.13430.011220370334.87791697527.90651302.8921
520.1791-0.08150.00685528098.5287460674.8774678.7303
530.15510.00464e-0410647.6882887.307329.7877
540.16420.11270.00947507463.3621625621.9468790.9627
550.1434-0.07080.00591874898.5435156241.5453395.274
560.13710.04540.0038661543.733555128.6445234.7949
570.1488-0.03980.0033664171.916755347.6597235.2608
580.1634-0.17170.014316818727.06781401560.5891183.8752
590.1406-0.00837e-0423730.7551977.562944.4698
600.1241-0.29180.024319423616.69831618634.72491272.2558



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