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 computationTue, 22 Dec 2009 13:03:12 -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/22/t1261512237xtflr2di5952sfh.htm/, Retrieved Sat, 04 May 2024 18:25:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70476, Retrieved Sat, 04 May 2024 18:25:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact140
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] [workshop 10] [2009-12-09 18:40:24] [74be16979710d4c4e7c6647856088456]
-    D    [ARIMA Forecasting] [workshop 10 review] [2009-12-12 19:25:39] [309ee52d0058ff0a6f7eec15e07b2d9f]
- R P       [ARIMA Forecasting] [paper] [2009-12-15 18:35:07] [3d8acb8ffdb376c5fec19e610f8198c2]
-               [ARIMA Forecasting] [paper] [2009-12-22 20:03:12] [e81f30a5c3daacfe71a556c99a478849] [Current]
Feedback Forum

Post a new message
Dataseries X:
6.9
6.8
6.7
6.6
6.5
6.5
7.0
7.5
7.6
7.6
7.6
7.8
8.0
8.0
8.0
7.9
7.9
8.0
8.5
9.2
9.4
9.5
9.5
9.6
9.7
9.7
9.6
9.5
9.4
9.3
9.6
10.2
10.2
10.1
9.9
9.8
9.8
9.7
9.5
9.3
9.1
9.0
9.5
10.0
10.2
10.1
10.0
9.9
10.0
9.9
9.7
9.5
9.2
9.0
9.3
9.8
9.8
9.6
9.4
9.3
9.2
9.2
9.0
8.8
8.7
8.7
9.1
9.7
9.8
9.6
9.4
9.4
9.5
9.4
9.3
9.2
9.0
8.9
9.2
9.8
9.9
9.6
9.2
9.1
9.1
9.0
8.9
8.7
8.5
8.3
8.5
8.7
8.4
8.1
7.8
7.7
7.5
7.2
6.8
6.7
6.4
6.3
6.8
7.3
7.1
7.0
6.8
6.6
6.3
6.1
6.1
6.3
6.3
6.0
6.2
6.4
6.8
7.5
7.5
7.6
7.6
7.4
7.3
7.1
6.9
6.8
7.5
7.6
7.8
8.0
8.1
8.2
8.3
8.2
8.0
7.9
7.6
7.6
8.3
8.4
8.4
8.4
8.4
8.6
8.9
8.8
8.3
7.5
7.2
7.4
8.8
9.3
9.3
8.7
8.2
8.3
8.5
8.6
8.5
8.2
8.1
7.9
8.6
8.7
8.7
8.5
8.4
8.5
8.7
8.7
8.6
8.5
8.3
8.0
8.2
8.1
8.1
8.0
7.9
7.9




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70476&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[168])
1568.3-------
1578.5-------
1588.6-------
1598.5-------
1608.2-------
1618.1-------
1627.9-------
1638.6-------
1648.7-------
1658.7-------
1668.5-------
1678.4-------
1688.5-------
1698.78.5878.2748.90.23970.70710.70710.7071
1708.78.49397.92339.06460.23950.23950.35780.4917
1718.68.2897.50929.06880.21720.15080.29790.2979
1728.58.00867.10898.90830.14220.09880.33840.1422
1738.37.8946.92848.85950.20490.10930.33790.1093
17487.79426.78588.80250.34450.16280.41850.085
1758.28.49527.44479.54560.29090.82220.42250.4964
1768.18.69357.59189.79520.14550.810.49540.6347
1778.18.7027.549.8640.1550.8450.50130.6333
17888.53717.31329.7610.19480.7580.52370.5237
1797.98.40417.12359.68460.22020.73190.50250.4416
1807.98.48627.1569.81640.19390.80610.49190.4919

\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[168]) \tabularnewline
156 & 8.3 & - & - & - & - & - & - & - \tabularnewline
157 & 8.5 & - & - & - & - & - & - & - \tabularnewline
158 & 8.6 & - & - & - & - & - & - & - \tabularnewline
159 & 8.5 & - & - & - & - & - & - & - \tabularnewline
160 & 8.2 & - & - & - & - & - & - & - \tabularnewline
161 & 8.1 & - & - & - & - & - & - & - \tabularnewline
162 & 7.9 & - & - & - & - & - & - & - \tabularnewline
163 & 8.6 & - & - & - & - & - & - & - \tabularnewline
164 & 8.7 & - & - & - & - & - & - & - \tabularnewline
165 & 8.7 & - & - & - & - & - & - & - \tabularnewline
166 & 8.5 & - & - & - & - & - & - & - \tabularnewline
167 & 8.4 & - & - & - & - & - & - & - \tabularnewline
168 & 8.5 & - & - & - & - & - & - & - \tabularnewline
169 & 8.7 & 8.587 & 8.274 & 8.9 & 0.2397 & 0.7071 & 0.7071 & 0.7071 \tabularnewline
170 & 8.7 & 8.4939 & 7.9233 & 9.0646 & 0.2395 & 0.2395 & 0.3578 & 0.4917 \tabularnewline
171 & 8.6 & 8.289 & 7.5092 & 9.0688 & 0.2172 & 0.1508 & 0.2979 & 0.2979 \tabularnewline
172 & 8.5 & 8.0086 & 7.1089 & 8.9083 & 0.1422 & 0.0988 & 0.3384 & 0.1422 \tabularnewline
173 & 8.3 & 7.894 & 6.9284 & 8.8595 & 0.2049 & 0.1093 & 0.3379 & 0.1093 \tabularnewline
174 & 8 & 7.7942 & 6.7858 & 8.8025 & 0.3445 & 0.1628 & 0.4185 & 0.085 \tabularnewline
175 & 8.2 & 8.4952 & 7.4447 & 9.5456 & 0.2909 & 0.8222 & 0.4225 & 0.4964 \tabularnewline
176 & 8.1 & 8.6935 & 7.5918 & 9.7952 & 0.1455 & 0.81 & 0.4954 & 0.6347 \tabularnewline
177 & 8.1 & 8.702 & 7.54 & 9.864 & 0.155 & 0.845 & 0.5013 & 0.6333 \tabularnewline
178 & 8 & 8.5371 & 7.3132 & 9.761 & 0.1948 & 0.758 & 0.5237 & 0.5237 \tabularnewline
179 & 7.9 & 8.4041 & 7.1235 & 9.6846 & 0.2202 & 0.7319 & 0.5025 & 0.4416 \tabularnewline
180 & 7.9 & 8.4862 & 7.156 & 9.8164 & 0.1939 & 0.8061 & 0.4919 & 0.4919 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70476&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[168])[/C][/ROW]
[ROW][C]156[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]157[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]158[/C][C]8.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]159[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]160[/C][C]8.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]161[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]162[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]163[/C][C]8.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]164[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]165[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]166[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]167[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]168[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]169[/C][C]8.7[/C][C]8.587[/C][C]8.274[/C][C]8.9[/C][C]0.2397[/C][C]0.7071[/C][C]0.7071[/C][C]0.7071[/C][/ROW]
[ROW][C]170[/C][C]8.7[/C][C]8.4939[/C][C]7.9233[/C][C]9.0646[/C][C]0.2395[/C][C]0.2395[/C][C]0.3578[/C][C]0.4917[/C][/ROW]
[ROW][C]171[/C][C]8.6[/C][C]8.289[/C][C]7.5092[/C][C]9.0688[/C][C]0.2172[/C][C]0.1508[/C][C]0.2979[/C][C]0.2979[/C][/ROW]
[ROW][C]172[/C][C]8.5[/C][C]8.0086[/C][C]7.1089[/C][C]8.9083[/C][C]0.1422[/C][C]0.0988[/C][C]0.3384[/C][C]0.1422[/C][/ROW]
[ROW][C]173[/C][C]8.3[/C][C]7.894[/C][C]6.9284[/C][C]8.8595[/C][C]0.2049[/C][C]0.1093[/C][C]0.3379[/C][C]0.1093[/C][/ROW]
[ROW][C]174[/C][C]8[/C][C]7.7942[/C][C]6.7858[/C][C]8.8025[/C][C]0.3445[/C][C]0.1628[/C][C]0.4185[/C][C]0.085[/C][/ROW]
[ROW][C]175[/C][C]8.2[/C][C]8.4952[/C][C]7.4447[/C][C]9.5456[/C][C]0.2909[/C][C]0.8222[/C][C]0.4225[/C][C]0.4964[/C][/ROW]
[ROW][C]176[/C][C]8.1[/C][C]8.6935[/C][C]7.5918[/C][C]9.7952[/C][C]0.1455[/C][C]0.81[/C][C]0.4954[/C][C]0.6347[/C][/ROW]
[ROW][C]177[/C][C]8.1[/C][C]8.702[/C][C]7.54[/C][C]9.864[/C][C]0.155[/C][C]0.845[/C][C]0.5013[/C][C]0.6333[/C][/ROW]
[ROW][C]178[/C][C]8[/C][C]8.5371[/C][C]7.3132[/C][C]9.761[/C][C]0.1948[/C][C]0.758[/C][C]0.5237[/C][C]0.5237[/C][/ROW]
[ROW][C]179[/C][C]7.9[/C][C]8.4041[/C][C]7.1235[/C][C]9.6846[/C][C]0.2202[/C][C]0.7319[/C][C]0.5025[/C][C]0.4416[/C][/ROW]
[ROW][C]180[/C][C]7.9[/C][C]8.4862[/C][C]7.156[/C][C]9.8164[/C][C]0.1939[/C][C]0.8061[/C][C]0.4919[/C][C]0.4919[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70476&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70476&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[168])
1568.3-------
1578.5-------
1588.6-------
1598.5-------
1608.2-------
1618.1-------
1627.9-------
1638.6-------
1648.7-------
1658.7-------
1668.5-------
1678.4-------
1688.5-------
1698.78.5878.2748.90.23970.70710.70710.7071
1708.78.49397.92339.06460.23950.23950.35780.4917
1718.68.2897.50929.06880.21720.15080.29790.2979
1728.58.00867.10898.90830.14220.09880.33840.1422
1738.37.8946.92848.85950.20490.10930.33790.1093
17487.79426.78588.80250.34450.16280.41850.085
1758.28.49527.44479.54560.29090.82220.42250.4964
1768.18.69357.59189.79520.14550.810.49540.6347
1778.18.7027.549.8640.1550.8450.50130.6333
17888.53717.31329.7610.19480.7580.52370.5237
1797.98.40417.12359.68460.22020.73190.50250.4416
1807.98.48627.1569.81640.19390.80610.49190.4919







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1690.01860.013200.012800
1700.03430.02430.01870.04250.02760.1662
1710.0480.03750.0250.09670.05070.2251
1720.05730.06140.03410.24150.09840.3136
1730.06240.05140.03750.16490.11170.3342
1740.0660.02640.03570.04240.10010.3164
1750.0631-0.03470.03560.08710.09830.3135
1760.0647-0.06830.03960.35220.130.3606
1770.0681-0.06920.04290.36240.15580.3947
1780.0731-0.06290.04490.28850.16910.4112
1790.0777-0.060.04630.25410.17680.4205
1800.08-0.06910.04820.34360.19070.4367

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
169 & 0.0186 & 0.0132 & 0 & 0.0128 & 0 & 0 \tabularnewline
170 & 0.0343 & 0.0243 & 0.0187 & 0.0425 & 0.0276 & 0.1662 \tabularnewline
171 & 0.048 & 0.0375 & 0.025 & 0.0967 & 0.0507 & 0.2251 \tabularnewline
172 & 0.0573 & 0.0614 & 0.0341 & 0.2415 & 0.0984 & 0.3136 \tabularnewline
173 & 0.0624 & 0.0514 & 0.0375 & 0.1649 & 0.1117 & 0.3342 \tabularnewline
174 & 0.066 & 0.0264 & 0.0357 & 0.0424 & 0.1001 & 0.3164 \tabularnewline
175 & 0.0631 & -0.0347 & 0.0356 & 0.0871 & 0.0983 & 0.3135 \tabularnewline
176 & 0.0647 & -0.0683 & 0.0396 & 0.3522 & 0.13 & 0.3606 \tabularnewline
177 & 0.0681 & -0.0692 & 0.0429 & 0.3624 & 0.1558 & 0.3947 \tabularnewline
178 & 0.0731 & -0.0629 & 0.0449 & 0.2885 & 0.1691 & 0.4112 \tabularnewline
179 & 0.0777 & -0.06 & 0.0463 & 0.2541 & 0.1768 & 0.4205 \tabularnewline
180 & 0.08 & -0.0691 & 0.0482 & 0.3436 & 0.1907 & 0.4367 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70476&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]169[/C][C]0.0186[/C][C]0.0132[/C][C]0[/C][C]0.0128[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]170[/C][C]0.0343[/C][C]0.0243[/C][C]0.0187[/C][C]0.0425[/C][C]0.0276[/C][C]0.1662[/C][/ROW]
[ROW][C]171[/C][C]0.048[/C][C]0.0375[/C][C]0.025[/C][C]0.0967[/C][C]0.0507[/C][C]0.2251[/C][/ROW]
[ROW][C]172[/C][C]0.0573[/C][C]0.0614[/C][C]0.0341[/C][C]0.2415[/C][C]0.0984[/C][C]0.3136[/C][/ROW]
[ROW][C]173[/C][C]0.0624[/C][C]0.0514[/C][C]0.0375[/C][C]0.1649[/C][C]0.1117[/C][C]0.3342[/C][/ROW]
[ROW][C]174[/C][C]0.066[/C][C]0.0264[/C][C]0.0357[/C][C]0.0424[/C][C]0.1001[/C][C]0.3164[/C][/ROW]
[ROW][C]175[/C][C]0.0631[/C][C]-0.0347[/C][C]0.0356[/C][C]0.0871[/C][C]0.0983[/C][C]0.3135[/C][/ROW]
[ROW][C]176[/C][C]0.0647[/C][C]-0.0683[/C][C]0.0396[/C][C]0.3522[/C][C]0.13[/C][C]0.3606[/C][/ROW]
[ROW][C]177[/C][C]0.0681[/C][C]-0.0692[/C][C]0.0429[/C][C]0.3624[/C][C]0.1558[/C][C]0.3947[/C][/ROW]
[ROW][C]178[/C][C]0.0731[/C][C]-0.0629[/C][C]0.0449[/C][C]0.2885[/C][C]0.1691[/C][C]0.4112[/C][/ROW]
[ROW][C]179[/C][C]0.0777[/C][C]-0.06[/C][C]0.0463[/C][C]0.2541[/C][C]0.1768[/C][C]0.4205[/C][/ROW]
[ROW][C]180[/C][C]0.08[/C][C]-0.0691[/C][C]0.0482[/C][C]0.3436[/C][C]0.1907[/C][C]0.4367[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70476&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70476&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
1690.01860.013200.012800
1700.03430.02430.01870.04250.02760.1662
1710.0480.03750.0250.09670.05070.2251
1720.05730.06140.03410.24150.09840.3136
1730.06240.05140.03750.16490.11170.3342
1740.0660.02640.03570.04240.10010.3164
1750.0631-0.03470.03560.08710.09830.3135
1760.0647-0.06830.03960.35220.130.3606
1770.0681-0.06920.04290.36240.15580.3947
1780.0731-0.06290.04490.28850.16910.4112
1790.0777-0.060.04630.25410.17680.4205
1800.08-0.06910.04820.34360.19070.4367



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