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, 15 Dec 2010 13:14:16 +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/15/t1292418981yaxgebixnfwcav9.htm/, Retrieved Fri, 03 May 2024 09:02:18 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=110390, Retrieved Fri, 03 May 2024 09:02:18 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact128
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Standard Deviation-Mean Plot] [Workshop 6] [2010-12-14 13:38:50] [52986265a8945c3b72cdef4e8a412754]
- RMP     [ARIMA Forecasting] [] [2010-12-15 13:14:16] [76f6fcd790878de142f355e7238b5c71] [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
1016367
1027885
1262159
1520854
1544144
1564709
1821776
1741365
1623386
1498658
1241822
1136029




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=110390&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[60])
481262973-------
491195650-------
501269530-------
511479279-------
521607819-------
531712466-------
541721766-------
551949843-------
561821326-------
571757802-------
581590367-------
591260647-------
601149235-------
6110163671085057.40961025485.65091146310.96370.0140.022e-040.02
6210278851155490.17891069006.2661245337.68260.00270.99880.00640.5543
6312621591355965.25781241514.72081475461.18090.061910.02160.9997
6415208541479145.11611341437.96131623579.45240.28570.99840.04041
6515441441579584.73311420800.31741746778.12570.33890.75440.05961
6615647091588517.12291414512.99391772612.02420.39990.68170.0781
6718217761807870.79771607440.42612020073.73680.44890.98760.09491
6817413651684202.26711478045.12041903813.77670.3050.10980.11051
6916233861623137.98511409039.31661852372.8120.49920.1560.12481
7014986581462407.96461249030.06431692603.81850.37880.08520.1380.9962
7112418221147016.2548950258.78541362273.47330.1947e-040.15040.4919
7211360291040862.8435845984.25361255922.97790.19290.03350.16170.1617

\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[60]) \tabularnewline
48 & 1262973 & - & - & - & - & - & - & - \tabularnewline
49 & 1195650 & - & - & - & - & - & - & - \tabularnewline
50 & 1269530 & - & - & - & - & - & - & - \tabularnewline
51 & 1479279 & - & - & - & - & - & - & - \tabularnewline
52 & 1607819 & - & - & - & - & - & - & - \tabularnewline
53 & 1712466 & - & - & - & - & - & - & - \tabularnewline
54 & 1721766 & - & - & - & - & - & - & - \tabularnewline
55 & 1949843 & - & - & - & - & - & - & - \tabularnewline
56 & 1821326 & - & - & - & - & - & - & - \tabularnewline
57 & 1757802 & - & - & - & - & - & - & - \tabularnewline
58 & 1590367 & - & - & - & - & - & - & - \tabularnewline
59 & 1260647 & - & - & - & - & - & - & - \tabularnewline
60 & 1149235 & - & - & - & - & - & - & - \tabularnewline
61 & 1016367 & 1085057.4096 & 1025485.6509 & 1146310.9637 & 0.014 & 0.02 & 2e-04 & 0.02 \tabularnewline
62 & 1027885 & 1155490.1789 & 1069006.266 & 1245337.6826 & 0.0027 & 0.9988 & 0.0064 & 0.5543 \tabularnewline
63 & 1262159 & 1355965.2578 & 1241514.7208 & 1475461.1809 & 0.0619 & 1 & 0.0216 & 0.9997 \tabularnewline
64 & 1520854 & 1479145.1161 & 1341437.9613 & 1623579.4524 & 0.2857 & 0.9984 & 0.0404 & 1 \tabularnewline
65 & 1544144 & 1579584.7331 & 1420800.3174 & 1746778.1257 & 0.3389 & 0.7544 & 0.0596 & 1 \tabularnewline
66 & 1564709 & 1588517.1229 & 1414512.9939 & 1772612.0242 & 0.3999 & 0.6817 & 0.078 & 1 \tabularnewline
67 & 1821776 & 1807870.7977 & 1607440.4261 & 2020073.7368 & 0.4489 & 0.9876 & 0.0949 & 1 \tabularnewline
68 & 1741365 & 1684202.2671 & 1478045.1204 & 1903813.7767 & 0.305 & 0.1098 & 0.1105 & 1 \tabularnewline
69 & 1623386 & 1623137.9851 & 1409039.3166 & 1852372.812 & 0.4992 & 0.156 & 0.1248 & 1 \tabularnewline
70 & 1498658 & 1462407.9646 & 1249030.0643 & 1692603.8185 & 0.3788 & 0.0852 & 0.138 & 0.9962 \tabularnewline
71 & 1241822 & 1147016.2548 & 950258.7854 & 1362273.4733 & 0.194 & 7e-04 & 0.1504 & 0.4919 \tabularnewline
72 & 1136029 & 1040862.8435 & 845984.2536 & 1255922.9779 & 0.1929 & 0.0335 & 0.1617 & 0.1617 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=110390&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[60])[/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]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]1269530[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]1479279[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]1607819[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]1712466[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]1721766[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]1949843[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]1821326[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]1757802[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]1590367[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]1260647[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]1149235[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]1016367[/C][C]1085057.4096[/C][C]1025485.6509[/C][C]1146310.9637[/C][C]0.014[/C][C]0.02[/C][C]2e-04[/C][C]0.02[/C][/ROW]
[ROW][C]62[/C][C]1027885[/C][C]1155490.1789[/C][C]1069006.266[/C][C]1245337.6826[/C][C]0.0027[/C][C]0.9988[/C][C]0.0064[/C][C]0.5543[/C][/ROW]
[ROW][C]63[/C][C]1262159[/C][C]1355965.2578[/C][C]1241514.7208[/C][C]1475461.1809[/C][C]0.0619[/C][C]1[/C][C]0.0216[/C][C]0.9997[/C][/ROW]
[ROW][C]64[/C][C]1520854[/C][C]1479145.1161[/C][C]1341437.9613[/C][C]1623579.4524[/C][C]0.2857[/C][C]0.9984[/C][C]0.0404[/C][C]1[/C][/ROW]
[ROW][C]65[/C][C]1544144[/C][C]1579584.7331[/C][C]1420800.3174[/C][C]1746778.1257[/C][C]0.3389[/C][C]0.7544[/C][C]0.0596[/C][C]1[/C][/ROW]
[ROW][C]66[/C][C]1564709[/C][C]1588517.1229[/C][C]1414512.9939[/C][C]1772612.0242[/C][C]0.3999[/C][C]0.6817[/C][C]0.078[/C][C]1[/C][/ROW]
[ROW][C]67[/C][C]1821776[/C][C]1807870.7977[/C][C]1607440.4261[/C][C]2020073.7368[/C][C]0.4489[/C][C]0.9876[/C][C]0.0949[/C][C]1[/C][/ROW]
[ROW][C]68[/C][C]1741365[/C][C]1684202.2671[/C][C]1478045.1204[/C][C]1903813.7767[/C][C]0.305[/C][C]0.1098[/C][C]0.1105[/C][C]1[/C][/ROW]
[ROW][C]69[/C][C]1623386[/C][C]1623137.9851[/C][C]1409039.3166[/C][C]1852372.812[/C][C]0.4992[/C][C]0.156[/C][C]0.1248[/C][C]1[/C][/ROW]
[ROW][C]70[/C][C]1498658[/C][C]1462407.9646[/C][C]1249030.0643[/C][C]1692603.8185[/C][C]0.3788[/C][C]0.0852[/C][C]0.138[/C][C]0.9962[/C][/ROW]
[ROW][C]71[/C][C]1241822[/C][C]1147016.2548[/C][C]950258.7854[/C][C]1362273.4733[/C][C]0.194[/C][C]7e-04[/C][C]0.1504[/C][C]0.4919[/C][/ROW]
[ROW][C]72[/C][C]1136029[/C][C]1040862.8435[/C][C]845984.2536[/C][C]1255922.9779[/C][C]0.1929[/C][C]0.0335[/C][C]0.1617[/C][C]0.1617[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=110390&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=110390&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[60])
481262973-------
491195650-------
501269530-------
511479279-------
521607819-------
531712466-------
541721766-------
551949843-------
561821326-------
571757802-------
581590367-------
591260647-------
601149235-------
6110163671085057.40961025485.65091146310.96370.0140.022e-040.02
6210278851155490.17891069006.2661245337.68260.00270.99880.00640.5543
6312621591355965.25781241514.72081475461.18090.061910.02160.9997
6415208541479145.11611341437.96131623579.45240.28570.99840.04041
6515441441579584.73311420800.31741746778.12570.33890.75440.05961
6615647091588517.12291414512.99391772612.02420.39990.68170.0781
6718217761807870.79771607440.42612020073.73680.44890.98760.09491
6817413651684202.26711478045.12041903813.77670.3050.10980.11051
6916233861623137.98511409039.31661852372.8120.49920.1560.12481
7014986581462407.96461249030.06431692603.81850.37880.08520.1380.9962
7112418221147016.2548950258.78541362273.47330.1947e-040.15040.4919
7211360291040862.8435845984.25361255922.97790.19290.03350.16170.1617







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0288-0.063304718372371.529500
620.0397-0.11040.086916283081687.720210500727029.6249102473.0551
630.045-0.06920.0818799614002.73159933689353.993799667.8953
640.04980.02820.06781739630993.81517885174763.949188798.5065
650.054-0.02240.05871256045563.60356559348923.8880989.8075
660.0591-0.0150.0514566826717.42775560595222.804674569.3987
670.05990.00770.0452193354651.99514793846569.831869237.6095
680.06650.03390.04383267578037.34624603063003.271167845.8768
690.07212e-040.038961511.38884091618393.06263965.7595
700.08030.02480.03751314065069.89993813863060.745861756.4819
710.09570.08270.04168988129320.98894284250902.58665454.1893
720.10540.09140.04589056597335.42554681946438.65668424.7502

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0288 & -0.0633 & 0 & 4718372371.5295 & 0 & 0 \tabularnewline
62 & 0.0397 & -0.1104 & 0.0869 & 16283081687.7202 & 10500727029.6249 & 102473.0551 \tabularnewline
63 & 0.045 & -0.0692 & 0.081 & 8799614002.7315 & 9933689353.9937 & 99667.8953 \tabularnewline
64 & 0.0498 & 0.0282 & 0.0678 & 1739630993.8151 & 7885174763.9491 & 88798.5065 \tabularnewline
65 & 0.054 & -0.0224 & 0.0587 & 1256045563.6035 & 6559348923.88 & 80989.8075 \tabularnewline
66 & 0.0591 & -0.015 & 0.0514 & 566826717.4277 & 5560595222.8046 & 74569.3987 \tabularnewline
67 & 0.0599 & 0.0077 & 0.0452 & 193354651.9951 & 4793846569.8318 & 69237.6095 \tabularnewline
68 & 0.0665 & 0.0339 & 0.0438 & 3267578037.3462 & 4603063003.2711 & 67845.8768 \tabularnewline
69 & 0.0721 & 2e-04 & 0.0389 & 61511.3888 & 4091618393.062 & 63965.7595 \tabularnewline
70 & 0.0803 & 0.0248 & 0.0375 & 1314065069.8999 & 3813863060.7458 & 61756.4819 \tabularnewline
71 & 0.0957 & 0.0827 & 0.0416 & 8988129320.9889 & 4284250902.586 & 65454.1893 \tabularnewline
72 & 0.1054 & 0.0914 & 0.0458 & 9056597335.4255 & 4681946438.656 & 68424.7502 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=110390&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]61[/C][C]0.0288[/C][C]-0.0633[/C][C]0[/C][C]4718372371.5295[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.0397[/C][C]-0.1104[/C][C]0.0869[/C][C]16283081687.7202[/C][C]10500727029.6249[/C][C]102473.0551[/C][/ROW]
[ROW][C]63[/C][C]0.045[/C][C]-0.0692[/C][C]0.081[/C][C]8799614002.7315[/C][C]9933689353.9937[/C][C]99667.8953[/C][/ROW]
[ROW][C]64[/C][C]0.0498[/C][C]0.0282[/C][C]0.0678[/C][C]1739630993.8151[/C][C]7885174763.9491[/C][C]88798.5065[/C][/ROW]
[ROW][C]65[/C][C]0.054[/C][C]-0.0224[/C][C]0.0587[/C][C]1256045563.6035[/C][C]6559348923.88[/C][C]80989.8075[/C][/ROW]
[ROW][C]66[/C][C]0.0591[/C][C]-0.015[/C][C]0.0514[/C][C]566826717.4277[/C][C]5560595222.8046[/C][C]74569.3987[/C][/ROW]
[ROW][C]67[/C][C]0.0599[/C][C]0.0077[/C][C]0.0452[/C][C]193354651.9951[/C][C]4793846569.8318[/C][C]69237.6095[/C][/ROW]
[ROW][C]68[/C][C]0.0665[/C][C]0.0339[/C][C]0.0438[/C][C]3267578037.3462[/C][C]4603063003.2711[/C][C]67845.8768[/C][/ROW]
[ROW][C]69[/C][C]0.0721[/C][C]2e-04[/C][C]0.0389[/C][C]61511.3888[/C][C]4091618393.062[/C][C]63965.7595[/C][/ROW]
[ROW][C]70[/C][C]0.0803[/C][C]0.0248[/C][C]0.0375[/C][C]1314065069.8999[/C][C]3813863060.7458[/C][C]61756.4819[/C][/ROW]
[ROW][C]71[/C][C]0.0957[/C][C]0.0827[/C][C]0.0416[/C][C]8988129320.9889[/C][C]4284250902.586[/C][C]65454.1893[/C][/ROW]
[ROW][C]72[/C][C]0.1054[/C][C]0.0914[/C][C]0.0458[/C][C]9056597335.4255[/C][C]4681946438.656[/C][C]68424.7502[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=110390&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=110390&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
610.0288-0.063304718372371.529500
620.0397-0.11040.086916283081687.720210500727029.6249102473.0551
630.045-0.06920.0818799614002.73159933689353.993799667.8953
640.04980.02820.06781739630993.81517885174763.949188798.5065
650.054-0.02240.05871256045563.60356559348923.8880989.8075
660.0591-0.0150.0514566826717.42775560595222.804674569.3987
670.05990.00770.0452193354651.99514793846569.831869237.6095
680.06650.03390.04383267578037.34624603063003.271167845.8768
690.07212e-040.038961511.38884091618393.06263965.7595
700.08030.02480.03751314065069.89993813863060.745861756.4819
710.09570.08270.04168988129320.98894284250902.58665454.1893
720.10540.09140.04589056597335.42554681946438.65668424.7502



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