Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 30 Dec 2009 10:47:35 -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/2009/Dec/30/t1262195314qngobirvyps8f65.htm/, Retrieved Sun, 28 Apr 2024 22:32:43 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71340, Retrieved Sun, 28 Apr 2024 22:32:43 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact89
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forecasting...] [2009-12-30 17:47:35] [dbd46bd47d5f87b1007a5a1708bef00e] [Current]
Feedback Forum

Post a new message
Dataseries X:
10070
10137
9984
9732
9103
9155
9308
9394
9948
10177
10002
9728
10002
10063
10018
9960
10236
10893
10756
10940
10997
10827
10166
10186
10457
10368
10244
10511
10812
10738
10171
9721
9897
9828
9924
10371
10846
10413
10709
10662
10570
10297
10635
10872
10296
10383
10431
10574
10653
10805
10872
10625
10407
10463
10556
10646
10702
11353
11346
11451
11964
12574
13031
13812
14544
14931
14886
16005
17064
15168
16050
15839
15137
14954
15648
15305
15579
16348
15928
16171
15937
15713
15594
15683
16438
17032
17696
17745
19394
20148
20108
18584
18441
18391
19178
18079
18483
19644
19195
19650
20830
23595
22937
21814
21928
21777
21383
21467
22052
22680
24320




Summary of computational 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 computational 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=71340&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]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=71340&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71340&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 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[99])
8717696-------
8817745-------
8919394-------
9020148-------
9120108-------
9218584-------
9318441-------
9418391-------
9519178-------
9618079-------
9718483-------
9819644-------
9919195-------
1001965019195.230218176.423320214.03710.19080.50020.99740.5002
1012083019202.977117762.166620643.78760.01340.27160.39750.5043
1022359519206.519417441.894120971.144600.03570.14780.5051
1032293719206.331517168.717721243.94522e-0400.19290.5043
1042181419199.171816921.050421477.29320.01227e-040.70170.5014
1052192819198.516702.94321694.0570.0160.020.72410.5011
1062177719198.265116502.755421893.77470.03040.02360.72140.5009
1072138319201.962416320.341422083.58340.0690.03990.50650.5019
1082146719196.799316140.378722253.21990.07270.08050.76330.5005
1092205219198.697315976.947122420.44750.04130.08380.66840.5009
1102268019204.151615825.151522583.15170.02190.04930.39930.5021
1112432019202.042215672.791722731.29280.00220.02670.50160.5016

\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[99]) \tabularnewline
87 & 17696 & - & - & - & - & - & - & - \tabularnewline
88 & 17745 & - & - & - & - & - & - & - \tabularnewline
89 & 19394 & - & - & - & - & - & - & - \tabularnewline
90 & 20148 & - & - & - & - & - & - & - \tabularnewline
91 & 20108 & - & - & - & - & - & - & - \tabularnewline
92 & 18584 & - & - & - & - & - & - & - \tabularnewline
93 & 18441 & - & - & - & - & - & - & - \tabularnewline
94 & 18391 & - & - & - & - & - & - & - \tabularnewline
95 & 19178 & - & - & - & - & - & - & - \tabularnewline
96 & 18079 & - & - & - & - & - & - & - \tabularnewline
97 & 18483 & - & - & - & - & - & - & - \tabularnewline
98 & 19644 & - & - & - & - & - & - & - \tabularnewline
99 & 19195 & - & - & - & - & - & - & - \tabularnewline
100 & 19650 & 19195.2302 & 18176.4233 & 20214.0371 & 0.1908 & 0.5002 & 0.9974 & 0.5002 \tabularnewline
101 & 20830 & 19202.9771 & 17762.1666 & 20643.7876 & 0.0134 & 0.2716 & 0.3975 & 0.5043 \tabularnewline
102 & 23595 & 19206.5194 & 17441.8941 & 20971.1446 & 0 & 0.0357 & 0.1478 & 0.5051 \tabularnewline
103 & 22937 & 19206.3315 & 17168.7177 & 21243.9452 & 2e-04 & 0 & 0.1929 & 0.5043 \tabularnewline
104 & 21814 & 19199.1718 & 16921.0504 & 21477.2932 & 0.0122 & 7e-04 & 0.7017 & 0.5014 \tabularnewline
105 & 21928 & 19198.5 & 16702.943 & 21694.057 & 0.016 & 0.02 & 0.7241 & 0.5011 \tabularnewline
106 & 21777 & 19198.2651 & 16502.7554 & 21893.7747 & 0.0304 & 0.0236 & 0.7214 & 0.5009 \tabularnewline
107 & 21383 & 19201.9624 & 16320.3414 & 22083.5834 & 0.069 & 0.0399 & 0.5065 & 0.5019 \tabularnewline
108 & 21467 & 19196.7993 & 16140.3787 & 22253.2199 & 0.0727 & 0.0805 & 0.7633 & 0.5005 \tabularnewline
109 & 22052 & 19198.6973 & 15976.9471 & 22420.4475 & 0.0413 & 0.0838 & 0.6684 & 0.5009 \tabularnewline
110 & 22680 & 19204.1516 & 15825.1515 & 22583.1517 & 0.0219 & 0.0493 & 0.3993 & 0.5021 \tabularnewline
111 & 24320 & 19202.0422 & 15672.7917 & 22731.2928 & 0.0022 & 0.0267 & 0.5016 & 0.5016 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71340&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[99])[/C][/ROW]
[ROW][C]87[/C][C]17696[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]17745[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]19394[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]20148[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]20108[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]18584[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]18441[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]18391[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]19178[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]18079[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]18483[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]19644[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]19195[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]19650[/C][C]19195.2302[/C][C]18176.4233[/C][C]20214.0371[/C][C]0.1908[/C][C]0.5002[/C][C]0.9974[/C][C]0.5002[/C][/ROW]
[ROW][C]101[/C][C]20830[/C][C]19202.9771[/C][C]17762.1666[/C][C]20643.7876[/C][C]0.0134[/C][C]0.2716[/C][C]0.3975[/C][C]0.5043[/C][/ROW]
[ROW][C]102[/C][C]23595[/C][C]19206.5194[/C][C]17441.8941[/C][C]20971.1446[/C][C]0[/C][C]0.0357[/C][C]0.1478[/C][C]0.5051[/C][/ROW]
[ROW][C]103[/C][C]22937[/C][C]19206.3315[/C][C]17168.7177[/C][C]21243.9452[/C][C]2e-04[/C][C]0[/C][C]0.1929[/C][C]0.5043[/C][/ROW]
[ROW][C]104[/C][C]21814[/C][C]19199.1718[/C][C]16921.0504[/C][C]21477.2932[/C][C]0.0122[/C][C]7e-04[/C][C]0.7017[/C][C]0.5014[/C][/ROW]
[ROW][C]105[/C][C]21928[/C][C]19198.5[/C][C]16702.943[/C][C]21694.057[/C][C]0.016[/C][C]0.02[/C][C]0.7241[/C][C]0.5011[/C][/ROW]
[ROW][C]106[/C][C]21777[/C][C]19198.2651[/C][C]16502.7554[/C][C]21893.7747[/C][C]0.0304[/C][C]0.0236[/C][C]0.7214[/C][C]0.5009[/C][/ROW]
[ROW][C]107[/C][C]21383[/C][C]19201.9624[/C][C]16320.3414[/C][C]22083.5834[/C][C]0.069[/C][C]0.0399[/C][C]0.5065[/C][C]0.5019[/C][/ROW]
[ROW][C]108[/C][C]21467[/C][C]19196.7993[/C][C]16140.3787[/C][C]22253.2199[/C][C]0.0727[/C][C]0.0805[/C][C]0.7633[/C][C]0.5005[/C][/ROW]
[ROW][C]109[/C][C]22052[/C][C]19198.6973[/C][C]15976.9471[/C][C]22420.4475[/C][C]0.0413[/C][C]0.0838[/C][C]0.6684[/C][C]0.5009[/C][/ROW]
[ROW][C]110[/C][C]22680[/C][C]19204.1516[/C][C]15825.1515[/C][C]22583.1517[/C][C]0.0219[/C][C]0.0493[/C][C]0.3993[/C][C]0.5021[/C][/ROW]
[ROW][C]111[/C][C]24320[/C][C]19202.0422[/C][C]15672.7917[/C][C]22731.2928[/C][C]0.0022[/C][C]0.0267[/C][C]0.5016[/C][C]0.5016[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71340&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71340&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[99])
8717696-------
8817745-------
8919394-------
9020148-------
9120108-------
9218584-------
9318441-------
9418391-------
9519178-------
9618079-------
9718483-------
9819644-------
9919195-------
1001965019195.230218176.423320214.03710.19080.50020.99740.5002
1012083019202.977117762.166620643.78760.01340.27160.39750.5043
1022359519206.519417441.894120971.144600.03570.14780.5051
1032293719206.331517168.717721243.94522e-0400.19290.5043
1042181419199.171816921.050421477.29320.01227e-040.70170.5014
1052192819198.516702.94321694.0570.0160.020.72410.5011
1062177719198.265116502.755421893.77470.03040.02360.72140.5009
1072138319201.962416320.341422083.58340.0690.03990.50650.5019
1082146719196.799316140.378722253.21990.07270.08050.76330.5005
1092205219198.697315976.947122420.44750.04130.08380.66840.5009
1102268019204.151615825.151522583.15170.02190.04930.39930.5021
1112432019202.042215672.791722731.29280.00220.02670.50160.5016







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1000.02710.02370206815.571500
1010.03830.08470.05422647203.46721427009.51941194.575
1020.04690.22850.112319258762.25787370927.09882714.9451
1030.05410.19420.132813917887.82969007667.28153001.2776
1040.06050.13620.13356837326.63258573599.15172928.0709
1050.06630.14220.13497450170.40788386361.02772895.9214
1060.07160.13430.13486649873.82018138291.42662852.7691
1070.07660.11360.13224756925.19327715620.64752777.7006
1080.08120.11830.13065153811.15477430975.14832725.9815
1090.08560.14860.13248141336.3847502011.27182738.98
1100.08980.1810.136812081522.0847918330.43662813.9528
1110.09380.26650.147726193491.79979441260.55023072.6634

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
100 & 0.0271 & 0.0237 & 0 & 206815.5715 & 0 & 0 \tabularnewline
101 & 0.0383 & 0.0847 & 0.0542 & 2647203.4672 & 1427009.5194 & 1194.575 \tabularnewline
102 & 0.0469 & 0.2285 & 0.1123 & 19258762.2578 & 7370927.0988 & 2714.9451 \tabularnewline
103 & 0.0541 & 0.1942 & 0.1328 & 13917887.8296 & 9007667.2815 & 3001.2776 \tabularnewline
104 & 0.0605 & 0.1362 & 0.1335 & 6837326.6325 & 8573599.1517 & 2928.0709 \tabularnewline
105 & 0.0663 & 0.1422 & 0.1349 & 7450170.4078 & 8386361.0277 & 2895.9214 \tabularnewline
106 & 0.0716 & 0.1343 & 0.1348 & 6649873.8201 & 8138291.4266 & 2852.7691 \tabularnewline
107 & 0.0766 & 0.1136 & 0.1322 & 4756925.1932 & 7715620.6475 & 2777.7006 \tabularnewline
108 & 0.0812 & 0.1183 & 0.1306 & 5153811.1547 & 7430975.1483 & 2725.9815 \tabularnewline
109 & 0.0856 & 0.1486 & 0.1324 & 8141336.384 & 7502011.2718 & 2738.98 \tabularnewline
110 & 0.0898 & 0.181 & 0.1368 & 12081522.084 & 7918330.4366 & 2813.9528 \tabularnewline
111 & 0.0938 & 0.2665 & 0.1477 & 26193491.7997 & 9441260.5502 & 3072.6634 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71340&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]100[/C][C]0.0271[/C][C]0.0237[/C][C]0[/C][C]206815.5715[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]101[/C][C]0.0383[/C][C]0.0847[/C][C]0.0542[/C][C]2647203.4672[/C][C]1427009.5194[/C][C]1194.575[/C][/ROW]
[ROW][C]102[/C][C]0.0469[/C][C]0.2285[/C][C]0.1123[/C][C]19258762.2578[/C][C]7370927.0988[/C][C]2714.9451[/C][/ROW]
[ROW][C]103[/C][C]0.0541[/C][C]0.1942[/C][C]0.1328[/C][C]13917887.8296[/C][C]9007667.2815[/C][C]3001.2776[/C][/ROW]
[ROW][C]104[/C][C]0.0605[/C][C]0.1362[/C][C]0.1335[/C][C]6837326.6325[/C][C]8573599.1517[/C][C]2928.0709[/C][/ROW]
[ROW][C]105[/C][C]0.0663[/C][C]0.1422[/C][C]0.1349[/C][C]7450170.4078[/C][C]8386361.0277[/C][C]2895.9214[/C][/ROW]
[ROW][C]106[/C][C]0.0716[/C][C]0.1343[/C][C]0.1348[/C][C]6649873.8201[/C][C]8138291.4266[/C][C]2852.7691[/C][/ROW]
[ROW][C]107[/C][C]0.0766[/C][C]0.1136[/C][C]0.1322[/C][C]4756925.1932[/C][C]7715620.6475[/C][C]2777.7006[/C][/ROW]
[ROW][C]108[/C][C]0.0812[/C][C]0.1183[/C][C]0.1306[/C][C]5153811.1547[/C][C]7430975.1483[/C][C]2725.9815[/C][/ROW]
[ROW][C]109[/C][C]0.0856[/C][C]0.1486[/C][C]0.1324[/C][C]8141336.384[/C][C]7502011.2718[/C][C]2738.98[/C][/ROW]
[ROW][C]110[/C][C]0.0898[/C][C]0.181[/C][C]0.1368[/C][C]12081522.084[/C][C]7918330.4366[/C][C]2813.9528[/C][/ROW]
[ROW][C]111[/C][C]0.0938[/C][C]0.2665[/C][C]0.1477[/C][C]26193491.7997[/C][C]9441260.5502[/C][C]3072.6634[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71340&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71340&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
1000.02710.02370206815.571500
1010.03830.08470.05422647203.46721427009.51941194.575
1020.04690.22850.112319258762.25787370927.09882714.9451
1030.05410.19420.132813917887.82969007667.28153001.2776
1040.06050.13620.13356837326.63258573599.15172928.0709
1050.06630.14220.13497450170.40788386361.02772895.9214
1060.07160.13430.13486649873.82018138291.42662852.7691
1070.07660.11360.13224756925.19327715620.64752777.7006
1080.08120.11830.13065153811.15477430975.14832725.9815
1090.08560.14860.13248141336.3847502011.27182738.98
1100.08980.1810.136812081522.0847918330.43662813.9528
1110.09380.26650.147726193491.79979441260.55023072.6634



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