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, 06 Dec 2011 18:30:39 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/06/t1323214258b5rx2pje6rl9xro.htm/, Retrieved Mon, 29 Apr 2024 03:59:24 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=152041, Retrieved Mon, 29 Apr 2024 03:59:24 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact106
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
-   PD      [ARIMA Forecasting] [WS9 - ARIMA Forec...] [2010-12-04 16:25:58] [8ef49741e164ec6343c90c7935194465]
-   P         [ARIMA Forecasting] [WS9 - ARIMA Forec...] [2010-12-04 16:58:46] [8ef49741e164ec6343c90c7935194465]
- R PD          [ARIMA Forecasting] [WS9 - ARIMA Forec...] [2010-12-07 11:26:44] [1f5baf2b24e732d76900bb8178fc04e7]
-                 [ARIMA Forecasting] [WS9 - ARIMA Forec...] [2010-12-07 11:48:16] [1f5baf2b24e732d76900bb8178fc04e7]
- R P                 [ARIMA Forecasting] [Arima Forecasting 13] [2011-12-06 23:30:39] [0f9b7c3b8d01420b2751adc6f98a35df] [Current]
Feedback Forum

Post a new message
Dataseries X:
2.4
2.4
2.5
2.6
2.4
2.6
2.4
2.3
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.5
2.1
2.1
2
2
2
1.9
1.9
2
1.8
1.6
1.3
1.4
1.4
1.5
1.7
1.6
1.5
1.6
1.5
1.1
1.1
1.1
1.4
1.3
1.4
1.3
1.1
1
0.9
0.8
0.8
0.8
0.8
1
1.1
1
0.9
1.1
1.2
1.2
1.4
1.5
1.7
1.9
1.9
1.9
1.7
1.7
2.1
2
2
2.5
2.4
2.5
2.5
2
1.9
2.2
2.7
3.1
2.8
2.6
2.3
2.2
2.2
2
2
2.6
2.5
2.5
2.3
2
1.9
2
2.1
2.1
2.3
2.3
2.3
2.1
2.4
2.5
2.1
1.8
1.9
1.9
2.1
2.2
2
2.2
2
1.9
1.6
1.7
2
2.5
2.4
2.3
2.3
2.1
2.4
2.2
2.4
1.9
2.1
2.1
2.1
2
2.1
2.2
2.2
2.6
2.5
2.3
2.2
2.4
2.3
2.2
2.5
2.5
2.5
2.4
2.3
1.7
1.6
1.9
1.9
1.8
1.8
1.9
1.9
1.9
1.9
1.8
1.7
2.1
2.6
3.1
3.1
3.2
3.3
3.6
3.3
3.7
4
4
3.8
3.6
3.2
2.1
1.6
1.1
1.2
0.6
0.6
0
-0.1
-0.6
-0.2
-0.3
-0.1
0.5
0.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' @ jenkins.wessa.net

\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' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152041&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' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=152041&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152041&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' @ jenkins.wessa.net







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[167])
1553.1-------
1563.1-------
1573.2-------
1583.3-------
1593.6-------
1603.3-------
1613.7-------
1624-------
1634-------
1643.8-------
1653.6-------
1663.2-------
1672.1-------
1681.62.0871.72752.44640.0040.471700.4717
1691.12.0641.54592.58221e-040.960400.4459
1701.21.98791.35722.61860.00720.997100.3638
1710.61.76451.03232.49689e-040.934600.1846
1720.61.94481.12912.76056e-040.99946e-040.3546
17301.69270.79672.58881e-040.991600.1865
174-0.11.49020.52472.45576e-040.998800.1079
175-0.61.52910.49522.56300.99900.1396
176-0.21.68260.58812.77724e-0411e-040.2274
177-0.31.66910.51412.82424e-040.99925e-040.2323
178-0.11.73560.5262.94510.00150.99950.00880.2774
1790.52.26080.99663.52510.00320.99990.59840.5984
1800.92.260.98923.53090.0180.99670.84560.5975

\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[167]) \tabularnewline
155 & 3.1 & - & - & - & - & - & - & - \tabularnewline
156 & 3.1 & - & - & - & - & - & - & - \tabularnewline
157 & 3.2 & - & - & - & - & - & - & - \tabularnewline
158 & 3.3 & - & - & - & - & - & - & - \tabularnewline
159 & 3.6 & - & - & - & - & - & - & - \tabularnewline
160 & 3.3 & - & - & - & - & - & - & - \tabularnewline
161 & 3.7 & - & - & - & - & - & - & - \tabularnewline
162 & 4 & - & - & - & - & - & - & - \tabularnewline
163 & 4 & - & - & - & - & - & - & - \tabularnewline
164 & 3.8 & - & - & - & - & - & - & - \tabularnewline
165 & 3.6 & - & - & - & - & - & - & - \tabularnewline
166 & 3.2 & - & - & - & - & - & - & - \tabularnewline
167 & 2.1 & - & - & - & - & - & - & - \tabularnewline
168 & 1.6 & 2.087 & 1.7275 & 2.4464 & 0.004 & 0.4717 & 0 & 0.4717 \tabularnewline
169 & 1.1 & 2.064 & 1.5459 & 2.5822 & 1e-04 & 0.9604 & 0 & 0.4459 \tabularnewline
170 & 1.2 & 1.9879 & 1.3572 & 2.6186 & 0.0072 & 0.9971 & 0 & 0.3638 \tabularnewline
171 & 0.6 & 1.7645 & 1.0323 & 2.4968 & 9e-04 & 0.9346 & 0 & 0.1846 \tabularnewline
172 & 0.6 & 1.9448 & 1.1291 & 2.7605 & 6e-04 & 0.9994 & 6e-04 & 0.3546 \tabularnewline
173 & 0 & 1.6927 & 0.7967 & 2.5888 & 1e-04 & 0.9916 & 0 & 0.1865 \tabularnewline
174 & -0.1 & 1.4902 & 0.5247 & 2.4557 & 6e-04 & 0.9988 & 0 & 0.1079 \tabularnewline
175 & -0.6 & 1.5291 & 0.4952 & 2.563 & 0 & 0.999 & 0 & 0.1396 \tabularnewline
176 & -0.2 & 1.6826 & 0.5881 & 2.7772 & 4e-04 & 1 & 1e-04 & 0.2274 \tabularnewline
177 & -0.3 & 1.6691 & 0.5141 & 2.8242 & 4e-04 & 0.9992 & 5e-04 & 0.2323 \tabularnewline
178 & -0.1 & 1.7356 & 0.526 & 2.9451 & 0.0015 & 0.9995 & 0.0088 & 0.2774 \tabularnewline
179 & 0.5 & 2.2608 & 0.9966 & 3.5251 & 0.0032 & 0.9999 & 0.5984 & 0.5984 \tabularnewline
180 & 0.9 & 2.26 & 0.9892 & 3.5309 & 0.018 & 0.9967 & 0.8456 & 0.5975 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152041&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[167])[/C][/ROW]
[ROW][C]155[/C][C]3.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]156[/C][C]3.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]157[/C][C]3.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]158[/C][C]3.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]159[/C][C]3.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]160[/C][C]3.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]161[/C][C]3.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]162[/C][C]4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]163[/C][C]4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]164[/C][C]3.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]165[/C][C]3.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]166[/C][C]3.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]167[/C][C]2.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]168[/C][C]1.6[/C][C]2.087[/C][C]1.7275[/C][C]2.4464[/C][C]0.004[/C][C]0.4717[/C][C]0[/C][C]0.4717[/C][/ROW]
[ROW][C]169[/C][C]1.1[/C][C]2.064[/C][C]1.5459[/C][C]2.5822[/C][C]1e-04[/C][C]0.9604[/C][C]0[/C][C]0.4459[/C][/ROW]
[ROW][C]170[/C][C]1.2[/C][C]1.9879[/C][C]1.3572[/C][C]2.6186[/C][C]0.0072[/C][C]0.9971[/C][C]0[/C][C]0.3638[/C][/ROW]
[ROW][C]171[/C][C]0.6[/C][C]1.7645[/C][C]1.0323[/C][C]2.4968[/C][C]9e-04[/C][C]0.9346[/C][C]0[/C][C]0.1846[/C][/ROW]
[ROW][C]172[/C][C]0.6[/C][C]1.9448[/C][C]1.1291[/C][C]2.7605[/C][C]6e-04[/C][C]0.9994[/C][C]6e-04[/C][C]0.3546[/C][/ROW]
[ROW][C]173[/C][C]0[/C][C]1.6927[/C][C]0.7967[/C][C]2.5888[/C][C]1e-04[/C][C]0.9916[/C][C]0[/C][C]0.1865[/C][/ROW]
[ROW][C]174[/C][C]-0.1[/C][C]1.4902[/C][C]0.5247[/C][C]2.4557[/C][C]6e-04[/C][C]0.9988[/C][C]0[/C][C]0.1079[/C][/ROW]
[ROW][C]175[/C][C]-0.6[/C][C]1.5291[/C][C]0.4952[/C][C]2.563[/C][C]0[/C][C]0.999[/C][C]0[/C][C]0.1396[/C][/ROW]
[ROW][C]176[/C][C]-0.2[/C][C]1.6826[/C][C]0.5881[/C][C]2.7772[/C][C]4e-04[/C][C]1[/C][C]1e-04[/C][C]0.2274[/C][/ROW]
[ROW][C]177[/C][C]-0.3[/C][C]1.6691[/C][C]0.5141[/C][C]2.8242[/C][C]4e-04[/C][C]0.9992[/C][C]5e-04[/C][C]0.2323[/C][/ROW]
[ROW][C]178[/C][C]-0.1[/C][C]1.7356[/C][C]0.526[/C][C]2.9451[/C][C]0.0015[/C][C]0.9995[/C][C]0.0088[/C][C]0.2774[/C][/ROW]
[ROW][C]179[/C][C]0.5[/C][C]2.2608[/C][C]0.9966[/C][C]3.5251[/C][C]0.0032[/C][C]0.9999[/C][C]0.5984[/C][C]0.5984[/C][/ROW]
[ROW][C]180[/C][C]0.9[/C][C]2.26[/C][C]0.9892[/C][C]3.5309[/C][C]0.018[/C][C]0.9967[/C][C]0.8456[/C][C]0.5975[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=152041&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152041&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[167])
1553.1-------
1563.1-------
1573.2-------
1583.3-------
1593.6-------
1603.3-------
1613.7-------
1624-------
1634-------
1643.8-------
1653.6-------
1663.2-------
1672.1-------
1681.62.0871.72752.44640.0040.471700.4717
1691.12.0641.54592.58221e-040.960400.4459
1701.21.98791.35722.61860.00720.997100.3638
1710.61.76451.03232.49689e-040.934600.1846
1720.61.94481.12912.76056e-040.99946e-040.3546
17301.69270.79672.58881e-040.991600.1865
174-0.11.49020.52472.45576e-040.998800.1079
175-0.61.52910.49522.56300.99900.1396
176-0.21.68260.58812.77724e-0411e-040.2274
177-0.31.66910.51412.82424e-040.99925e-040.2323
178-0.11.73560.5262.94510.00150.99950.00880.2774
1790.52.26080.99663.52510.00320.99990.59840.5984
1800.92.260.98923.53090.0180.99670.84560.5975







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1680.0879-0.233300.237100
1690.1281-0.46710.35020.92930.58320.7637
1700.1619-0.39630.36560.62080.59580.7719
1710.2117-0.660.43921.35610.78590.8865
1720.214-0.69150.48961.80840.99040.9952
1730.2701-10.57472.86541.30291.1414
1740.3306-1.06710.6452.52881.4781.2157
1750.345-1.39240.73854.5331.85991.3638
1760.3319-1.11890.78073.54432.0471.4307
1770.3531-1.17970.82063.87752.23011.4933
1780.3556-1.05760.84223.36932.33361.5276
1790.2853-0.77880.83693.10042.39751.5484
1800.2869-0.60180.81881.84972.35541.5347

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
168 & 0.0879 & -0.2333 & 0 & 0.2371 & 0 & 0 \tabularnewline
169 & 0.1281 & -0.4671 & 0.3502 & 0.9293 & 0.5832 & 0.7637 \tabularnewline
170 & 0.1619 & -0.3963 & 0.3656 & 0.6208 & 0.5958 & 0.7719 \tabularnewline
171 & 0.2117 & -0.66 & 0.4392 & 1.3561 & 0.7859 & 0.8865 \tabularnewline
172 & 0.214 & -0.6915 & 0.4896 & 1.8084 & 0.9904 & 0.9952 \tabularnewline
173 & 0.2701 & -1 & 0.5747 & 2.8654 & 1.3029 & 1.1414 \tabularnewline
174 & 0.3306 & -1.0671 & 0.645 & 2.5288 & 1.478 & 1.2157 \tabularnewline
175 & 0.345 & -1.3924 & 0.7385 & 4.533 & 1.8599 & 1.3638 \tabularnewline
176 & 0.3319 & -1.1189 & 0.7807 & 3.5443 & 2.047 & 1.4307 \tabularnewline
177 & 0.3531 & -1.1797 & 0.8206 & 3.8775 & 2.2301 & 1.4933 \tabularnewline
178 & 0.3556 & -1.0576 & 0.8422 & 3.3693 & 2.3336 & 1.5276 \tabularnewline
179 & 0.2853 & -0.7788 & 0.8369 & 3.1004 & 2.3975 & 1.5484 \tabularnewline
180 & 0.2869 & -0.6018 & 0.8188 & 1.8497 & 2.3554 & 1.5347 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152041&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]168[/C][C]0.0879[/C][C]-0.2333[/C][C]0[/C][C]0.2371[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]169[/C][C]0.1281[/C][C]-0.4671[/C][C]0.3502[/C][C]0.9293[/C][C]0.5832[/C][C]0.7637[/C][/ROW]
[ROW][C]170[/C][C]0.1619[/C][C]-0.3963[/C][C]0.3656[/C][C]0.6208[/C][C]0.5958[/C][C]0.7719[/C][/ROW]
[ROW][C]171[/C][C]0.2117[/C][C]-0.66[/C][C]0.4392[/C][C]1.3561[/C][C]0.7859[/C][C]0.8865[/C][/ROW]
[ROW][C]172[/C][C]0.214[/C][C]-0.6915[/C][C]0.4896[/C][C]1.8084[/C][C]0.9904[/C][C]0.9952[/C][/ROW]
[ROW][C]173[/C][C]0.2701[/C][C]-1[/C][C]0.5747[/C][C]2.8654[/C][C]1.3029[/C][C]1.1414[/C][/ROW]
[ROW][C]174[/C][C]0.3306[/C][C]-1.0671[/C][C]0.645[/C][C]2.5288[/C][C]1.478[/C][C]1.2157[/C][/ROW]
[ROW][C]175[/C][C]0.345[/C][C]-1.3924[/C][C]0.7385[/C][C]4.533[/C][C]1.8599[/C][C]1.3638[/C][/ROW]
[ROW][C]176[/C][C]0.3319[/C][C]-1.1189[/C][C]0.7807[/C][C]3.5443[/C][C]2.047[/C][C]1.4307[/C][/ROW]
[ROW][C]177[/C][C]0.3531[/C][C]-1.1797[/C][C]0.8206[/C][C]3.8775[/C][C]2.2301[/C][C]1.4933[/C][/ROW]
[ROW][C]178[/C][C]0.3556[/C][C]-1.0576[/C][C]0.8422[/C][C]3.3693[/C][C]2.3336[/C][C]1.5276[/C][/ROW]
[ROW][C]179[/C][C]0.2853[/C][C]-0.7788[/C][C]0.8369[/C][C]3.1004[/C][C]2.3975[/C][C]1.5484[/C][/ROW]
[ROW][C]180[/C][C]0.2869[/C][C]-0.6018[/C][C]0.8188[/C][C]1.8497[/C][C]2.3554[/C][C]1.5347[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=152041&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152041&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
1680.0879-0.233300.237100
1690.1281-0.46710.35020.92930.58320.7637
1700.1619-0.39630.36560.62080.59580.7719
1710.2117-0.660.43921.35610.78590.8865
1720.214-0.69150.48961.80840.99040.9952
1730.2701-10.57472.86541.30291.1414
1740.3306-1.06710.6452.52881.4781.2157
1750.345-1.39240.73854.5331.85991.3638
1760.3319-1.11890.78073.54432.0471.4307
1770.3531-1.17970.82063.87752.23011.4933
1780.3556-1.05760.84223.36932.33361.5276
1790.2853-0.77880.83693.10042.39751.5484
1800.2869-0.60180.81881.84972.35541.5347



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