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:19:41 -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/t1230110456tdz3dks3xv723cc.htm/, Retrieved Sun, 19 May 2024 08:45:58 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36443, Retrieved Sun, 19 May 2024 08:45:58 +0000
QR Codes:

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

Post a new message
Dataseries X:
1025,5
691,2
971,6
926
997,1
964,9
860
948
951,4
827,3
994
944,5
976,2
668,8
939,9
1096,1
977,7
1096,9
1060,8
1121,4
1190,9
1177,9
1108,1
1045,6
1263,9
911
1175,9
1091,3
1027,7
1081,7
879,7
955,5
1037,9
959,9
931,8
1062,2
1077,2
668,4
954,3
797,2
829,2
957,3
844,2
893,6
1132
898,8
1064
1279,7
1382,5
824,1
1304,1
1253,5
1136,3
1414,7
1293,2
1325,7
1463,8
1244,2
1573,6
1327,3
1418,5
1042,2
1384,8
1474,8
1556,5
1466,2
1221,7
1279,7
1348,4
1189,8
1296,6
1417,6
1513,9
1006,1
1202,8
1258,8
1211,5
1283,3
1332,3
1374,3
1406,1
1419,1
1554,4
1499,8
1609,6
1033,9
1550,5
1491,4
1368,9
1537,1
1492,3
1504,1
1301,2
1344,2
1319,1
1420,3
1582,9
1002,6
1559,1
1462,7
1414,8
1537,5
1455,9
1619,9
1667,2
1488,9
1442,5
1779,6
1801,9
1233,4
1581,1
1515
1439,2
1585,8
1488,8
1601,3
1646,8
1630,2
1720,7
2013,5
2051,2
1404,7
2015,9
1544,1
1816,6
1773,4
1577,4
1709,8
1810,2
1520,5
1798,6
1666,8
1730,4
1147,8
1777
1700
1907,4
1745,8
1771,6
1790,2
1958,7
1560,4
1752,1
2011,6
2082,8
1616,4
1846,1
1824,9
1711,3
1805
1737,6
1939,6
1711,4
1964,8
1864,4
1980,7
2226,7
1433,3
1960,7




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36443&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 time4 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[147])
1351777-------
1361700-------
1371907.4-------
1381745.8-------
1391771.6-------
1401790.2-------
1411958.7-------
1421560.4-------
1431752.1-------
1442011.6-------
1452082.8-------
1461616.4-------
1471846.1-------
1481824.91963.81011713.03892239.21320.16140.79890.96980.7989
1491711.31860.73811598.30792151.93760.15720.59530.37670.5392
15018052001.99191696.52672344.01880.12950.95210.9290.8142
1511737.61875.96121552.43682243.95940.23060.64730.71080.5632
1521939.61965.15121606.66722376.18740.45150.86110.79790.7149
1531711.42037.40221645.24922490.71710.07930.66380.63320.7959
1541964.81927.95751529.26192394.26440.43850.81870.93880.6346
1551864.42017.36091584.66672526.65510.2780.58020.84630.7451
1561980.72148.711675.14282708.85670.27830.84010.68430.8552
1572226.72273.69671759.99432884.13160.440.82660.730.9151
1581433.31601.95711189.10372105.97720.2560.00760.47760.1712
1591960.72115.91861592.76912748.87890.31540.98270.79830.7983

\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[147]) \tabularnewline
135 & 1777 & - & - & - & - & - & - & - \tabularnewline
136 & 1700 & - & - & - & - & - & - & - \tabularnewline
137 & 1907.4 & - & - & - & - & - & - & - \tabularnewline
138 & 1745.8 & - & - & - & - & - & - & - \tabularnewline
139 & 1771.6 & - & - & - & - & - & - & - \tabularnewline
140 & 1790.2 & - & - & - & - & - & - & - \tabularnewline
141 & 1958.7 & - & - & - & - & - & - & - \tabularnewline
142 & 1560.4 & - & - & - & - & - & - & - \tabularnewline
143 & 1752.1 & - & - & - & - & - & - & - \tabularnewline
144 & 2011.6 & - & - & - & - & - & - & - \tabularnewline
145 & 2082.8 & - & - & - & - & - & - & - \tabularnewline
146 & 1616.4 & - & - & - & - & - & - & - \tabularnewline
147 & 1846.1 & - & - & - & - & - & - & - \tabularnewline
148 & 1824.9 & 1963.8101 & 1713.0389 & 2239.2132 & 0.1614 & 0.7989 & 0.9698 & 0.7989 \tabularnewline
149 & 1711.3 & 1860.7381 & 1598.3079 & 2151.9376 & 0.1572 & 0.5953 & 0.3767 & 0.5392 \tabularnewline
150 & 1805 & 2001.9919 & 1696.5267 & 2344.0188 & 0.1295 & 0.9521 & 0.929 & 0.8142 \tabularnewline
151 & 1737.6 & 1875.9612 & 1552.4368 & 2243.9594 & 0.2306 & 0.6473 & 0.7108 & 0.5632 \tabularnewline
152 & 1939.6 & 1965.1512 & 1606.6672 & 2376.1874 & 0.4515 & 0.8611 & 0.7979 & 0.7149 \tabularnewline
153 & 1711.4 & 2037.4022 & 1645.2492 & 2490.7171 & 0.0793 & 0.6638 & 0.6332 & 0.7959 \tabularnewline
154 & 1964.8 & 1927.9575 & 1529.2619 & 2394.2644 & 0.4385 & 0.8187 & 0.9388 & 0.6346 \tabularnewline
155 & 1864.4 & 2017.3609 & 1584.6667 & 2526.6551 & 0.278 & 0.5802 & 0.8463 & 0.7451 \tabularnewline
156 & 1980.7 & 2148.71 & 1675.1428 & 2708.8567 & 0.2783 & 0.8401 & 0.6843 & 0.8552 \tabularnewline
157 & 2226.7 & 2273.6967 & 1759.9943 & 2884.1316 & 0.44 & 0.8266 & 0.73 & 0.9151 \tabularnewline
158 & 1433.3 & 1601.9571 & 1189.1037 & 2105.9772 & 0.256 & 0.0076 & 0.4776 & 0.1712 \tabularnewline
159 & 1960.7 & 2115.9186 & 1592.7691 & 2748.8789 & 0.3154 & 0.9827 & 0.7983 & 0.7983 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36443&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[147])[/C][/ROW]
[ROW][C]135[/C][C]1777[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]136[/C][C]1700[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]137[/C][C]1907.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]138[/C][C]1745.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]139[/C][C]1771.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]140[/C][C]1790.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]141[/C][C]1958.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]142[/C][C]1560.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]143[/C][C]1752.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]144[/C][C]2011.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]145[/C][C]2082.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]146[/C][C]1616.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]147[/C][C]1846.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]148[/C][C]1824.9[/C][C]1963.8101[/C][C]1713.0389[/C][C]2239.2132[/C][C]0.1614[/C][C]0.7989[/C][C]0.9698[/C][C]0.7989[/C][/ROW]
[ROW][C]149[/C][C]1711.3[/C][C]1860.7381[/C][C]1598.3079[/C][C]2151.9376[/C][C]0.1572[/C][C]0.5953[/C][C]0.3767[/C][C]0.5392[/C][/ROW]
[ROW][C]150[/C][C]1805[/C][C]2001.9919[/C][C]1696.5267[/C][C]2344.0188[/C][C]0.1295[/C][C]0.9521[/C][C]0.929[/C][C]0.8142[/C][/ROW]
[ROW][C]151[/C][C]1737.6[/C][C]1875.9612[/C][C]1552.4368[/C][C]2243.9594[/C][C]0.2306[/C][C]0.6473[/C][C]0.7108[/C][C]0.5632[/C][/ROW]
[ROW][C]152[/C][C]1939.6[/C][C]1965.1512[/C][C]1606.6672[/C][C]2376.1874[/C][C]0.4515[/C][C]0.8611[/C][C]0.7979[/C][C]0.7149[/C][/ROW]
[ROW][C]153[/C][C]1711.4[/C][C]2037.4022[/C][C]1645.2492[/C][C]2490.7171[/C][C]0.0793[/C][C]0.6638[/C][C]0.6332[/C][C]0.7959[/C][/ROW]
[ROW][C]154[/C][C]1964.8[/C][C]1927.9575[/C][C]1529.2619[/C][C]2394.2644[/C][C]0.4385[/C][C]0.8187[/C][C]0.9388[/C][C]0.6346[/C][/ROW]
[ROW][C]155[/C][C]1864.4[/C][C]2017.3609[/C][C]1584.6667[/C][C]2526.6551[/C][C]0.278[/C][C]0.5802[/C][C]0.8463[/C][C]0.7451[/C][/ROW]
[ROW][C]156[/C][C]1980.7[/C][C]2148.71[/C][C]1675.1428[/C][C]2708.8567[/C][C]0.2783[/C][C]0.8401[/C][C]0.6843[/C][C]0.8552[/C][/ROW]
[ROW][C]157[/C][C]2226.7[/C][C]2273.6967[/C][C]1759.9943[/C][C]2884.1316[/C][C]0.44[/C][C]0.8266[/C][C]0.73[/C][C]0.9151[/C][/ROW]
[ROW][C]158[/C][C]1433.3[/C][C]1601.9571[/C][C]1189.1037[/C][C]2105.9772[/C][C]0.256[/C][C]0.0076[/C][C]0.4776[/C][C]0.1712[/C][/ROW]
[ROW][C]159[/C][C]1960.7[/C][C]2115.9186[/C][C]1592.7691[/C][C]2748.8789[/C][C]0.3154[/C][C]0.9827[/C][C]0.7983[/C][C]0.7983[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36443&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36443&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[147])
1351777-------
1361700-------
1371907.4-------
1381745.8-------
1391771.6-------
1401790.2-------
1411958.7-------
1421560.4-------
1431752.1-------
1442011.6-------
1452082.8-------
1461616.4-------
1471846.1-------
1481824.91963.81011713.03892239.21320.16140.79890.96980.7989
1491711.31860.73811598.30792151.93760.15720.59530.37670.5392
15018052001.99191696.52672344.01880.12950.95210.9290.8142
1511737.61875.96121552.43682243.95940.23060.64730.71080.5632
1521939.61965.15121606.66722376.18740.45150.86110.79790.7149
1531711.42037.40221645.24922490.71710.07930.66380.63320.7959
1541964.81927.95751529.26192394.26440.43850.81870.93880.6346
1551864.42017.36091584.66672526.65510.2780.58020.84630.7451
1561980.72148.711675.14282708.85670.27830.84010.68430.8552
1572226.72273.69671759.99432884.13160.440.82660.730.9151
1581433.31601.95711189.10372105.97720.2560.00760.47760.1712
1591960.72115.91861592.76912748.87890.31540.98270.79830.7983







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1480.0716-0.07070.005919296.00851608.000740.0999
1490.0798-0.08030.006722331.75031860.979243.1391
1500.0872-0.09840.008238805.81853233.818256.8667
1510.1001-0.07380.006119143.82931595.319139.9414
1520.1067-0.0130.0011652.865254.40547.376
1530.1135-0.160.0133106277.43578856.45394.1087
1540.12340.01910.00161357.3714113.114310.6355
1550.1288-0.07580.006323397.04411949.753744.156
1560.133-0.07820.006528227.36912352.280848.5003
1570.137-0.02070.00172208.6852184.057113.5668
1580.1605-0.10530.008828445.22832370.435748.6871
1590.1526-0.07340.006124092.80662007.733944.8077

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
148 & 0.0716 & -0.0707 & 0.0059 & 19296.0085 & 1608.0007 & 40.0999 \tabularnewline
149 & 0.0798 & -0.0803 & 0.0067 & 22331.7503 & 1860.9792 & 43.1391 \tabularnewline
150 & 0.0872 & -0.0984 & 0.0082 & 38805.8185 & 3233.8182 & 56.8667 \tabularnewline
151 & 0.1001 & -0.0738 & 0.0061 & 19143.8293 & 1595.3191 & 39.9414 \tabularnewline
152 & 0.1067 & -0.013 & 0.0011 & 652.8652 & 54.4054 & 7.376 \tabularnewline
153 & 0.1135 & -0.16 & 0.0133 & 106277.4357 & 8856.453 & 94.1087 \tabularnewline
154 & 0.1234 & 0.0191 & 0.0016 & 1357.3714 & 113.1143 & 10.6355 \tabularnewline
155 & 0.1288 & -0.0758 & 0.0063 & 23397.0441 & 1949.7537 & 44.156 \tabularnewline
156 & 0.133 & -0.0782 & 0.0065 & 28227.3691 & 2352.2808 & 48.5003 \tabularnewline
157 & 0.137 & -0.0207 & 0.0017 & 2208.6852 & 184.0571 & 13.5668 \tabularnewline
158 & 0.1605 & -0.1053 & 0.0088 & 28445.2283 & 2370.4357 & 48.6871 \tabularnewline
159 & 0.1526 & -0.0734 & 0.0061 & 24092.8066 & 2007.7339 & 44.8077 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36443&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]148[/C][C]0.0716[/C][C]-0.0707[/C][C]0.0059[/C][C]19296.0085[/C][C]1608.0007[/C][C]40.0999[/C][/ROW]
[ROW][C]149[/C][C]0.0798[/C][C]-0.0803[/C][C]0.0067[/C][C]22331.7503[/C][C]1860.9792[/C][C]43.1391[/C][/ROW]
[ROW][C]150[/C][C]0.0872[/C][C]-0.0984[/C][C]0.0082[/C][C]38805.8185[/C][C]3233.8182[/C][C]56.8667[/C][/ROW]
[ROW][C]151[/C][C]0.1001[/C][C]-0.0738[/C][C]0.0061[/C][C]19143.8293[/C][C]1595.3191[/C][C]39.9414[/C][/ROW]
[ROW][C]152[/C][C]0.1067[/C][C]-0.013[/C][C]0.0011[/C][C]652.8652[/C][C]54.4054[/C][C]7.376[/C][/ROW]
[ROW][C]153[/C][C]0.1135[/C][C]-0.16[/C][C]0.0133[/C][C]106277.4357[/C][C]8856.453[/C][C]94.1087[/C][/ROW]
[ROW][C]154[/C][C]0.1234[/C][C]0.0191[/C][C]0.0016[/C][C]1357.3714[/C][C]113.1143[/C][C]10.6355[/C][/ROW]
[ROW][C]155[/C][C]0.1288[/C][C]-0.0758[/C][C]0.0063[/C][C]23397.0441[/C][C]1949.7537[/C][C]44.156[/C][/ROW]
[ROW][C]156[/C][C]0.133[/C][C]-0.0782[/C][C]0.0065[/C][C]28227.3691[/C][C]2352.2808[/C][C]48.5003[/C][/ROW]
[ROW][C]157[/C][C]0.137[/C][C]-0.0207[/C][C]0.0017[/C][C]2208.6852[/C][C]184.0571[/C][C]13.5668[/C][/ROW]
[ROW][C]158[/C][C]0.1605[/C][C]-0.1053[/C][C]0.0088[/C][C]28445.2283[/C][C]2370.4357[/C][C]48.6871[/C][/ROW]
[ROW][C]159[/C][C]0.1526[/C][C]-0.0734[/C][C]0.0061[/C][C]24092.8066[/C][C]2007.7339[/C][C]44.8077[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36443&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36443&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
1480.0716-0.07070.005919296.00851608.000740.0999
1490.0798-0.08030.006722331.75031860.979243.1391
1500.0872-0.09840.008238805.81853233.818256.8667
1510.1001-0.07380.006119143.82931595.319139.9414
1520.1067-0.0130.0011652.865254.40547.376
1530.1135-0.160.0133106277.43578856.45394.1087
1540.12340.01910.00161357.3714113.114310.6355
1550.1288-0.07580.006323397.04411949.753744.156
1560.133-0.07820.006528227.36912352.280848.5003
1570.137-0.02070.00172208.6852184.057113.5668
1580.1605-0.10530.008828445.22832370.435748.6871
1590.1526-0.07340.006124092.80662007.733944.8077



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