Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 12 Dec 2007 12:35:54 -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/12/t11974873000h5ku99xbbzji8c.htm/, Retrieved Thu, 02 May 2024 19:35:53 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3263, Retrieved Thu, 02 May 2024 19:35:53 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact190
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Paper XIV ARIMA f...] [2007-12-12 19:35:54] [fd802f308f037a9692de8c23f8b60e49] [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 time1 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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3263&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]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=3263&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3263&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 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])
3615548-------
3728029-------
3829383-------
3936438-------
4032034-------
4122679-------
4224319-------
4318004-------
4417537-------
4520366-------
4622782-------
4719169-------
4813807-------
492974332964.737875382.18523045.19720.73781e-040.16471e-04
502559130337.65159720.624121833.20490.8630.44550.41291e-04
512909633461.83788867.140522877.40050.79060.07250.70921e-04
522648229291.21457102.241121125.91780.74990.48130.74491e-04
532240522967.088733843.217818002.80650.58780.91740.45471e-04
542704424217.17337346.325918665.55010.84090.26120.51431e-04
551797020118.60127146.091216373.85980.86960.99990.13425e-04
561873017863.878322722.038614975.02330.72160.52870.41220.003
571968420655.865928306.496516691.50810.68460.17050.4434e-04
581978524206.494137329.878918657.31550.94080.05510.30741e-04
591847918274.79523481.949315237.44060.55240.83510.7180.002
601069814468.777317087.206712666.7587110.23580.2358

\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 & 32964.7378 & 75382.185 & 23045.1972 & 0.7378 & 1e-04 & 0.1647 & 1e-04 \tabularnewline
50 & 25591 & 30337.651 & 59720.6241 & 21833.2049 & 0.863 & 0.4455 & 0.4129 & 1e-04 \tabularnewline
51 & 29096 & 33461.837 & 88867.1405 & 22877.4005 & 0.7906 & 0.0725 & 0.7092 & 1e-04 \tabularnewline
52 & 26482 & 29291.214 & 57102.2411 & 21125.9178 & 0.7499 & 0.4813 & 0.7449 & 1e-04 \tabularnewline
53 & 22405 & 22967.0887 & 33843.2178 & 18002.8065 & 0.5878 & 0.9174 & 0.4547 & 1e-04 \tabularnewline
54 & 27044 & 24217.173 & 37346.3259 & 18665.5501 & 0.8409 & 0.2612 & 0.5143 & 1e-04 \tabularnewline
55 & 17970 & 20118.601 & 27146.0912 & 16373.8598 & 0.8696 & 0.9999 & 0.1342 & 5e-04 \tabularnewline
56 & 18730 & 17863.8783 & 22722.0386 & 14975.0233 & 0.7216 & 0.5287 & 0.4122 & 0.003 \tabularnewline
57 & 19684 & 20655.8659 & 28306.4965 & 16691.5081 & 0.6846 & 0.1705 & 0.443 & 4e-04 \tabularnewline
58 & 19785 & 24206.4941 & 37329.8789 & 18657.3155 & 0.9408 & 0.0551 & 0.3074 & 1e-04 \tabularnewline
59 & 18479 & 18274.795 & 23481.9493 & 15237.4406 & 0.5524 & 0.8351 & 0.718 & 0.002 \tabularnewline
60 & 10698 & 14468.7773 & 17087.2067 & 12666.7587 & 1 & 1 & 0.2358 & 0.2358 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3263&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]32964.7378[/C][C]75382.185[/C][C]23045.1972[/C][C]0.7378[/C][C]1e-04[/C][C]0.1647[/C][C]1e-04[/C][/ROW]
[ROW][C]50[/C][C]25591[/C][C]30337.651[/C][C]59720.6241[/C][C]21833.2049[/C][C]0.863[/C][C]0.4455[/C][C]0.4129[/C][C]1e-04[/C][/ROW]
[ROW][C]51[/C][C]29096[/C][C]33461.837[/C][C]88867.1405[/C][C]22877.4005[/C][C]0.7906[/C][C]0.0725[/C][C]0.7092[/C][C]1e-04[/C][/ROW]
[ROW][C]52[/C][C]26482[/C][C]29291.214[/C][C]57102.2411[/C][C]21125.9178[/C][C]0.7499[/C][C]0.4813[/C][C]0.7449[/C][C]1e-04[/C][/ROW]
[ROW][C]53[/C][C]22405[/C][C]22967.0887[/C][C]33843.2178[/C][C]18002.8065[/C][C]0.5878[/C][C]0.9174[/C][C]0.4547[/C][C]1e-04[/C][/ROW]
[ROW][C]54[/C][C]27044[/C][C]24217.173[/C][C]37346.3259[/C][C]18665.5501[/C][C]0.8409[/C][C]0.2612[/C][C]0.5143[/C][C]1e-04[/C][/ROW]
[ROW][C]55[/C][C]17970[/C][C]20118.601[/C][C]27146.0912[/C][C]16373.8598[/C][C]0.8696[/C][C]0.9999[/C][C]0.1342[/C][C]5e-04[/C][/ROW]
[ROW][C]56[/C][C]18730[/C][C]17863.8783[/C][C]22722.0386[/C][C]14975.0233[/C][C]0.7216[/C][C]0.5287[/C][C]0.4122[/C][C]0.003[/C][/ROW]
[ROW][C]57[/C][C]19684[/C][C]20655.8659[/C][C]28306.4965[/C][C]16691.5081[/C][C]0.6846[/C][C]0.1705[/C][C]0.443[/C][C]4e-04[/C][/ROW]
[ROW][C]58[/C][C]19785[/C][C]24206.4941[/C][C]37329.8789[/C][C]18657.3155[/C][C]0.9408[/C][C]0.0551[/C][C]0.3074[/C][C]1e-04[/C][/ROW]
[ROW][C]59[/C][C]18479[/C][C]18274.795[/C][C]23481.9493[/C][C]15237.4406[/C][C]0.5524[/C][C]0.8351[/C][C]0.718[/C][C]0.002[/C][/ROW]
[ROW][C]60[/C][C]10698[/C][C]14468.7773[/C][C]17087.2067[/C][C]12666.7587[/C][C]1[/C][C]1[/C][C]0.2358[/C][C]0.2358[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3263&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3263&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-------
492974332964.737875382.18523045.19720.73781e-040.16471e-04
502559130337.65159720.624121833.20490.8630.44550.41291e-04
512909633461.83788867.140522877.40050.79060.07250.70921e-04
522648229291.21457102.241121125.91780.74990.48130.74491e-04
532240522967.088733843.217818002.80650.58780.91740.45471e-04
542704424217.17337346.325918665.55010.84090.26120.51431e-04
551797020118.60127146.091216373.85980.86960.99990.13425e-04
561873017863.878322722.038614975.02330.72160.52870.41220.003
571968420655.865928306.496516691.50810.68460.17050.4434e-04
581978524206.494137329.878918657.31550.94080.05510.30741e-04
591847918274.79523481.949315237.44060.55240.83510.7180.002
601069814468.777317087.206712666.7587110.23580.2358







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
49-0.1535-0.09770.008110379594.1848864966.1821930.0356
50-0.143-0.15650.01322530695.47111877557.95591370.2401
51-0.1614-0.13050.010919060532.94621588377.74551260.3086
52-0.1422-0.09590.0087891683.3186657640.2765810.9502
53-0.1103-0.02450.002315943.734426328.6445162.261
54-0.1170.11670.00977990950.8788665912.5732816.0347
55-0.095-0.10680.00894616486.216384707.1847620.2477
56-0.08250.04850.004750166.806262513.9005250.0278
57-0.0979-0.04710.0039944523.373878710.2811280.5535
58-0.117-0.18270.015219549610.09661629134.17471276.3754
59-0.08480.01129e-0441699.68943474.974158.9489
60-0.0635-0.26060.021714218761.3731184896.78111088.5296

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & -0.1535 & -0.0977 & 0.0081 & 10379594.1848 & 864966.1821 & 930.0356 \tabularnewline
50 & -0.143 & -0.1565 & 0.013 & 22530695.4711 & 1877557.9559 & 1370.2401 \tabularnewline
51 & -0.1614 & -0.1305 & 0.0109 & 19060532.9462 & 1588377.7455 & 1260.3086 \tabularnewline
52 & -0.1422 & -0.0959 & 0.008 & 7891683.3186 & 657640.2765 & 810.9502 \tabularnewline
53 & -0.1103 & -0.0245 & 0.002 & 315943.7344 & 26328.6445 & 162.261 \tabularnewline
54 & -0.117 & 0.1167 & 0.0097 & 7990950.8788 & 665912.5732 & 816.0347 \tabularnewline
55 & -0.095 & -0.1068 & 0.0089 & 4616486.216 & 384707.1847 & 620.2477 \tabularnewline
56 & -0.0825 & 0.0485 & 0.004 & 750166.8062 & 62513.9005 & 250.0278 \tabularnewline
57 & -0.0979 & -0.0471 & 0.0039 & 944523.3738 & 78710.2811 & 280.5535 \tabularnewline
58 & -0.117 & -0.1827 & 0.0152 & 19549610.0966 & 1629134.1747 & 1276.3754 \tabularnewline
59 & -0.0848 & 0.0112 & 9e-04 & 41699.6894 & 3474.9741 & 58.9489 \tabularnewline
60 & -0.0635 & -0.2606 & 0.0217 & 14218761.373 & 1184896.7811 & 1088.5296 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3263&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.1535[/C][C]-0.0977[/C][C]0.0081[/C][C]10379594.1848[/C][C]864966.1821[/C][C]930.0356[/C][/ROW]
[ROW][C]50[/C][C]-0.143[/C][C]-0.1565[/C][C]0.013[/C][C]22530695.4711[/C][C]1877557.9559[/C][C]1370.2401[/C][/ROW]
[ROW][C]51[/C][C]-0.1614[/C][C]-0.1305[/C][C]0.0109[/C][C]19060532.9462[/C][C]1588377.7455[/C][C]1260.3086[/C][/ROW]
[ROW][C]52[/C][C]-0.1422[/C][C]-0.0959[/C][C]0.008[/C][C]7891683.3186[/C][C]657640.2765[/C][C]810.9502[/C][/ROW]
[ROW][C]53[/C][C]-0.1103[/C][C]-0.0245[/C][C]0.002[/C][C]315943.7344[/C][C]26328.6445[/C][C]162.261[/C][/ROW]
[ROW][C]54[/C][C]-0.117[/C][C]0.1167[/C][C]0.0097[/C][C]7990950.8788[/C][C]665912.5732[/C][C]816.0347[/C][/ROW]
[ROW][C]55[/C][C]-0.095[/C][C]-0.1068[/C][C]0.0089[/C][C]4616486.216[/C][C]384707.1847[/C][C]620.2477[/C][/ROW]
[ROW][C]56[/C][C]-0.0825[/C][C]0.0485[/C][C]0.004[/C][C]750166.8062[/C][C]62513.9005[/C][C]250.0278[/C][/ROW]
[ROW][C]57[/C][C]-0.0979[/C][C]-0.0471[/C][C]0.0039[/C][C]944523.3738[/C][C]78710.2811[/C][C]280.5535[/C][/ROW]
[ROW][C]58[/C][C]-0.117[/C][C]-0.1827[/C][C]0.0152[/C][C]19549610.0966[/C][C]1629134.1747[/C][C]1276.3754[/C][/ROW]
[ROW][C]59[/C][C]-0.0848[/C][C]0.0112[/C][C]9e-04[/C][C]41699.6894[/C][C]3474.9741[/C][C]58.9489[/C][/ROW]
[ROW][C]60[/C][C]-0.0635[/C][C]-0.2606[/C][C]0.0217[/C][C]14218761.373[/C][C]1184896.7811[/C][C]1088.5296[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3263&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3263&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
49-0.1535-0.09770.008110379594.1848864966.1821930.0356
50-0.143-0.15650.01322530695.47111877557.95591370.2401
51-0.1614-0.13050.010919060532.94621588377.74551260.3086
52-0.1422-0.09590.0087891683.3186657640.2765810.9502
53-0.1103-0.02450.002315943.734426328.6445162.261
54-0.1170.11670.00977990950.8788665912.5732816.0347
55-0.095-0.10680.00894616486.216384707.1847620.2477
56-0.08250.04850.004750166.806262513.9005250.0278
57-0.0979-0.04710.0039944523.373878710.2811280.5535
58-0.117-0.18270.015219549610.09661629134.17471276.3754
59-0.08480.01129e-0441699.68943474.974158.9489
60-0.0635-0.26060.021714218761.3731184896.78111088.5296



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