Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 24 Dec 2008 02:54:24 -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/2008/Dec/24/t12301125202uu3sof8cz2bqbk.htm/, Retrieved Sat, 25 May 2024 15:04:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36445, Retrieved Sat, 25 May 2024 15:04:55 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact222
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2008-12-24 09:54:24] [ba8414dd214a21fbd6c7bde748ac585f] [Current]
Feedback Forum

Post a new message
Dataseries X:
46402
45329
42185
49341
50472
33020
29567
22870
25730
32609
23536
15135
36776
29982
38062
34226
24906
30233
27405
20784
22886
25425
20838
15655
37158
36364
43213
31635
30113
29985
20919
19429
21427
26064
20109
15369
35466
25954
33504
28115
28501
28618
21434
20177
21484
25642
23515
12941
36190
37785
38407
33326
30304
27576
27048
17291
21018
26792
19426
13927
35647
31746
31277
31583
25607
28151
24947
18077
23429
26313
18862
14753
36409
33163
34122
35225
28249
30374
26311
22069
23651
28628
23187
14727
43080
32519
39657
33614
28671
34243
27336
22916
24537
26128
22602
15744
41086
39690
43129
37863
35953
29133
24693
22205
21725
27192
21790
13253
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
31956
29506
34506
27165
26736
23691
18157
17328
18205
20995
17382
9367
31124
26551
30651
25859
25100
25778
20418
18688
20424
24776
19814
12738




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36445&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 time5 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[180])
16810698-------
16931956-------
17029506-------
17134506-------
17227165-------
17326736-------
17423691-------
17518157-------
17617328-------
17718205-------
17820995-------
17917382-------
1809367-------
1813112426076.726421550.137532342.00550.057210.03291
1822655122781.8519051.688227834.81040.07196e-040.00461
1833065123596.675519531.058429207.92010.00690.1511e-041
1842585923398.63419130.055429424.43750.21180.00920.11031
1852510020433.548516899.516725318.17420.03060.01470.00571
1862577820429.910416818.351825464.16280.01870.03450.10211
1872041817501.0214582.056321481.39870.075400.37331
1881868815430.047512983.94818706.70380.02570.00140.12810.9999
1892042416772.839913952.875820629.45550.03180.16520.23340.9999
1902477619249.189815726.499324228.5080.01480.32190.2460.9999
1911981415848.382613190.888919479.27920.016100.20390.9998
1921273810959.63759426.376312934.80090.038800.9430.943

\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[180]) \tabularnewline
168 & 10698 & - & - & - & - & - & - & - \tabularnewline
169 & 31956 & - & - & - & - & - & - & - \tabularnewline
170 & 29506 & - & - & - & - & - & - & - \tabularnewline
171 & 34506 & - & - & - & - & - & - & - \tabularnewline
172 & 27165 & - & - & - & - & - & - & - \tabularnewline
173 & 26736 & - & - & - & - & - & - & - \tabularnewline
174 & 23691 & - & - & - & - & - & - & - \tabularnewline
175 & 18157 & - & - & - & - & - & - & - \tabularnewline
176 & 17328 & - & - & - & - & - & - & - \tabularnewline
177 & 18205 & - & - & - & - & - & - & - \tabularnewline
178 & 20995 & - & - & - & - & - & - & - \tabularnewline
179 & 17382 & - & - & - & - & - & - & - \tabularnewline
180 & 9367 & - & - & - & - & - & - & - \tabularnewline
181 & 31124 & 26076.7264 & 21550.1375 & 32342.0055 & 0.0572 & 1 & 0.0329 & 1 \tabularnewline
182 & 26551 & 22781.85 & 19051.6882 & 27834.8104 & 0.0719 & 6e-04 & 0.0046 & 1 \tabularnewline
183 & 30651 & 23596.6755 & 19531.0584 & 29207.9201 & 0.0069 & 0.151 & 1e-04 & 1 \tabularnewline
184 & 25859 & 23398.634 & 19130.0554 & 29424.4375 & 0.2118 & 0.0092 & 0.1103 & 1 \tabularnewline
185 & 25100 & 20433.5485 & 16899.5167 & 25318.1742 & 0.0306 & 0.0147 & 0.0057 & 1 \tabularnewline
186 & 25778 & 20429.9104 & 16818.3518 & 25464.1628 & 0.0187 & 0.0345 & 0.1021 & 1 \tabularnewline
187 & 20418 & 17501.02 & 14582.0563 & 21481.3987 & 0.0754 & 0 & 0.3733 & 1 \tabularnewline
188 & 18688 & 15430.0475 & 12983.948 & 18706.7038 & 0.0257 & 0.0014 & 0.1281 & 0.9999 \tabularnewline
189 & 20424 & 16772.8399 & 13952.8758 & 20629.4555 & 0.0318 & 0.1652 & 0.2334 & 0.9999 \tabularnewline
190 & 24776 & 19249.1898 & 15726.4993 & 24228.508 & 0.0148 & 0.3219 & 0.246 & 0.9999 \tabularnewline
191 & 19814 & 15848.3826 & 13190.8889 & 19479.2792 & 0.0161 & 0 & 0.2039 & 0.9998 \tabularnewline
192 & 12738 & 10959.6375 & 9426.3763 & 12934.8009 & 0.0388 & 0 & 0.943 & 0.943 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36445&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[180])[/C][/ROW]
[ROW][C]168[/C][C]10698[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]169[/C][C]31956[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]170[/C][C]29506[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]171[/C][C]34506[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]172[/C][C]27165[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]173[/C][C]26736[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]174[/C][C]23691[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]175[/C][C]18157[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]176[/C][C]17328[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]177[/C][C]18205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]178[/C][C]20995[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]179[/C][C]17382[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]180[/C][C]9367[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]181[/C][C]31124[/C][C]26076.7264[/C][C]21550.1375[/C][C]32342.0055[/C][C]0.0572[/C][C]1[/C][C]0.0329[/C][C]1[/C][/ROW]
[ROW][C]182[/C][C]26551[/C][C]22781.85[/C][C]19051.6882[/C][C]27834.8104[/C][C]0.0719[/C][C]6e-04[/C][C]0.0046[/C][C]1[/C][/ROW]
[ROW][C]183[/C][C]30651[/C][C]23596.6755[/C][C]19531.0584[/C][C]29207.9201[/C][C]0.0069[/C][C]0.151[/C][C]1e-04[/C][C]1[/C][/ROW]
[ROW][C]184[/C][C]25859[/C][C]23398.634[/C][C]19130.0554[/C][C]29424.4375[/C][C]0.2118[/C][C]0.0092[/C][C]0.1103[/C][C]1[/C][/ROW]
[ROW][C]185[/C][C]25100[/C][C]20433.5485[/C][C]16899.5167[/C][C]25318.1742[/C][C]0.0306[/C][C]0.0147[/C][C]0.0057[/C][C]1[/C][/ROW]
[ROW][C]186[/C][C]25778[/C][C]20429.9104[/C][C]16818.3518[/C][C]25464.1628[/C][C]0.0187[/C][C]0.0345[/C][C]0.1021[/C][C]1[/C][/ROW]
[ROW][C]187[/C][C]20418[/C][C]17501.02[/C][C]14582.0563[/C][C]21481.3987[/C][C]0.0754[/C][C]0[/C][C]0.3733[/C][C]1[/C][/ROW]
[ROW][C]188[/C][C]18688[/C][C]15430.0475[/C][C]12983.948[/C][C]18706.7038[/C][C]0.0257[/C][C]0.0014[/C][C]0.1281[/C][C]0.9999[/C][/ROW]
[ROW][C]189[/C][C]20424[/C][C]16772.8399[/C][C]13952.8758[/C][C]20629.4555[/C][C]0.0318[/C][C]0.1652[/C][C]0.2334[/C][C]0.9999[/C][/ROW]
[ROW][C]190[/C][C]24776[/C][C]19249.1898[/C][C]15726.4993[/C][C]24228.508[/C][C]0.0148[/C][C]0.3219[/C][C]0.246[/C][C]0.9999[/C][/ROW]
[ROW][C]191[/C][C]19814[/C][C]15848.3826[/C][C]13190.8889[/C][C]19479.2792[/C][C]0.0161[/C][C]0[/C][C]0.2039[/C][C]0.9998[/C][/ROW]
[ROW][C]192[/C][C]12738[/C][C]10959.6375[/C][C]9426.3763[/C][C]12934.8009[/C][C]0.0388[/C][C]0[/C][C]0.943[/C][C]0.943[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36445&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36445&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[180])
16810698-------
16931956-------
17029506-------
17134506-------
17227165-------
17326736-------
17423691-------
17518157-------
17617328-------
17718205-------
17820995-------
17917382-------
1809367-------
1813112426076.726421550.137532342.00550.057210.03291
1822655122781.8519051.688227834.81040.07196e-040.00461
1833065123596.675519531.058429207.92010.00690.1511e-041
1842585923398.63419130.055429424.43750.21180.00920.11031
1852510020433.548516899.516725318.17420.03060.01470.00571
1862577820429.910416818.351825464.16280.01870.03450.10211
1872041817501.0214582.056321481.39870.075400.37331
1881868815430.047512983.94818706.70380.02570.00140.12810.9999
1892042416772.839913952.875820629.45550.03180.16520.23340.9999
1902477619249.189815726.499324228.5080.01480.32190.2460.9999
1911981415848.382613190.888919479.27920.016100.20390.9998
1921273810959.63759426.376312934.80090.038800.9430.943







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1810.12260.19360.016125474971.03722122914.25311457.0224
1820.11320.16540.013814206491.89811183874.32481088.0599
1830.12130.2990.024949763493.79964146957.81662036.4081
1840.13140.10510.00886053400.9728504450.0811710.2465
1850.1220.22840.01921775769.56421814647.46371347.0885
1860.12570.26180.021828602062.60372383505.2171543.8605
1870.1160.16670.01398508772.483709064.3736842.0596
1880.10830.21110.017610614254.3062884521.1922940.4899
1890.11730.21770.018113330969.96461110914.16371053.9991
1900.1320.28710.023930545630.45562545469.20461595.4527
1910.11690.25020.020915726121.5361310510.1281144.7751
1920.09190.16230.01353162573.2428263547.7702513.369

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
181 & 0.1226 & 0.1936 & 0.0161 & 25474971.0372 & 2122914.2531 & 1457.0224 \tabularnewline
182 & 0.1132 & 0.1654 & 0.0138 & 14206491.8981 & 1183874.3248 & 1088.0599 \tabularnewline
183 & 0.1213 & 0.299 & 0.0249 & 49763493.7996 & 4146957.8166 & 2036.4081 \tabularnewline
184 & 0.1314 & 0.1051 & 0.0088 & 6053400.9728 & 504450.0811 & 710.2465 \tabularnewline
185 & 0.122 & 0.2284 & 0.019 & 21775769.5642 & 1814647.4637 & 1347.0885 \tabularnewline
186 & 0.1257 & 0.2618 & 0.0218 & 28602062.6037 & 2383505.217 & 1543.8605 \tabularnewline
187 & 0.116 & 0.1667 & 0.0139 & 8508772.483 & 709064.3736 & 842.0596 \tabularnewline
188 & 0.1083 & 0.2111 & 0.0176 & 10614254.3062 & 884521.1922 & 940.4899 \tabularnewline
189 & 0.1173 & 0.2177 & 0.0181 & 13330969.9646 & 1110914.1637 & 1053.9991 \tabularnewline
190 & 0.132 & 0.2871 & 0.0239 & 30545630.4556 & 2545469.2046 & 1595.4527 \tabularnewline
191 & 0.1169 & 0.2502 & 0.0209 & 15726121.536 & 1310510.128 & 1144.7751 \tabularnewline
192 & 0.0919 & 0.1623 & 0.0135 & 3162573.2428 & 263547.7702 & 513.369 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36445&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]181[/C][C]0.1226[/C][C]0.1936[/C][C]0.0161[/C][C]25474971.0372[/C][C]2122914.2531[/C][C]1457.0224[/C][/ROW]
[ROW][C]182[/C][C]0.1132[/C][C]0.1654[/C][C]0.0138[/C][C]14206491.8981[/C][C]1183874.3248[/C][C]1088.0599[/C][/ROW]
[ROW][C]183[/C][C]0.1213[/C][C]0.299[/C][C]0.0249[/C][C]49763493.7996[/C][C]4146957.8166[/C][C]2036.4081[/C][/ROW]
[ROW][C]184[/C][C]0.1314[/C][C]0.1051[/C][C]0.0088[/C][C]6053400.9728[/C][C]504450.0811[/C][C]710.2465[/C][/ROW]
[ROW][C]185[/C][C]0.122[/C][C]0.2284[/C][C]0.019[/C][C]21775769.5642[/C][C]1814647.4637[/C][C]1347.0885[/C][/ROW]
[ROW][C]186[/C][C]0.1257[/C][C]0.2618[/C][C]0.0218[/C][C]28602062.6037[/C][C]2383505.217[/C][C]1543.8605[/C][/ROW]
[ROW][C]187[/C][C]0.116[/C][C]0.1667[/C][C]0.0139[/C][C]8508772.483[/C][C]709064.3736[/C][C]842.0596[/C][/ROW]
[ROW][C]188[/C][C]0.1083[/C][C]0.2111[/C][C]0.0176[/C][C]10614254.3062[/C][C]884521.1922[/C][C]940.4899[/C][/ROW]
[ROW][C]189[/C][C]0.1173[/C][C]0.2177[/C][C]0.0181[/C][C]13330969.9646[/C][C]1110914.1637[/C][C]1053.9991[/C][/ROW]
[ROW][C]190[/C][C]0.132[/C][C]0.2871[/C][C]0.0239[/C][C]30545630.4556[/C][C]2545469.2046[/C][C]1595.4527[/C][/ROW]
[ROW][C]191[/C][C]0.1169[/C][C]0.2502[/C][C]0.0209[/C][C]15726121.536[/C][C]1310510.128[/C][C]1144.7751[/C][/ROW]
[ROW][C]192[/C][C]0.0919[/C][C]0.1623[/C][C]0.0135[/C][C]3162573.2428[/C][C]263547.7702[/C][C]513.369[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36445&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36445&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
1810.12260.19360.016125474971.03722122914.25311457.0224
1820.11320.16540.013814206491.89811183874.32481088.0599
1830.12130.2990.024949763493.79964146957.81662036.4081
1840.13140.10510.00886053400.9728504450.0811710.2465
1850.1220.22840.01921775769.56421814647.46371347.0885
1860.12570.26180.021828602062.60372383505.2171543.8605
1870.1160.16670.01398508772.483709064.3736842.0596
1880.10830.21110.017610614254.3062884521.1922940.4899
1890.11730.21770.018113330969.96461110914.16371053.9991
1900.1320.28710.023930545630.45562545469.20461595.4527
1910.11690.25020.020915726121.5361310510.1281144.7751
1920.09190.16230.01353162573.2428263547.7702513.369



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