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 computationFri, 23 Dec 2016 14:34:05 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/23/t1482501133xkazqafeobw5yk5.htm/, Retrieved Tue, 07 May 2024 12:06:00 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302949, Retrieved Tue, 07 May 2024 12:06:00 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact72
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-23 13:34:05] [8e62cbb8023b87d93040197279d31dd8] [Current]
- RM      [ARIMA Forecasting] [] [2016-12-23 17:39:01] [74be16979710d4c4e7c6647856088456]
Feedback Forum

Post a new message
Dataseries X:
5731
5461
4594
3770
3551
3094
3020
3081
3041
3087
3455
3225
3177
2551
1680
1599
1846
1990
2238
2089
2230
2468
2675
2989
2868
2564
1583
1435
1297
1266
1607
1819
2039
1817
1833
2442
2157
1870
1057
660
1057
1127
1096
1018
1184
1690
1868
2019
2170
1994
917
566
727
980
1138
1069
1039
1509
1591
2056
1975
1748
738
1039
1038
1054
1689
1726
2101
2325
2155
2190
1725
1404
571
704
1061
1593
2039
1767
1804
1520
1795
2171
1853
1425
835
927
1204
1408
1828
1788
1878
1513
1538
2273
2223
1833
1380
1081
1586
1809
1737
1896
2248
2116
2416
2934
2513
1958
986
1378
2071
2272
2474




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302949&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302949&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302949&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[103])
911828-------
921788-------
931878-------
941513-------
951538-------
962273-------
972223-------
981833-------
991380-------
1001081-------
1011586-------
1021809-------
1031737-------
10418961692.95381200.87192289.58920.25240.44250.37740.4425
10522481832.01411171.2832677.04180.16730.4410.45750.5872
10621161734.59881014.37952697.26440.21870.14790.67410.498
10724161832.63321025.27332935.07230.14980.30720.69980.5675
10829342328.78131326.39773685.80780.1910.44990.53210.8036
10925132150.65971157.07363532.7890.30370.13330.45910.7213
11019581782.3714875.34623098.49390.39680.13830.46990.5269
1119861090.939426.54742155.65850.42340.05520.29730.1172
11213781018.2322369.75752089.510.25520.52350.45430.0942
11320711369.4537550.91622665.62650.14440.49480.37170.2892
11422721609.8075673.06843069.06320.18690.26780.39450.4322
11524741832.3197786.07813444.22310.21760.29650.54610.5461

\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[103]) \tabularnewline
91 & 1828 & - & - & - & - & - & - & - \tabularnewline
92 & 1788 & - & - & - & - & - & - & - \tabularnewline
93 & 1878 & - & - & - & - & - & - & - \tabularnewline
94 & 1513 & - & - & - & - & - & - & - \tabularnewline
95 & 1538 & - & - & - & - & - & - & - \tabularnewline
96 & 2273 & - & - & - & - & - & - & - \tabularnewline
97 & 2223 & - & - & - & - & - & - & - \tabularnewline
98 & 1833 & - & - & - & - & - & - & - \tabularnewline
99 & 1380 & - & - & - & - & - & - & - \tabularnewline
100 & 1081 & - & - & - & - & - & - & - \tabularnewline
101 & 1586 & - & - & - & - & - & - & - \tabularnewline
102 & 1809 & - & - & - & - & - & - & - \tabularnewline
103 & 1737 & - & - & - & - & - & - & - \tabularnewline
104 & 1896 & 1692.9538 & 1200.8719 & 2289.5892 & 0.2524 & 0.4425 & 0.3774 & 0.4425 \tabularnewline
105 & 2248 & 1832.0141 & 1171.283 & 2677.0418 & 0.1673 & 0.441 & 0.4575 & 0.5872 \tabularnewline
106 & 2116 & 1734.5988 & 1014.3795 & 2697.2644 & 0.2187 & 0.1479 & 0.6741 & 0.498 \tabularnewline
107 & 2416 & 1832.6332 & 1025.2733 & 2935.0723 & 0.1498 & 0.3072 & 0.6998 & 0.5675 \tabularnewline
108 & 2934 & 2328.7813 & 1326.3977 & 3685.8078 & 0.191 & 0.4499 & 0.5321 & 0.8036 \tabularnewline
109 & 2513 & 2150.6597 & 1157.0736 & 3532.789 & 0.3037 & 0.1333 & 0.4591 & 0.7213 \tabularnewline
110 & 1958 & 1782.3714 & 875.3462 & 3098.4939 & 0.3968 & 0.1383 & 0.4699 & 0.5269 \tabularnewline
111 & 986 & 1090.939 & 426.5474 & 2155.6585 & 0.4234 & 0.0552 & 0.2973 & 0.1172 \tabularnewline
112 & 1378 & 1018.2322 & 369.7575 & 2089.51 & 0.2552 & 0.5235 & 0.4543 & 0.0942 \tabularnewline
113 & 2071 & 1369.4537 & 550.9162 & 2665.6265 & 0.1444 & 0.4948 & 0.3717 & 0.2892 \tabularnewline
114 & 2272 & 1609.8075 & 673.0684 & 3069.0632 & 0.1869 & 0.2678 & 0.3945 & 0.4322 \tabularnewline
115 & 2474 & 1832.3197 & 786.0781 & 3444.2231 & 0.2176 & 0.2965 & 0.5461 & 0.5461 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302949&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[103])[/C][/ROW]
[ROW][C]91[/C][C]1828[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]1788[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]1878[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]1513[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]1538[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]2273[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2223[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]1833[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]1380[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]1081[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]1586[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]1809[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]1737[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]1896[/C][C]1692.9538[/C][C]1200.8719[/C][C]2289.5892[/C][C]0.2524[/C][C]0.4425[/C][C]0.3774[/C][C]0.4425[/C][/ROW]
[ROW][C]105[/C][C]2248[/C][C]1832.0141[/C][C]1171.283[/C][C]2677.0418[/C][C]0.1673[/C][C]0.441[/C][C]0.4575[/C][C]0.5872[/C][/ROW]
[ROW][C]106[/C][C]2116[/C][C]1734.5988[/C][C]1014.3795[/C][C]2697.2644[/C][C]0.2187[/C][C]0.1479[/C][C]0.6741[/C][C]0.498[/C][/ROW]
[ROW][C]107[/C][C]2416[/C][C]1832.6332[/C][C]1025.2733[/C][C]2935.0723[/C][C]0.1498[/C][C]0.3072[/C][C]0.6998[/C][C]0.5675[/C][/ROW]
[ROW][C]108[/C][C]2934[/C][C]2328.7813[/C][C]1326.3977[/C][C]3685.8078[/C][C]0.191[/C][C]0.4499[/C][C]0.5321[/C][C]0.8036[/C][/ROW]
[ROW][C]109[/C][C]2513[/C][C]2150.6597[/C][C]1157.0736[/C][C]3532.789[/C][C]0.3037[/C][C]0.1333[/C][C]0.4591[/C][C]0.7213[/C][/ROW]
[ROW][C]110[/C][C]1958[/C][C]1782.3714[/C][C]875.3462[/C][C]3098.4939[/C][C]0.3968[/C][C]0.1383[/C][C]0.4699[/C][C]0.5269[/C][/ROW]
[ROW][C]111[/C][C]986[/C][C]1090.939[/C][C]426.5474[/C][C]2155.6585[/C][C]0.4234[/C][C]0.0552[/C][C]0.2973[/C][C]0.1172[/C][/ROW]
[ROW][C]112[/C][C]1378[/C][C]1018.2322[/C][C]369.7575[/C][C]2089.51[/C][C]0.2552[/C][C]0.5235[/C][C]0.4543[/C][C]0.0942[/C][/ROW]
[ROW][C]113[/C][C]2071[/C][C]1369.4537[/C][C]550.9162[/C][C]2665.6265[/C][C]0.1444[/C][C]0.4948[/C][C]0.3717[/C][C]0.2892[/C][/ROW]
[ROW][C]114[/C][C]2272[/C][C]1609.8075[/C][C]673.0684[/C][C]3069.0632[/C][C]0.1869[/C][C]0.2678[/C][C]0.3945[/C][C]0.4322[/C][/ROW]
[ROW][C]115[/C][C]2474[/C][C]1832.3197[/C][C]786.0781[/C][C]3444.2231[/C][C]0.2176[/C][C]0.2965[/C][C]0.5461[/C][C]0.5461[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302949&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302949&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[103])
911828-------
921788-------
931878-------
941513-------
951538-------
962273-------
972223-------
981833-------
991380-------
1001081-------
1011586-------
1021809-------
1031737-------
10418961692.95381200.87192289.58920.25240.44250.37740.4425
10522481832.01411171.2832677.04180.16730.4410.45750.5872
10621161734.59881014.37952697.26440.21870.14790.67410.498
10724161832.63321025.27332935.07230.14980.30720.69980.5675
10829342328.78131326.39773685.80780.1910.44990.53210.8036
10925132150.65971157.07363532.7890.30370.13330.45910.7213
11019581782.3714875.34623098.49390.39680.13830.46990.5269
1119861090.939426.54742155.65850.42340.05520.29730.1172
11213781018.2322369.75752089.510.25520.52350.45430.0942
11320711369.4537550.91622665.62650.14440.49480.37170.2892
11422721609.8075673.06843069.06320.18690.26780.39450.4322
11524741832.3197786.07813444.22310.21760.29650.54610.5461







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1040.17980.10710.10710.113241227.7774000.47140.4714
1050.23530.1850.14610.1585173044.2486107136.013327.31640.96580.7186
1060.28320.18020.15750.1717145466.8512119912.9591346.28450.88550.7742
1070.30690.24150.17850.1974340316.8658175013.9358418.34671.35440.9193
1080.29730.20630.1840.204366289.6328213269.0752461.81061.40511.0164
1090.32790.14420.17740.1959131290.5084199605.9807446.77290.84120.9872
1100.37670.08970.16490.181330845.3927175497.3253418.9240.40770.9044
1110.4979-0.10640.15760.171311012.1873154936.683393.62-0.24360.8218
1120.53680.26110.16910.1856129432.9038152102.9298390.00380.83530.8233
1130.48290.33870.1860.2078492167.1635186109.3532431.40391.62870.9039
1140.46250.29150.19560.2199438498.8702209053.8547457.22411.53740.9615
1150.44880.25940.20090.2265411753.6438225945.5038475.33731.48981.0055

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
104 & 0.1798 & 0.1071 & 0.1071 & 0.1132 & 41227.7774 & 0 & 0 & 0.4714 & 0.4714 \tabularnewline
105 & 0.2353 & 0.185 & 0.1461 & 0.1585 & 173044.2486 & 107136.013 & 327.3164 & 0.9658 & 0.7186 \tabularnewline
106 & 0.2832 & 0.1802 & 0.1575 & 0.1717 & 145466.8512 & 119912.9591 & 346.2845 & 0.8855 & 0.7742 \tabularnewline
107 & 0.3069 & 0.2415 & 0.1785 & 0.1974 & 340316.8658 & 175013.9358 & 418.3467 & 1.3544 & 0.9193 \tabularnewline
108 & 0.2973 & 0.2063 & 0.184 & 0.204 & 366289.6328 & 213269.0752 & 461.8106 & 1.4051 & 1.0164 \tabularnewline
109 & 0.3279 & 0.1442 & 0.1774 & 0.1959 & 131290.5084 & 199605.9807 & 446.7729 & 0.8412 & 0.9872 \tabularnewline
110 & 0.3767 & 0.0897 & 0.1649 & 0.1813 & 30845.3927 & 175497.3253 & 418.924 & 0.4077 & 0.9044 \tabularnewline
111 & 0.4979 & -0.1064 & 0.1576 & 0.1713 & 11012.1873 & 154936.683 & 393.62 & -0.2436 & 0.8218 \tabularnewline
112 & 0.5368 & 0.2611 & 0.1691 & 0.1856 & 129432.9038 & 152102.9298 & 390.0038 & 0.8353 & 0.8233 \tabularnewline
113 & 0.4829 & 0.3387 & 0.186 & 0.2078 & 492167.1635 & 186109.3532 & 431.4039 & 1.6287 & 0.9039 \tabularnewline
114 & 0.4625 & 0.2915 & 0.1956 & 0.2199 & 438498.8702 & 209053.8547 & 457.2241 & 1.5374 & 0.9615 \tabularnewline
115 & 0.4488 & 0.2594 & 0.2009 & 0.2265 & 411753.6438 & 225945.5038 & 475.3373 & 1.4898 & 1.0055 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302949&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]104[/C][C]0.1798[/C][C]0.1071[/C][C]0.1071[/C][C]0.1132[/C][C]41227.7774[/C][C]0[/C][C]0[/C][C]0.4714[/C][C]0.4714[/C][/ROW]
[ROW][C]105[/C][C]0.2353[/C][C]0.185[/C][C]0.1461[/C][C]0.1585[/C][C]173044.2486[/C][C]107136.013[/C][C]327.3164[/C][C]0.9658[/C][C]0.7186[/C][/ROW]
[ROW][C]106[/C][C]0.2832[/C][C]0.1802[/C][C]0.1575[/C][C]0.1717[/C][C]145466.8512[/C][C]119912.9591[/C][C]346.2845[/C][C]0.8855[/C][C]0.7742[/C][/ROW]
[ROW][C]107[/C][C]0.3069[/C][C]0.2415[/C][C]0.1785[/C][C]0.1974[/C][C]340316.8658[/C][C]175013.9358[/C][C]418.3467[/C][C]1.3544[/C][C]0.9193[/C][/ROW]
[ROW][C]108[/C][C]0.2973[/C][C]0.2063[/C][C]0.184[/C][C]0.204[/C][C]366289.6328[/C][C]213269.0752[/C][C]461.8106[/C][C]1.4051[/C][C]1.0164[/C][/ROW]
[ROW][C]109[/C][C]0.3279[/C][C]0.1442[/C][C]0.1774[/C][C]0.1959[/C][C]131290.5084[/C][C]199605.9807[/C][C]446.7729[/C][C]0.8412[/C][C]0.9872[/C][/ROW]
[ROW][C]110[/C][C]0.3767[/C][C]0.0897[/C][C]0.1649[/C][C]0.1813[/C][C]30845.3927[/C][C]175497.3253[/C][C]418.924[/C][C]0.4077[/C][C]0.9044[/C][/ROW]
[ROW][C]111[/C][C]0.4979[/C][C]-0.1064[/C][C]0.1576[/C][C]0.1713[/C][C]11012.1873[/C][C]154936.683[/C][C]393.62[/C][C]-0.2436[/C][C]0.8218[/C][/ROW]
[ROW][C]112[/C][C]0.5368[/C][C]0.2611[/C][C]0.1691[/C][C]0.1856[/C][C]129432.9038[/C][C]152102.9298[/C][C]390.0038[/C][C]0.8353[/C][C]0.8233[/C][/ROW]
[ROW][C]113[/C][C]0.4829[/C][C]0.3387[/C][C]0.186[/C][C]0.2078[/C][C]492167.1635[/C][C]186109.3532[/C][C]431.4039[/C][C]1.6287[/C][C]0.9039[/C][/ROW]
[ROW][C]114[/C][C]0.4625[/C][C]0.2915[/C][C]0.1956[/C][C]0.2199[/C][C]438498.8702[/C][C]209053.8547[/C][C]457.2241[/C][C]1.5374[/C][C]0.9615[/C][/ROW]
[ROW][C]115[/C][C]0.4488[/C][C]0.2594[/C][C]0.2009[/C][C]0.2265[/C][C]411753.6438[/C][C]225945.5038[/C][C]475.3373[/C][C]1.4898[/C][C]1.0055[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302949&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302949&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1040.17980.10710.10710.113241227.7774000.47140.4714
1050.23530.1850.14610.1585173044.2486107136.013327.31640.96580.7186
1060.28320.18020.15750.1717145466.8512119912.9591346.28450.88550.7742
1070.30690.24150.17850.1974340316.8658175013.9358418.34671.35440.9193
1080.29730.20630.1840.204366289.6328213269.0752461.81061.40511.0164
1090.32790.14420.17740.1959131290.5084199605.9807446.77290.84120.9872
1100.37670.08970.16490.181330845.3927175497.3253418.9240.40770.9044
1110.4979-0.10640.15760.171311012.1873154936.683393.62-0.24360.8218
1120.53680.26110.16910.1856129432.9038152102.9298390.00380.83530.8233
1130.48290.33870.1860.2078492167.1635186109.3532431.40391.62870.9039
1140.46250.29150.19560.2199438498.8702209053.8547457.22411.53740.9615
1150.44880.25940.20090.2265411753.6438225945.5038475.33731.48981.0055



Parameters (Session):
par1 = 12 ; par2 = 0.4 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = TRUE ;
Parameters (R input):
par1 = 12 ; par2 = 0.4 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = TRUE ;
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*2
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')