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 computationTue, 18 Dec 2012 08:09:35 -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/2012/Dec/18/t1355836228zbr1veciifnrktn.htm/, Retrieved Tue, 23 Apr 2024 12:09:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=201413, Retrieved Tue, 23 Apr 2024 12:09:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact140
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima forecastin ...] [2012-12-18 13:09:35] [239167cccea8953a8e1721fd6db07280] [Current]
Feedback Forum

Post a new message
Dataseries X:
4143
4429
5219
4929
5761
5592
4163
4962
5208
4755
4491
5732
5731
5040
6102
4904
5369
5578
4619
4731
5011
5299
4146
4625
4736
4219
5116
4205
4121
5103
4300
4578
3809
5657
4248
3830
4736
4839
4411
4570
4104
4801
3953
3828
4440
4026
4109
4785
3224
3552
3940
3913
3681
4309
3830
4143
4087
3818
3380
3430
3458
3970
5260
5024
5634
6549
4676




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=201413&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[55])
433953-------
443828-------
454440-------
464026-------
474109-------
484785-------
493224-------
503552-------
513940-------
523913-------
533681-------
544309-------
553830-------
5641433846.51443219.6884754.34760.26110.51420.51590.5142
5740874079.53993369.82635139.4970.49450.45330.25250.6778
5838183887.85033214.9494890.29660.44570.34850.39350.545
5933803908.16553132.55895152.91480.20280.55650.37590.549
6034303994.01313165.64425360.650.20930.81070.12830.593
6134583916.18753087.9975300.18060.25820.75440.83650.5486
6239703929.73063049.6855460.85910.47940.7270.68560.5508
6352603960.97983044.24245596.37710.05980.49570.510.5624
6450243929.41162998.5265621.27850.10240.06160.50760.5458
6556343936.91452971.58555742.98530.03280.11910.60940.5462
6665493948.1122954.67665850.06460.00370.04120.3550.5484
6746763935.38292923.47325912.18360.23140.00480.54160.5416

\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[55]) \tabularnewline
43 & 3953 & - & - & - & - & - & - & - \tabularnewline
44 & 3828 & - & - & - & - & - & - & - \tabularnewline
45 & 4440 & - & - & - & - & - & - & - \tabularnewline
46 & 4026 & - & - & - & - & - & - & - \tabularnewline
47 & 4109 & - & - & - & - & - & - & - \tabularnewline
48 & 4785 & - & - & - & - & - & - & - \tabularnewline
49 & 3224 & - & - & - & - & - & - & - \tabularnewline
50 & 3552 & - & - & - & - & - & - & - \tabularnewline
51 & 3940 & - & - & - & - & - & - & - \tabularnewline
52 & 3913 & - & - & - & - & - & - & - \tabularnewline
53 & 3681 & - & - & - & - & - & - & - \tabularnewline
54 & 4309 & - & - & - & - & - & - & - \tabularnewline
55 & 3830 & - & - & - & - & - & - & - \tabularnewline
56 & 4143 & 3846.5144 & 3219.688 & 4754.3476 & 0.2611 & 0.5142 & 0.5159 & 0.5142 \tabularnewline
57 & 4087 & 4079.5399 & 3369.8263 & 5139.497 & 0.4945 & 0.4533 & 0.2525 & 0.6778 \tabularnewline
58 & 3818 & 3887.8503 & 3214.949 & 4890.2966 & 0.4457 & 0.3485 & 0.3935 & 0.545 \tabularnewline
59 & 3380 & 3908.1655 & 3132.5589 & 5152.9148 & 0.2028 & 0.5565 & 0.3759 & 0.549 \tabularnewline
60 & 3430 & 3994.0131 & 3165.6442 & 5360.65 & 0.2093 & 0.8107 & 0.1283 & 0.593 \tabularnewline
61 & 3458 & 3916.1875 & 3087.997 & 5300.1806 & 0.2582 & 0.7544 & 0.8365 & 0.5486 \tabularnewline
62 & 3970 & 3929.7306 & 3049.685 & 5460.8591 & 0.4794 & 0.727 & 0.6856 & 0.5508 \tabularnewline
63 & 5260 & 3960.9798 & 3044.2424 & 5596.3771 & 0.0598 & 0.4957 & 0.51 & 0.5624 \tabularnewline
64 & 5024 & 3929.4116 & 2998.526 & 5621.2785 & 0.1024 & 0.0616 & 0.5076 & 0.5458 \tabularnewline
65 & 5634 & 3936.9145 & 2971.5855 & 5742.9853 & 0.0328 & 0.1191 & 0.6094 & 0.5462 \tabularnewline
66 & 6549 & 3948.112 & 2954.6766 & 5850.0646 & 0.0037 & 0.0412 & 0.355 & 0.5484 \tabularnewline
67 & 4676 & 3935.3829 & 2923.4732 & 5912.1836 & 0.2314 & 0.0048 & 0.5416 & 0.5416 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=201413&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[55])[/C][/ROW]
[ROW][C]43[/C][C]3953[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]3828[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4440[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]4026[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4109[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]4785[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]3224[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]3552[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]3940[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]3913[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]3681[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]4309[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]3830[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]4143[/C][C]3846.5144[/C][C]3219.688[/C][C]4754.3476[/C][C]0.2611[/C][C]0.5142[/C][C]0.5159[/C][C]0.5142[/C][/ROW]
[ROW][C]57[/C][C]4087[/C][C]4079.5399[/C][C]3369.8263[/C][C]5139.497[/C][C]0.4945[/C][C]0.4533[/C][C]0.2525[/C][C]0.6778[/C][/ROW]
[ROW][C]58[/C][C]3818[/C][C]3887.8503[/C][C]3214.949[/C][C]4890.2966[/C][C]0.4457[/C][C]0.3485[/C][C]0.3935[/C][C]0.545[/C][/ROW]
[ROW][C]59[/C][C]3380[/C][C]3908.1655[/C][C]3132.5589[/C][C]5152.9148[/C][C]0.2028[/C][C]0.5565[/C][C]0.3759[/C][C]0.549[/C][/ROW]
[ROW][C]60[/C][C]3430[/C][C]3994.0131[/C][C]3165.6442[/C][C]5360.65[/C][C]0.2093[/C][C]0.8107[/C][C]0.1283[/C][C]0.593[/C][/ROW]
[ROW][C]61[/C][C]3458[/C][C]3916.1875[/C][C]3087.997[/C][C]5300.1806[/C][C]0.2582[/C][C]0.7544[/C][C]0.8365[/C][C]0.5486[/C][/ROW]
[ROW][C]62[/C][C]3970[/C][C]3929.7306[/C][C]3049.685[/C][C]5460.8591[/C][C]0.4794[/C][C]0.727[/C][C]0.6856[/C][C]0.5508[/C][/ROW]
[ROW][C]63[/C][C]5260[/C][C]3960.9798[/C][C]3044.2424[/C][C]5596.3771[/C][C]0.0598[/C][C]0.4957[/C][C]0.51[/C][C]0.5624[/C][/ROW]
[ROW][C]64[/C][C]5024[/C][C]3929.4116[/C][C]2998.526[/C][C]5621.2785[/C][C]0.1024[/C][C]0.0616[/C][C]0.5076[/C][C]0.5458[/C][/ROW]
[ROW][C]65[/C][C]5634[/C][C]3936.9145[/C][C]2971.5855[/C][C]5742.9853[/C][C]0.0328[/C][C]0.1191[/C][C]0.6094[/C][C]0.5462[/C][/ROW]
[ROW][C]66[/C][C]6549[/C][C]3948.112[/C][C]2954.6766[/C][C]5850.0646[/C][C]0.0037[/C][C]0.0412[/C][C]0.355[/C][C]0.5484[/C][/ROW]
[ROW][C]67[/C][C]4676[/C][C]3935.3829[/C][C]2923.4732[/C][C]5912.1836[/C][C]0.2314[/C][C]0.0048[/C][C]0.5416[/C][C]0.5416[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=201413&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=201413&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[55])
433953-------
443828-------
454440-------
464026-------
474109-------
484785-------
493224-------
503552-------
513940-------
523913-------
533681-------
544309-------
553830-------
5641433846.51443219.6884754.34760.26110.51420.51590.5142
5740874079.53993369.82635139.4970.49450.45330.25250.6778
5838183887.85033214.9494890.29660.44570.34850.39350.545
5933803908.16553132.55895152.91480.20280.55650.37590.549
6034303994.01313165.64425360.650.20930.81070.12830.593
6134583916.18753087.9975300.18060.25820.75440.83650.5486
6239703929.73063049.6855460.85910.47940.7270.68560.5508
6352603960.97983044.24245596.37710.05980.49570.510.5624
6450243929.41162998.5265621.27850.10240.06160.50760.5458
6556343936.91452971.58555742.98530.03280.11910.60940.5462
6665493948.1122954.67665850.06460.00370.04120.3550.5484
6746763935.38292923.47325912.18360.23140.00480.54160.5416







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
560.12040.0771087903.731800
570.13260.00180.039555.653743979.6927209.7134
580.1316-0.0180.03234879.067430946.1509175.9152
590.1625-0.13510.058278958.746792949.2999304.8759
600.1746-0.14120.0746318110.7606137981.592371.4587
610.1803-0.1170.0817209935.8297149973.965387.2647
620.19880.01020.07151621.6282128780.774358.8604
630.21070.3280.10361687453.4926323614.8638568.8716
640.21970.27860.1231198123.672420782.5092648.6775
650.23410.43110.15382880099.0286666714.1611816.5257
660.24580.65880.19976764618.33781221069.08631105.0199
670.25630.18820.1988548513.64031165022.79911079.3622

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
56 & 0.1204 & 0.0771 & 0 & 87903.7318 & 0 & 0 \tabularnewline
57 & 0.1326 & 0.0018 & 0.0395 & 55.6537 & 43979.6927 & 209.7134 \tabularnewline
58 & 0.1316 & -0.018 & 0.0323 & 4879.0674 & 30946.1509 & 175.9152 \tabularnewline
59 & 0.1625 & -0.1351 & 0.058 & 278958.7467 & 92949.2999 & 304.8759 \tabularnewline
60 & 0.1746 & -0.1412 & 0.0746 & 318110.7606 & 137981.592 & 371.4587 \tabularnewline
61 & 0.1803 & -0.117 & 0.0817 & 209935.8297 & 149973.965 & 387.2647 \tabularnewline
62 & 0.1988 & 0.0102 & 0.0715 & 1621.6282 & 128780.774 & 358.8604 \tabularnewline
63 & 0.2107 & 0.328 & 0.1036 & 1687453.4926 & 323614.8638 & 568.8716 \tabularnewline
64 & 0.2197 & 0.2786 & 0.123 & 1198123.672 & 420782.5092 & 648.6775 \tabularnewline
65 & 0.2341 & 0.4311 & 0.1538 & 2880099.0286 & 666714.1611 & 816.5257 \tabularnewline
66 & 0.2458 & 0.6588 & 0.1997 & 6764618.3378 & 1221069.0863 & 1105.0199 \tabularnewline
67 & 0.2563 & 0.1882 & 0.1988 & 548513.6403 & 1165022.7991 & 1079.3622 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=201413&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]56[/C][C]0.1204[/C][C]0.0771[/C][C]0[/C][C]87903.7318[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]0.1326[/C][C]0.0018[/C][C]0.0395[/C][C]55.6537[/C][C]43979.6927[/C][C]209.7134[/C][/ROW]
[ROW][C]58[/C][C]0.1316[/C][C]-0.018[/C][C]0.0323[/C][C]4879.0674[/C][C]30946.1509[/C][C]175.9152[/C][/ROW]
[ROW][C]59[/C][C]0.1625[/C][C]-0.1351[/C][C]0.058[/C][C]278958.7467[/C][C]92949.2999[/C][C]304.8759[/C][/ROW]
[ROW][C]60[/C][C]0.1746[/C][C]-0.1412[/C][C]0.0746[/C][C]318110.7606[/C][C]137981.592[/C][C]371.4587[/C][/ROW]
[ROW][C]61[/C][C]0.1803[/C][C]-0.117[/C][C]0.0817[/C][C]209935.8297[/C][C]149973.965[/C][C]387.2647[/C][/ROW]
[ROW][C]62[/C][C]0.1988[/C][C]0.0102[/C][C]0.0715[/C][C]1621.6282[/C][C]128780.774[/C][C]358.8604[/C][/ROW]
[ROW][C]63[/C][C]0.2107[/C][C]0.328[/C][C]0.1036[/C][C]1687453.4926[/C][C]323614.8638[/C][C]568.8716[/C][/ROW]
[ROW][C]64[/C][C]0.2197[/C][C]0.2786[/C][C]0.123[/C][C]1198123.672[/C][C]420782.5092[/C][C]648.6775[/C][/ROW]
[ROW][C]65[/C][C]0.2341[/C][C]0.4311[/C][C]0.1538[/C][C]2880099.0286[/C][C]666714.1611[/C][C]816.5257[/C][/ROW]
[ROW][C]66[/C][C]0.2458[/C][C]0.6588[/C][C]0.1997[/C][C]6764618.3378[/C][C]1221069.0863[/C][C]1105.0199[/C][/ROW]
[ROW][C]67[/C][C]0.2563[/C][C]0.1882[/C][C]0.1988[/C][C]548513.6403[/C][C]1165022.7991[/C][C]1079.3622[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=201413&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=201413&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
560.12040.0771087903.731800
570.13260.00180.039555.653743979.6927209.7134
580.1316-0.0180.03234879.067430946.1509175.9152
590.1625-0.13510.058278958.746792949.2999304.8759
600.1746-0.14120.0746318110.7606137981.592371.4587
610.1803-0.1170.0817209935.8297149973.965387.2647
620.19880.01020.07151621.6282128780.774358.8604
630.21070.3280.10361687453.4926323614.8638568.8716
640.21970.27860.1231198123.672420782.5092648.6775
650.23410.43110.15382880099.0286666714.1611816.5257
660.24580.65880.19976764618.33781221069.08631105.0199
670.25630.18820.1988548513.64031165022.79911079.3622



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