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 computationWed, 29 Dec 2010 08:11:27 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/29/t1293610149ap6d911duypahhm.htm/, Retrieved Fri, 03 May 2024 11:02:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=116619, Retrieved Fri, 03 May 2024 11:02:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact149
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2010-12-29 08:11:27] [e569a00cc6e8044e6afea1f18dd335a0] [Current]
Feedback Forum

Post a new message
Dataseries X:
11974
10106
12069
11412
11180
10508
11288
10928
10199
11030
11234
13747
13912
12376
12264
11675
11271
10672
10933
10379
10187
10747
10970
12175
14200
11676
11258
10872
11148
10690
10684
11658
10178
10981
10773
11665
11359
10716
12928
12317
11641
10459
10953
10703
10703
11101
11334
13268
13145
12334
13153
11289
11374
10914
11299
11284
10694
11077
11104
12820
14915
11773
11608
11468
11511
11200
11164
10960
10667
11556
11372
12333
13102
11115
12572
11557
12059
11420
11185
11113
10706
11523
11391
12634
13469
11735
13281
11968
11623
11084
11509
11134
10438
11530
11491
13093
13106
11305
13113
12203
11309
11088
11234
11619
10942
11445
11291
13281
13726
11300
11983
11092
11093
10692
10786
11166
10553
11103
10969
12090
12544
12264
13783
11214
11453
10883
10381
10348
10024
10805
10796
11907
12261
11377
12689
11474
10992
10764
12164
10409
10398
10349
10865
11630
12221
10884
12019
11021
10799
10423
10484
10450
9906
11049
11281
12485
12849
11380
12079
11366
11328
10444
10854
10434
10137
10992
10906
12367
14371
11695
11546
10922
10670
10254
10573
10239
10253
11176
10719
11817




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 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 & 3 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116619&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]3 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=116619&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116619&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 time3 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[168])
15612485-------
15712849-------
15811380-------
15912079-------
16011366-------
16111328-------
16210444-------
16310854-------
16410434-------
16510137-------
16610992-------
16710906-------
16812367-------
1691437113024.75612075.707513973.80460.00270.91280.64170.9128
1701169511452.926810414.503912491.34970.323900.55470.0422
1711154612485.641111447.218213524.06390.03810.93220.77860.5886
1721092211494.855410456.432512533.27830.13980.46150.59610.0499
1731067011341.498310303.075412379.92120.10250.78580.51020.0265
1741025410802.92699764.504111841.34980.15010.59910.75090.0016
1751057311065.569810027.146912103.99270.17630.93720.65520.007
1761023910898.9279860.504111937.34980.10650.73080.80990.0028
1771025310409.4279371.004111447.84990.38390.62620.69641e-04
1781117611091.998410053.575512130.42120.4370.94340.57490.0081
1791071911126.926910088.50412165.34980.22070.46310.66170.0096
1801181712517.693511479.650813555.73610.09290.99970.6120.612

\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[168]) \tabularnewline
156 & 12485 & - & - & - & - & - & - & - \tabularnewline
157 & 12849 & - & - & - & - & - & - & - \tabularnewline
158 & 11380 & - & - & - & - & - & - & - \tabularnewline
159 & 12079 & - & - & - & - & - & - & - \tabularnewline
160 & 11366 & - & - & - & - & - & - & - \tabularnewline
161 & 11328 & - & - & - & - & - & - & - \tabularnewline
162 & 10444 & - & - & - & - & - & - & - \tabularnewline
163 & 10854 & - & - & - & - & - & - & - \tabularnewline
164 & 10434 & - & - & - & - & - & - & - \tabularnewline
165 & 10137 & - & - & - & - & - & - & - \tabularnewline
166 & 10992 & - & - & - & - & - & - & - \tabularnewline
167 & 10906 & - & - & - & - & - & - & - \tabularnewline
168 & 12367 & - & - & - & - & - & - & - \tabularnewline
169 & 14371 & 13024.756 & 12075.7075 & 13973.8046 & 0.0027 & 0.9128 & 0.6417 & 0.9128 \tabularnewline
170 & 11695 & 11452.9268 & 10414.5039 & 12491.3497 & 0.3239 & 0 & 0.5547 & 0.0422 \tabularnewline
171 & 11546 & 12485.6411 & 11447.2182 & 13524.0639 & 0.0381 & 0.9322 & 0.7786 & 0.5886 \tabularnewline
172 & 10922 & 11494.8554 & 10456.4325 & 12533.2783 & 0.1398 & 0.4615 & 0.5961 & 0.0499 \tabularnewline
173 & 10670 & 11341.4983 & 10303.0754 & 12379.9212 & 0.1025 & 0.7858 & 0.5102 & 0.0265 \tabularnewline
174 & 10254 & 10802.9269 & 9764.5041 & 11841.3498 & 0.1501 & 0.5991 & 0.7509 & 0.0016 \tabularnewline
175 & 10573 & 11065.5698 & 10027.1469 & 12103.9927 & 0.1763 & 0.9372 & 0.6552 & 0.007 \tabularnewline
176 & 10239 & 10898.927 & 9860.5041 & 11937.3498 & 0.1065 & 0.7308 & 0.8099 & 0.0028 \tabularnewline
177 & 10253 & 10409.427 & 9371.0041 & 11447.8499 & 0.3839 & 0.6262 & 0.6964 & 1e-04 \tabularnewline
178 & 11176 & 11091.9984 & 10053.5755 & 12130.4212 & 0.437 & 0.9434 & 0.5749 & 0.0081 \tabularnewline
179 & 10719 & 11126.9269 & 10088.504 & 12165.3498 & 0.2207 & 0.4631 & 0.6617 & 0.0096 \tabularnewline
180 & 11817 & 12517.6935 & 11479.6508 & 13555.7361 & 0.0929 & 0.9997 & 0.612 & 0.612 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116619&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[168])[/C][/ROW]
[ROW][C]156[/C][C]12485[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]157[/C][C]12849[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]158[/C][C]11380[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]159[/C][C]12079[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]160[/C][C]11366[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]161[/C][C]11328[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]162[/C][C]10444[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]163[/C][C]10854[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]164[/C][C]10434[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]165[/C][C]10137[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]166[/C][C]10992[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]167[/C][C]10906[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]168[/C][C]12367[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]169[/C][C]14371[/C][C]13024.756[/C][C]12075.7075[/C][C]13973.8046[/C][C]0.0027[/C][C]0.9128[/C][C]0.6417[/C][C]0.9128[/C][/ROW]
[ROW][C]170[/C][C]11695[/C][C]11452.9268[/C][C]10414.5039[/C][C]12491.3497[/C][C]0.3239[/C][C]0[/C][C]0.5547[/C][C]0.0422[/C][/ROW]
[ROW][C]171[/C][C]11546[/C][C]12485.6411[/C][C]11447.2182[/C][C]13524.0639[/C][C]0.0381[/C][C]0.9322[/C][C]0.7786[/C][C]0.5886[/C][/ROW]
[ROW][C]172[/C][C]10922[/C][C]11494.8554[/C][C]10456.4325[/C][C]12533.2783[/C][C]0.1398[/C][C]0.4615[/C][C]0.5961[/C][C]0.0499[/C][/ROW]
[ROW][C]173[/C][C]10670[/C][C]11341.4983[/C][C]10303.0754[/C][C]12379.9212[/C][C]0.1025[/C][C]0.7858[/C][C]0.5102[/C][C]0.0265[/C][/ROW]
[ROW][C]174[/C][C]10254[/C][C]10802.9269[/C][C]9764.5041[/C][C]11841.3498[/C][C]0.1501[/C][C]0.5991[/C][C]0.7509[/C][C]0.0016[/C][/ROW]
[ROW][C]175[/C][C]10573[/C][C]11065.5698[/C][C]10027.1469[/C][C]12103.9927[/C][C]0.1763[/C][C]0.9372[/C][C]0.6552[/C][C]0.007[/C][/ROW]
[ROW][C]176[/C][C]10239[/C][C]10898.927[/C][C]9860.5041[/C][C]11937.3498[/C][C]0.1065[/C][C]0.7308[/C][C]0.8099[/C][C]0.0028[/C][/ROW]
[ROW][C]177[/C][C]10253[/C][C]10409.427[/C][C]9371.0041[/C][C]11447.8499[/C][C]0.3839[/C][C]0.6262[/C][C]0.6964[/C][C]1e-04[/C][/ROW]
[ROW][C]178[/C][C]11176[/C][C]11091.9984[/C][C]10053.5755[/C][C]12130.4212[/C][C]0.437[/C][C]0.9434[/C][C]0.5749[/C][C]0.0081[/C][/ROW]
[ROW][C]179[/C][C]10719[/C][C]11126.9269[/C][C]10088.504[/C][C]12165.3498[/C][C]0.2207[/C][C]0.4631[/C][C]0.6617[/C][C]0.0096[/C][/ROW]
[ROW][C]180[/C][C]11817[/C][C]12517.6935[/C][C]11479.6508[/C][C]13555.7361[/C][C]0.0929[/C][C]0.9997[/C][C]0.612[/C][C]0.612[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116619&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116619&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[168])
15612485-------
15712849-------
15811380-------
15912079-------
16011366-------
16111328-------
16210444-------
16310854-------
16410434-------
16510137-------
16610992-------
16710906-------
16812367-------
1691437113024.75612075.707513973.80460.00270.91280.64170.9128
1701169511452.926810414.503912491.34970.323900.55470.0422
1711154612485.641111447.218213524.06390.03810.93220.77860.5886
1721092211494.855410456.432512533.27830.13980.46150.59610.0499
1731067011341.498310303.075412379.92120.10250.78580.51020.0265
1741025410802.92699764.504111841.34980.15010.59910.75090.0016
1751057311065.569810027.146912103.99270.17630.93720.65520.007
1761023910898.9279860.504111937.34980.10650.73080.80990.0028
1771025310409.4279371.004111447.84990.38390.62620.69641e-04
1781117611091.998410053.575512130.42120.4370.94340.57490.0081
1791071911126.926910088.50412165.34980.22070.46310.66170.0096
1801181712517.693511479.650813555.73610.09290.99970.6120.612







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1690.03720.103401812372.802900
1700.04630.02110.062258599.4443935486.1236967.2053
1710.0424-0.07530.0666882925.3195917965.8555958.1053
1720.0461-0.04980.0624328163.3109770515.2194877.79
1730.0467-0.05920.0618450909.9942706594.1743840.5916
1740.049-0.05080.0599301320.7793639048.6085799.4052
1750.0479-0.04450.0577242624.9994582416.6643763.1623
1760.0486-0.06050.0581435503.587564052.5297751.0343
1770.0509-0.0150.053324469.4005504098.8487709.9992
1780.04780.00760.04877056.2745454394.5912674.088
1790.0476-0.03670.0476166404.3364428213.659654.3804
1800.0423-0.0560.0483490971.3296433443.4649658.3642

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
169 & 0.0372 & 0.1034 & 0 & 1812372.8029 & 0 & 0 \tabularnewline
170 & 0.0463 & 0.0211 & 0.0622 & 58599.4443 & 935486.1236 & 967.2053 \tabularnewline
171 & 0.0424 & -0.0753 & 0.0666 & 882925.3195 & 917965.8555 & 958.1053 \tabularnewline
172 & 0.0461 & -0.0498 & 0.0624 & 328163.3109 & 770515.2194 & 877.79 \tabularnewline
173 & 0.0467 & -0.0592 & 0.0618 & 450909.9942 & 706594.1743 & 840.5916 \tabularnewline
174 & 0.049 & -0.0508 & 0.0599 & 301320.7793 & 639048.6085 & 799.4052 \tabularnewline
175 & 0.0479 & -0.0445 & 0.0577 & 242624.9994 & 582416.6643 & 763.1623 \tabularnewline
176 & 0.0486 & -0.0605 & 0.0581 & 435503.587 & 564052.5297 & 751.0343 \tabularnewline
177 & 0.0509 & -0.015 & 0.0533 & 24469.4005 & 504098.8487 & 709.9992 \tabularnewline
178 & 0.0478 & 0.0076 & 0.0487 & 7056.2745 & 454394.5912 & 674.088 \tabularnewline
179 & 0.0476 & -0.0367 & 0.0476 & 166404.3364 & 428213.659 & 654.3804 \tabularnewline
180 & 0.0423 & -0.056 & 0.0483 & 490971.3296 & 433443.4649 & 658.3642 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116619&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]169[/C][C]0.0372[/C][C]0.1034[/C][C]0[/C][C]1812372.8029[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]170[/C][C]0.0463[/C][C]0.0211[/C][C]0.0622[/C][C]58599.4443[/C][C]935486.1236[/C][C]967.2053[/C][/ROW]
[ROW][C]171[/C][C]0.0424[/C][C]-0.0753[/C][C]0.0666[/C][C]882925.3195[/C][C]917965.8555[/C][C]958.1053[/C][/ROW]
[ROW][C]172[/C][C]0.0461[/C][C]-0.0498[/C][C]0.0624[/C][C]328163.3109[/C][C]770515.2194[/C][C]877.79[/C][/ROW]
[ROW][C]173[/C][C]0.0467[/C][C]-0.0592[/C][C]0.0618[/C][C]450909.9942[/C][C]706594.1743[/C][C]840.5916[/C][/ROW]
[ROW][C]174[/C][C]0.049[/C][C]-0.0508[/C][C]0.0599[/C][C]301320.7793[/C][C]639048.6085[/C][C]799.4052[/C][/ROW]
[ROW][C]175[/C][C]0.0479[/C][C]-0.0445[/C][C]0.0577[/C][C]242624.9994[/C][C]582416.6643[/C][C]763.1623[/C][/ROW]
[ROW][C]176[/C][C]0.0486[/C][C]-0.0605[/C][C]0.0581[/C][C]435503.587[/C][C]564052.5297[/C][C]751.0343[/C][/ROW]
[ROW][C]177[/C][C]0.0509[/C][C]-0.015[/C][C]0.0533[/C][C]24469.4005[/C][C]504098.8487[/C][C]709.9992[/C][/ROW]
[ROW][C]178[/C][C]0.0478[/C][C]0.0076[/C][C]0.0487[/C][C]7056.2745[/C][C]454394.5912[/C][C]674.088[/C][/ROW]
[ROW][C]179[/C][C]0.0476[/C][C]-0.0367[/C][C]0.0476[/C][C]166404.3364[/C][C]428213.659[/C][C]654.3804[/C][/ROW]
[ROW][C]180[/C][C]0.0423[/C][C]-0.056[/C][C]0.0483[/C][C]490971.3296[/C][C]433443.4649[/C][C]658.3642[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116619&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116619&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
1690.03720.103401812372.802900
1700.04630.02110.062258599.4443935486.1236967.2053
1710.0424-0.07530.0666882925.3195917965.8555958.1053
1720.0461-0.04980.0624328163.3109770515.2194877.79
1730.0467-0.05920.0618450909.9942706594.1743840.5916
1740.049-0.05080.0599301320.7793639048.6085799.4052
1750.0479-0.04450.0577242624.9994582416.6643763.1623
1760.0486-0.06050.0581435503.587564052.5297751.0343
1770.0509-0.0150.053324469.4005504098.8487709.9992
1780.04780.00760.04877056.2745454394.5912674.088
1790.0476-0.03670.0476166404.3364428213.659654.3804
1800.0423-0.0560.0483490971.3296433443.4649658.3642



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