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 computationSun, 20 Dec 2009 05:44:37 -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/20/t1261313177sahyuv0vovpfpwe.htm/, Retrieved Fri, 03 May 2024 20:35:20 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69862, Retrieved Fri, 03 May 2024 20:35:20 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact122
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD    [ARIMA Forecasting] [ARIMA Forecasting...] [2009-12-20 12:44:37] [fe2edc5b0acc9545190e03904e9be55e] [Current]
Feedback Forum

Post a new message
Dataseries X:
921365
987921
1132614
1332224
1418133
1411549
1695920
1636173
1539653
1395314
1127575
1036076
989236
1008380
1207763
1368839
1469798
1498721
1761769
1653214
1599104
1421179
1163995
1037735
1015407
1039210
1258049
1469445
1552346
1549144
1785895
1662335
1629440
1467430
1202209
1076982
1039367
1063449
1335135
1491602
1591972
1641248
1898849
1798580
1762444
1622044
1368955
1262973
1195650
1269530
1479279
1607819
1712466
1721766
1949843
1821326
1757802
1590367
1260647
1149235




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69862&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'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[48])
361076982-------
371039367-------
381063449-------
391335135-------
401491602-------
411591972-------
421641248-------
431898849-------
441798580-------
451762444-------
461622044-------
471368955-------
481262973-------
4911956501227683.85121169388.3251285979.37740.14070.117710.1177
5012695301252048.10871169609.2661334486.95150.33880.9110.3975
5114792791509238.14031408273.01151610203.2690.280410.99961
5216078191676491.3231559907.6551793074.9910.12410.99950.99911
5317124661773512.46651643168.51361903856.41940.17930.99360.99681
5417217661811586.49231668802.24781954370.73690.10880.91320.99031
5519498432065972.93581911748.63522220197.23650.0710.98321
5618213261961614.17321796741.70942126486.6370.04770.55560.97371
5717578021924488.21291749614.76222099361.66350.03090.87620.96531
5815903671778431.571594098.94081962764.19910.02280.58680.95181
5912606471522757.38861329427.84461716086.93250.00390.24650.94050.9958
6011492351412553.9551210627.96121614479.94880.00530.92980.92670.9267

\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 & 1076982 & - & - & - & - & - & - & - \tabularnewline
37 & 1039367 & - & - & - & - & - & - & - \tabularnewline
38 & 1063449 & - & - & - & - & - & - & - \tabularnewline
39 & 1335135 & - & - & - & - & - & - & - \tabularnewline
40 & 1491602 & - & - & - & - & - & - & - \tabularnewline
41 & 1591972 & - & - & - & - & - & - & - \tabularnewline
42 & 1641248 & - & - & - & - & - & - & - \tabularnewline
43 & 1898849 & - & - & - & - & - & - & - \tabularnewline
44 & 1798580 & - & - & - & - & - & - & - \tabularnewline
45 & 1762444 & - & - & - & - & - & - & - \tabularnewline
46 & 1622044 & - & - & - & - & - & - & - \tabularnewline
47 & 1368955 & - & - & - & - & - & - & - \tabularnewline
48 & 1262973 & - & - & - & - & - & - & - \tabularnewline
49 & 1195650 & 1227683.8512 & 1169388.325 & 1285979.3774 & 0.1407 & 0.1177 & 1 & 0.1177 \tabularnewline
50 & 1269530 & 1252048.1087 & 1169609.266 & 1334486.9515 & 0.3388 & 0.91 & 1 & 0.3975 \tabularnewline
51 & 1479279 & 1509238.1403 & 1408273.0115 & 1610203.269 & 0.2804 & 1 & 0.9996 & 1 \tabularnewline
52 & 1607819 & 1676491.323 & 1559907.655 & 1793074.991 & 0.1241 & 0.9995 & 0.9991 & 1 \tabularnewline
53 & 1712466 & 1773512.4665 & 1643168.5136 & 1903856.4194 & 0.1793 & 0.9936 & 0.9968 & 1 \tabularnewline
54 & 1721766 & 1811586.4923 & 1668802.2478 & 1954370.7369 & 0.1088 & 0.9132 & 0.9903 & 1 \tabularnewline
55 & 1949843 & 2065972.9358 & 1911748.6352 & 2220197.2365 & 0.07 & 1 & 0.9832 & 1 \tabularnewline
56 & 1821326 & 1961614.1732 & 1796741.7094 & 2126486.637 & 0.0477 & 0.5556 & 0.9737 & 1 \tabularnewline
57 & 1757802 & 1924488.2129 & 1749614.7622 & 2099361.6635 & 0.0309 & 0.8762 & 0.9653 & 1 \tabularnewline
58 & 1590367 & 1778431.57 & 1594098.9408 & 1962764.1991 & 0.0228 & 0.5868 & 0.9518 & 1 \tabularnewline
59 & 1260647 & 1522757.3886 & 1329427.8446 & 1716086.9325 & 0.0039 & 0.2465 & 0.9405 & 0.9958 \tabularnewline
60 & 1149235 & 1412553.955 & 1210627.9612 & 1614479.9488 & 0.0053 & 0.9298 & 0.9267 & 0.9267 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69862&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]1076982[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]1039367[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]1063449[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]1335135[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]1491602[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]1591972[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]1641248[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]1898849[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]1798580[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]1762444[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]1622044[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]1368955[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]1262973[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]1195650[/C][C]1227683.8512[/C][C]1169388.325[/C][C]1285979.3774[/C][C]0.1407[/C][C]0.1177[/C][C]1[/C][C]0.1177[/C][/ROW]
[ROW][C]50[/C][C]1269530[/C][C]1252048.1087[/C][C]1169609.266[/C][C]1334486.9515[/C][C]0.3388[/C][C]0.91[/C][C]1[/C][C]0.3975[/C][/ROW]
[ROW][C]51[/C][C]1479279[/C][C]1509238.1403[/C][C]1408273.0115[/C][C]1610203.269[/C][C]0.2804[/C][C]1[/C][C]0.9996[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]1607819[/C][C]1676491.323[/C][C]1559907.655[/C][C]1793074.991[/C][C]0.1241[/C][C]0.9995[/C][C]0.9991[/C][C]1[/C][/ROW]
[ROW][C]53[/C][C]1712466[/C][C]1773512.4665[/C][C]1643168.5136[/C][C]1903856.4194[/C][C]0.1793[/C][C]0.9936[/C][C]0.9968[/C][C]1[/C][/ROW]
[ROW][C]54[/C][C]1721766[/C][C]1811586.4923[/C][C]1668802.2478[/C][C]1954370.7369[/C][C]0.1088[/C][C]0.9132[/C][C]0.9903[/C][C]1[/C][/ROW]
[ROW][C]55[/C][C]1949843[/C][C]2065972.9358[/C][C]1911748.6352[/C][C]2220197.2365[/C][C]0.07[/C][C]1[/C][C]0.9832[/C][C]1[/C][/ROW]
[ROW][C]56[/C][C]1821326[/C][C]1961614.1732[/C][C]1796741.7094[/C][C]2126486.637[/C][C]0.0477[/C][C]0.5556[/C][C]0.9737[/C][C]1[/C][/ROW]
[ROW][C]57[/C][C]1757802[/C][C]1924488.2129[/C][C]1749614.7622[/C][C]2099361.6635[/C][C]0.0309[/C][C]0.8762[/C][C]0.9653[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]1590367[/C][C]1778431.57[/C][C]1594098.9408[/C][C]1962764.1991[/C][C]0.0228[/C][C]0.5868[/C][C]0.9518[/C][C]1[/C][/ROW]
[ROW][C]59[/C][C]1260647[/C][C]1522757.3886[/C][C]1329427.8446[/C][C]1716086.9325[/C][C]0.0039[/C][C]0.2465[/C][C]0.9405[/C][C]0.9958[/C][/ROW]
[ROW][C]60[/C][C]1149235[/C][C]1412553.955[/C][C]1210627.9612[/C][C]1614479.9488[/C][C]0.0053[/C][C]0.9298[/C][C]0.9267[/C][C]0.9267[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69862&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69862&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])
361076982-------
371039367-------
381063449-------
391335135-------
401491602-------
411591972-------
421641248-------
431898849-------
441798580-------
451762444-------
461622044-------
471368955-------
481262973-------
4911956501227683.85121169388.3251285979.37740.14070.117710.1177
5012695301252048.10871169609.2661334486.95150.33880.9110.3975
5114792791509238.14031408273.01151610203.2690.280410.99961
5216078191676491.3231559907.6551793074.9910.12410.99950.99911
5317124661773512.46651643168.51361903856.41940.17930.99360.99681
5417217661811586.49231668802.24781954370.73690.10880.91320.99031
5519498432065972.93581911748.63522220197.23650.0710.98321
5618213261961614.17321796741.70942126486.6370.04770.55560.97371
5717578021924488.21291749614.76222099361.66350.03090.87620.96531
5815903671778431.571594098.94081962764.19910.02280.58680.95181
5912606471522757.38861329427.84461716086.93250.00390.24650.94050.9958
6011492351412553.9551210627.96121614479.94880.00530.92980.92670.9267







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0242-0.026101026167622.801400
500.03360.0140.02305616522.617665892072.709225804.8847
510.0341-0.01990.02897550084.8421743111410.086927260.0699
520.0355-0.0410.02524715887948.1751736305544.608941668.9998
530.0375-0.03440.02713726671070.61562134378649.810246199.336
540.0402-0.04960.03088067720844.02263123269015.512355886.2149
550.0381-0.05620.034413486161997.454603682298.646267850.4407
560.0429-0.07150.039119680771544.81636488318454.417580550.099
570.0464-0.08660.044427784293554.49458854537909.981694098.5542
580.0529-0.10570.050535368282478.043911505912366.7878107265.616
590.0648-0.17210.061668701855792.884416705543587.3421129249.9268
600.0729-0.18640.07269336872062.56421091487626.9439145229.0867

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0242 & -0.0261 & 0 & 1026167622.8014 & 0 & 0 \tabularnewline
50 & 0.0336 & 0.014 & 0.02 & 305616522.617 & 665892072.7092 & 25804.8847 \tabularnewline
51 & 0.0341 & -0.0199 & 0.02 & 897550084.8421 & 743111410.0869 & 27260.0699 \tabularnewline
52 & 0.0355 & -0.041 & 0.0252 & 4715887948.175 & 1736305544.6089 & 41668.9998 \tabularnewline
53 & 0.0375 & -0.0344 & 0.0271 & 3726671070.6156 & 2134378649.8102 & 46199.336 \tabularnewline
54 & 0.0402 & -0.0496 & 0.0308 & 8067720844.0226 & 3123269015.5123 & 55886.2149 \tabularnewline
55 & 0.0381 & -0.0562 & 0.0344 & 13486161997.45 & 4603682298.6462 & 67850.4407 \tabularnewline
56 & 0.0429 & -0.0715 & 0.0391 & 19680771544.8163 & 6488318454.4175 & 80550.099 \tabularnewline
57 & 0.0464 & -0.0866 & 0.0444 & 27784293554.4945 & 8854537909.9816 & 94098.5542 \tabularnewline
58 & 0.0529 & -0.1057 & 0.0505 & 35368282478.0439 & 11505912366.7878 & 107265.616 \tabularnewline
59 & 0.0648 & -0.1721 & 0.0616 & 68701855792.8844 & 16705543587.3421 & 129249.9268 \tabularnewline
60 & 0.0729 & -0.1864 & 0.072 & 69336872062.564 & 21091487626.9439 & 145229.0867 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69862&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.0242[/C][C]-0.0261[/C][C]0[/C][C]1026167622.8014[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0336[/C][C]0.014[/C][C]0.02[/C][C]305616522.617[/C][C]665892072.7092[/C][C]25804.8847[/C][/ROW]
[ROW][C]51[/C][C]0.0341[/C][C]-0.0199[/C][C]0.02[/C][C]897550084.8421[/C][C]743111410.0869[/C][C]27260.0699[/C][/ROW]
[ROW][C]52[/C][C]0.0355[/C][C]-0.041[/C][C]0.0252[/C][C]4715887948.175[/C][C]1736305544.6089[/C][C]41668.9998[/C][/ROW]
[ROW][C]53[/C][C]0.0375[/C][C]-0.0344[/C][C]0.0271[/C][C]3726671070.6156[/C][C]2134378649.8102[/C][C]46199.336[/C][/ROW]
[ROW][C]54[/C][C]0.0402[/C][C]-0.0496[/C][C]0.0308[/C][C]8067720844.0226[/C][C]3123269015.5123[/C][C]55886.2149[/C][/ROW]
[ROW][C]55[/C][C]0.0381[/C][C]-0.0562[/C][C]0.0344[/C][C]13486161997.45[/C][C]4603682298.6462[/C][C]67850.4407[/C][/ROW]
[ROW][C]56[/C][C]0.0429[/C][C]-0.0715[/C][C]0.0391[/C][C]19680771544.8163[/C][C]6488318454.4175[/C][C]80550.099[/C][/ROW]
[ROW][C]57[/C][C]0.0464[/C][C]-0.0866[/C][C]0.0444[/C][C]27784293554.4945[/C][C]8854537909.9816[/C][C]94098.5542[/C][/ROW]
[ROW][C]58[/C][C]0.0529[/C][C]-0.1057[/C][C]0.0505[/C][C]35368282478.0439[/C][C]11505912366.7878[/C][C]107265.616[/C][/ROW]
[ROW][C]59[/C][C]0.0648[/C][C]-0.1721[/C][C]0.0616[/C][C]68701855792.8844[/C][C]16705543587.3421[/C][C]129249.9268[/C][/ROW]
[ROW][C]60[/C][C]0.0729[/C][C]-0.1864[/C][C]0.072[/C][C]69336872062.564[/C][C]21091487626.9439[/C][C]145229.0867[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69862&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69862&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.0242-0.026101026167622.801400
500.03360.0140.02305616522.617665892072.709225804.8847
510.0341-0.01990.02897550084.8421743111410.086927260.0699
520.0355-0.0410.02524715887948.1751736305544.608941668.9998
530.0375-0.03440.02713726671070.61562134378649.810246199.336
540.0402-0.04960.03088067720844.02263123269015.512355886.2149
550.0381-0.05620.034413486161997.454603682298.646267850.4407
560.0429-0.07150.039119680771544.81636488318454.417580550.099
570.0464-0.08660.044427784293554.49458854537909.981694098.5542
580.0529-0.10570.050535368282478.043911505912366.7878107265.616
590.0648-0.17210.061668701855792.884416705543587.3421129249.9268
600.0729-0.18640.07269336872062.56421091487626.9439145229.0867



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