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, 05 Dec 2011 11:13:27 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/05/t1323101623yydzz9bs8joa1xd.htm/, Retrieved Fri, 19 Apr 2024 19:48:58 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=151028, Retrieved Fri, 19 Apr 2024 19:48:58 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact115
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [Univariate Data Series] [HPC Retail Sales] [2008-03-02 15:42:48] [74be16979710d4c4e7c6647856088456]
- RMPD  [Univariate Data Series] [] [2011-11-25 14:57:13] [493236dcc414c5f9e1823f06b33a5ad6]
- RMPD      [ARIMA Forecasting] [] [2011-12-05 16:13:27] [75a32e1bc492240bc1028714aca23077] [Current]
- R           [ARIMA Forecasting] [] [2011-12-21 22:18:32] [493236dcc414c5f9e1823f06b33a5ad6]
Feedback Forum

Post a new message
Dataseries X:
1.0622
1.0773
1.0807
1.0848
1.1582
1.1663
1.1372
1.1139
1.1222
1.1692
1.1702
1.2286
1.2613
1.2646
1.2262
1.1985
1.2007
1.2138
1.2266
1.2176
1.2218
1.249
1.2991
1.3408
1.3119
1.3014
1.3201
1.2938
1.2694
1.2165
1.2037
1.2292
1.2256
1.2015
1.1786
1.1856
1.2103
1.1938
1.202
1.2271
1.277
1.265
1.2684
1.2811
1.2727
1.2611
1.2881
1.3213
1.2999
1.3074
1.3242
1.3516
1.3511
1.3419
1.3716
1.3622
1.3896
1.4227
1.4684
1.457




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\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 & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151028&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]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151028&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151028&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'Gertrude Mary Cox' @ cox.wessa.net







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])
361.1856-------
371.2103-------
381.1938-------
391.202-------
401.2271-------
411.277-------
421.265-------
431.2684-------
441.2811-------
451.2727-------
461.2611-------
471.2881-------
481.3213-------
491.29991.32981.27821.38220.13150.62510.625
501.30741.32981.24151.42050.3140.7410.99840.573
511.32421.32981.21641.44720.46260.64590.98360.5566
521.35161.32981.19621.46910.37960.53150.92590.5477
531.35111.32981.17871.48810.39610.39370.74350.542
541.34191.32981.16331.50520.44630.4060.76560.5379
551.37161.32981.14921.52080.33410.45070.73570.5348
561.36221.32981.13621.53540.37880.34520.67890.5324
571.38961.32981.12421.54910.29650.38610.69520.5304
581.42271.32981.11281.5620.21650.30690.71910.5287
591.46841.32981.10211.57430.13330.22820.6310.5272
601.4571.32981.0921.58610.16530.14460.5260.526

\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 & 1.1856 & - & - & - & - & - & - & - \tabularnewline
37 & 1.2103 & - & - & - & - & - & - & - \tabularnewline
38 & 1.1938 & - & - & - & - & - & - & - \tabularnewline
39 & 1.202 & - & - & - & - & - & - & - \tabularnewline
40 & 1.2271 & - & - & - & - & - & - & - \tabularnewline
41 & 1.277 & - & - & - & - & - & - & - \tabularnewline
42 & 1.265 & - & - & - & - & - & - & - \tabularnewline
43 & 1.2684 & - & - & - & - & - & - & - \tabularnewline
44 & 1.2811 & - & - & - & - & - & - & - \tabularnewline
45 & 1.2727 & - & - & - & - & - & - & - \tabularnewline
46 & 1.2611 & - & - & - & - & - & - & - \tabularnewline
47 & 1.2881 & - & - & - & - & - & - & - \tabularnewline
48 & 1.3213 & - & - & - & - & - & - & - \tabularnewline
49 & 1.2999 & 1.3298 & 1.2782 & 1.3822 & 0.1315 & 0.625 & 1 & 0.625 \tabularnewline
50 & 1.3074 & 1.3298 & 1.2415 & 1.4205 & 0.314 & 0.741 & 0.9984 & 0.573 \tabularnewline
51 & 1.3242 & 1.3298 & 1.2164 & 1.4472 & 0.4626 & 0.6459 & 0.9836 & 0.5566 \tabularnewline
52 & 1.3516 & 1.3298 & 1.1962 & 1.4691 & 0.3796 & 0.5315 & 0.9259 & 0.5477 \tabularnewline
53 & 1.3511 & 1.3298 & 1.1787 & 1.4881 & 0.3961 & 0.3937 & 0.7435 & 0.542 \tabularnewline
54 & 1.3419 & 1.3298 & 1.1633 & 1.5052 & 0.4463 & 0.406 & 0.7656 & 0.5379 \tabularnewline
55 & 1.3716 & 1.3298 & 1.1492 & 1.5208 & 0.3341 & 0.4507 & 0.7357 & 0.5348 \tabularnewline
56 & 1.3622 & 1.3298 & 1.1362 & 1.5354 & 0.3788 & 0.3452 & 0.6789 & 0.5324 \tabularnewline
57 & 1.3896 & 1.3298 & 1.1242 & 1.5491 & 0.2965 & 0.3861 & 0.6952 & 0.5304 \tabularnewline
58 & 1.4227 & 1.3298 & 1.1128 & 1.562 & 0.2165 & 0.3069 & 0.7191 & 0.5287 \tabularnewline
59 & 1.4684 & 1.3298 & 1.1021 & 1.5743 & 0.1333 & 0.2282 & 0.631 & 0.5272 \tabularnewline
60 & 1.457 & 1.3298 & 1.092 & 1.5861 & 0.1653 & 0.1446 & 0.526 & 0.526 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151028&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]1.1856[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]1.2103[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]1.1938[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]1.202[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]1.2271[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]1.277[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]1.265[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]1.2684[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]1.2811[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]1.2727[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]1.2611[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]1.2881[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]1.3213[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]1.2999[/C][C]1.3298[/C][C]1.2782[/C][C]1.3822[/C][C]0.1315[/C][C]0.625[/C][C]1[/C][C]0.625[/C][/ROW]
[ROW][C]50[/C][C]1.3074[/C][C]1.3298[/C][C]1.2415[/C][C]1.4205[/C][C]0.314[/C][C]0.741[/C][C]0.9984[/C][C]0.573[/C][/ROW]
[ROW][C]51[/C][C]1.3242[/C][C]1.3298[/C][C]1.2164[/C][C]1.4472[/C][C]0.4626[/C][C]0.6459[/C][C]0.9836[/C][C]0.5566[/C][/ROW]
[ROW][C]52[/C][C]1.3516[/C][C]1.3298[/C][C]1.1962[/C][C]1.4691[/C][C]0.3796[/C][C]0.5315[/C][C]0.9259[/C][C]0.5477[/C][/ROW]
[ROW][C]53[/C][C]1.3511[/C][C]1.3298[/C][C]1.1787[/C][C]1.4881[/C][C]0.3961[/C][C]0.3937[/C][C]0.7435[/C][C]0.542[/C][/ROW]
[ROW][C]54[/C][C]1.3419[/C][C]1.3298[/C][C]1.1633[/C][C]1.5052[/C][C]0.4463[/C][C]0.406[/C][C]0.7656[/C][C]0.5379[/C][/ROW]
[ROW][C]55[/C][C]1.3716[/C][C]1.3298[/C][C]1.1492[/C][C]1.5208[/C][C]0.3341[/C][C]0.4507[/C][C]0.7357[/C][C]0.5348[/C][/ROW]
[ROW][C]56[/C][C]1.3622[/C][C]1.3298[/C][C]1.1362[/C][C]1.5354[/C][C]0.3788[/C][C]0.3452[/C][C]0.6789[/C][C]0.5324[/C][/ROW]
[ROW][C]57[/C][C]1.3896[/C][C]1.3298[/C][C]1.1242[/C][C]1.5491[/C][C]0.2965[/C][C]0.3861[/C][C]0.6952[/C][C]0.5304[/C][/ROW]
[ROW][C]58[/C][C]1.4227[/C][C]1.3298[/C][C]1.1128[/C][C]1.562[/C][C]0.2165[/C][C]0.3069[/C][C]0.7191[/C][C]0.5287[/C][/ROW]
[ROW][C]59[/C][C]1.4684[/C][C]1.3298[/C][C]1.1021[/C][C]1.5743[/C][C]0.1333[/C][C]0.2282[/C][C]0.631[/C][C]0.5272[/C][/ROW]
[ROW][C]60[/C][C]1.457[/C][C]1.3298[/C][C]1.092[/C][C]1.5861[/C][C]0.1653[/C][C]0.1446[/C][C]0.526[/C][C]0.526[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151028&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151028&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])
361.1856-------
371.2103-------
381.1938-------
391.202-------
401.2271-------
411.277-------
421.265-------
431.2684-------
441.2811-------
451.2727-------
461.2611-------
471.2881-------
481.3213-------
491.29991.32981.27821.38220.13150.62510.625
501.30741.32981.24151.42050.3140.7410.99840.573
511.32421.32981.21641.44720.46260.64590.98360.5566
521.35161.32981.19621.46910.37960.53150.92590.5477
531.35111.32981.17871.48810.39610.39370.74350.542
541.34191.32981.16331.50520.44630.4060.76560.5379
551.37161.32981.14921.52080.33410.45070.73570.5348
561.36221.32981.13621.53540.37880.34520.67890.5324
571.38961.32981.12421.54910.29650.38610.69520.5304
581.42271.32981.11281.5620.21650.30690.71910.5287
591.46841.32981.10211.57430.13330.22820.6310.5272
601.4571.32981.0921.58610.16530.14460.5260.526







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0201-0.022509e-0400
500.0348-0.01690.01975e-047e-040.0264
510.045-0.00420.014505e-040.0218
520.05340.01640.0155e-045e-040.0218
530.06070.0160.01525e-045e-040.0217
540.06730.00910.01421e-044e-040.0204
550.07330.03140.01660.00176e-040.0246
560.07890.02430.01760.0017e-040.0257
570.08410.0450.02060.00360.0010.0314
580.08910.06980.02560.00860.00170.0418
590.09380.10420.03270.01920.00330.0578
600.09830.09560.0380.01620.00440.0664

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0201 & -0.0225 & 0 & 9e-04 & 0 & 0 \tabularnewline
50 & 0.0348 & -0.0169 & 0.0197 & 5e-04 & 7e-04 & 0.0264 \tabularnewline
51 & 0.045 & -0.0042 & 0.0145 & 0 & 5e-04 & 0.0218 \tabularnewline
52 & 0.0534 & 0.0164 & 0.015 & 5e-04 & 5e-04 & 0.0218 \tabularnewline
53 & 0.0607 & 0.016 & 0.0152 & 5e-04 & 5e-04 & 0.0217 \tabularnewline
54 & 0.0673 & 0.0091 & 0.0142 & 1e-04 & 4e-04 & 0.0204 \tabularnewline
55 & 0.0733 & 0.0314 & 0.0166 & 0.0017 & 6e-04 & 0.0246 \tabularnewline
56 & 0.0789 & 0.0243 & 0.0176 & 0.001 & 7e-04 & 0.0257 \tabularnewline
57 & 0.0841 & 0.045 & 0.0206 & 0.0036 & 0.001 & 0.0314 \tabularnewline
58 & 0.0891 & 0.0698 & 0.0256 & 0.0086 & 0.0017 & 0.0418 \tabularnewline
59 & 0.0938 & 0.1042 & 0.0327 & 0.0192 & 0.0033 & 0.0578 \tabularnewline
60 & 0.0983 & 0.0956 & 0.038 & 0.0162 & 0.0044 & 0.0664 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151028&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.0201[/C][C]-0.0225[/C][C]0[/C][C]9e-04[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0348[/C][C]-0.0169[/C][C]0.0197[/C][C]5e-04[/C][C]7e-04[/C][C]0.0264[/C][/ROW]
[ROW][C]51[/C][C]0.045[/C][C]-0.0042[/C][C]0.0145[/C][C]0[/C][C]5e-04[/C][C]0.0218[/C][/ROW]
[ROW][C]52[/C][C]0.0534[/C][C]0.0164[/C][C]0.015[/C][C]5e-04[/C][C]5e-04[/C][C]0.0218[/C][/ROW]
[ROW][C]53[/C][C]0.0607[/C][C]0.016[/C][C]0.0152[/C][C]5e-04[/C][C]5e-04[/C][C]0.0217[/C][/ROW]
[ROW][C]54[/C][C]0.0673[/C][C]0.0091[/C][C]0.0142[/C][C]1e-04[/C][C]4e-04[/C][C]0.0204[/C][/ROW]
[ROW][C]55[/C][C]0.0733[/C][C]0.0314[/C][C]0.0166[/C][C]0.0017[/C][C]6e-04[/C][C]0.0246[/C][/ROW]
[ROW][C]56[/C][C]0.0789[/C][C]0.0243[/C][C]0.0176[/C][C]0.001[/C][C]7e-04[/C][C]0.0257[/C][/ROW]
[ROW][C]57[/C][C]0.0841[/C][C]0.045[/C][C]0.0206[/C][C]0.0036[/C][C]0.001[/C][C]0.0314[/C][/ROW]
[ROW][C]58[/C][C]0.0891[/C][C]0.0698[/C][C]0.0256[/C][C]0.0086[/C][C]0.0017[/C][C]0.0418[/C][/ROW]
[ROW][C]59[/C][C]0.0938[/C][C]0.1042[/C][C]0.0327[/C][C]0.0192[/C][C]0.0033[/C][C]0.0578[/C][/ROW]
[ROW][C]60[/C][C]0.0983[/C][C]0.0956[/C][C]0.038[/C][C]0.0162[/C][C]0.0044[/C][C]0.0664[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151028&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151028&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.0201-0.022509e-0400
500.0348-0.01690.01975e-047e-040.0264
510.045-0.00420.014505e-040.0218
520.05340.01640.0155e-045e-040.0218
530.06070.0160.01525e-045e-040.0217
540.06730.00910.01421e-044e-040.0204
550.07330.03140.01660.00176e-040.0246
560.07890.02430.01760.0017e-040.0257
570.08410.0450.02060.00360.0010.0314
580.08910.06980.02560.00860.00170.0418
590.09380.10420.03270.01920.00330.0578
600.09830.09560.0380.01620.00440.0664



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