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 2011 10:09:17 -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/23/t1324653193pa59727pjg5z63s.htm/, Retrieved Mon, 29 Apr 2024 22:06:17 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=160487, Retrieved Mon, 29 Apr 2024 22:06:17 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact93
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2011-12-15 18:59:44] [c53df38315e3cbde2dbe0de809195ef2]
-   PD    [ARIMA Forecasting] [Arima Forecasting] [2011-12-23 15:09:17] [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 time1 seconds
R Server'Herman Ole Andreas Wold' @ wold.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 & 1 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160487&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160487&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160487&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 time1 seconds
R Server'Herman Ole Andreas Wold' @ wold.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[168])
1563.1-------
1573.2-------
1583.3-------
1593.6-------
1603.3-------
1613.7-------
1624-------
1634-------
1643.8-------
1653.6-------
1663.2-------
1672.1-------
1681.6-------
1691.11.48411.09731.87080.02580.278400.2784
1701.21.43620.82832.04420.22310.860800.2988
1710.61.29070.52342.05790.03880.591600.2147
1720.61.43620.53742.33510.03410.965900.3605
17301.24210.22872.25560.00810.892900.2444
174-0.11.0965-0.01982.21290.01780.972900.1884
175-0.61.0965-0.1142.30710.0030.973600.2075
176-0.21.1936-0.10442.49150.01770.996600.2697
177-0.31.2907-0.08922.67050.01190.98295e-040.3302
178-0.11.48480.02772.94180.01650.99180.01050.4384
1790.52.01860.48813.5490.02590.99670.45850.704
1800.92.26120.66083.86170.04780.98450.7910.791

\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 & 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 & - & - & - & - & - & - & - \tabularnewline
169 & 1.1 & 1.4841 & 1.0973 & 1.8708 & 0.0258 & 0.2784 & 0 & 0.2784 \tabularnewline
170 & 1.2 & 1.4362 & 0.8283 & 2.0442 & 0.2231 & 0.8608 & 0 & 0.2988 \tabularnewline
171 & 0.6 & 1.2907 & 0.5234 & 2.0579 & 0.0388 & 0.5916 & 0 & 0.2147 \tabularnewline
172 & 0.6 & 1.4362 & 0.5374 & 2.3351 & 0.0341 & 0.9659 & 0 & 0.3605 \tabularnewline
173 & 0 & 1.2421 & 0.2287 & 2.2556 & 0.0081 & 0.8929 & 0 & 0.2444 \tabularnewline
174 & -0.1 & 1.0965 & -0.0198 & 2.2129 & 0.0178 & 0.9729 & 0 & 0.1884 \tabularnewline
175 & -0.6 & 1.0965 & -0.114 & 2.3071 & 0.003 & 0.9736 & 0 & 0.2075 \tabularnewline
176 & -0.2 & 1.1936 & -0.1044 & 2.4915 & 0.0177 & 0.9966 & 0 & 0.2697 \tabularnewline
177 & -0.3 & 1.2907 & -0.0892 & 2.6705 & 0.0119 & 0.9829 & 5e-04 & 0.3302 \tabularnewline
178 & -0.1 & 1.4848 & 0.0277 & 2.9418 & 0.0165 & 0.9918 & 0.0105 & 0.4384 \tabularnewline
179 & 0.5 & 2.0186 & 0.4881 & 3.549 & 0.0259 & 0.9967 & 0.4585 & 0.704 \tabularnewline
180 & 0.9 & 2.2612 & 0.6608 & 3.8617 & 0.0478 & 0.9845 & 0.791 & 0.791 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160487&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]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]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]169[/C][C]1.1[/C][C]1.4841[/C][C]1.0973[/C][C]1.8708[/C][C]0.0258[/C][C]0.2784[/C][C]0[/C][C]0.2784[/C][/ROW]
[ROW][C]170[/C][C]1.2[/C][C]1.4362[/C][C]0.8283[/C][C]2.0442[/C][C]0.2231[/C][C]0.8608[/C][C]0[/C][C]0.2988[/C][/ROW]
[ROW][C]171[/C][C]0.6[/C][C]1.2907[/C][C]0.5234[/C][C]2.0579[/C][C]0.0388[/C][C]0.5916[/C][C]0[/C][C]0.2147[/C][/ROW]
[ROW][C]172[/C][C]0.6[/C][C]1.4362[/C][C]0.5374[/C][C]2.3351[/C][C]0.0341[/C][C]0.9659[/C][C]0[/C][C]0.3605[/C][/ROW]
[ROW][C]173[/C][C]0[/C][C]1.2421[/C][C]0.2287[/C][C]2.2556[/C][C]0.0081[/C][C]0.8929[/C][C]0[/C][C]0.2444[/C][/ROW]
[ROW][C]174[/C][C]-0.1[/C][C]1.0965[/C][C]-0.0198[/C][C]2.2129[/C][C]0.0178[/C][C]0.9729[/C][C]0[/C][C]0.1884[/C][/ROW]
[ROW][C]175[/C][C]-0.6[/C][C]1.0965[/C][C]-0.114[/C][C]2.3071[/C][C]0.003[/C][C]0.9736[/C][C]0[/C][C]0.2075[/C][/ROW]
[ROW][C]176[/C][C]-0.2[/C][C]1.1936[/C][C]-0.1044[/C][C]2.4915[/C][C]0.0177[/C][C]0.9966[/C][C]0[/C][C]0.2697[/C][/ROW]
[ROW][C]177[/C][C]-0.3[/C][C]1.2907[/C][C]-0.0892[/C][C]2.6705[/C][C]0.0119[/C][C]0.9829[/C][C]5e-04[/C][C]0.3302[/C][/ROW]
[ROW][C]178[/C][C]-0.1[/C][C]1.4848[/C][C]0.0277[/C][C]2.9418[/C][C]0.0165[/C][C]0.9918[/C][C]0.0105[/C][C]0.4384[/C][/ROW]
[ROW][C]179[/C][C]0.5[/C][C]2.0186[/C][C]0.4881[/C][C]3.549[/C][C]0.0259[/C][C]0.9967[/C][C]0.4585[/C][C]0.704[/C][/ROW]
[ROW][C]180[/C][C]0.9[/C][C]2.2612[/C][C]0.6608[/C][C]3.8617[/C][C]0.0478[/C][C]0.9845[/C][C]0.791[/C][C]0.791[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160487&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160487&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])
1563.1-------
1573.2-------
1583.3-------
1593.6-------
1603.3-------
1613.7-------
1624-------
1634-------
1643.8-------
1653.6-------
1663.2-------
1672.1-------
1681.6-------
1691.11.48411.09731.87080.02580.278400.2784
1701.21.43620.82832.04420.22310.860800.2988
1710.61.29070.52342.05790.03880.591600.2147
1720.61.43620.53742.33510.03410.965900.3605
17301.24210.22872.25560.00810.892900.2444
174-0.11.0965-0.01982.21290.01780.972900.1884
175-0.61.0965-0.1142.30710.0030.973600.2075
176-0.21.1936-0.10442.49150.01770.996600.2697
177-0.31.2907-0.08922.67050.01190.98295e-040.3302
178-0.11.48480.02772.94180.01650.99180.01050.4384
1790.52.01860.48813.5490.02590.99670.45850.704
1800.92.26120.66083.86170.04780.98450.7910.791







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1690.133-0.258800.147500
1700.216-0.16450.21160.05580.10170.3188
1710.3033-0.53510.31950.4770.22680.4762
1720.3193-0.58220.38520.69930.34490.5873
1730.4163-10.50811.54290.58450.7645
1740.5194-1.09120.60531.43170.72570.8519
1750.5633-1.54720.73992.87821.03321.0165
1760.5548-1.16760.79331.94211.14681.0709
1770.5454-1.23240.84212.53021.30051.1404
1780.5007-1.06740.86462.51151.42161.1923
1790.3868-0.75230.85442.30611.5021.2256
1800.3611-0.6020.83341.8531.53131.2374

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
169 & 0.133 & -0.2588 & 0 & 0.1475 & 0 & 0 \tabularnewline
170 & 0.216 & -0.1645 & 0.2116 & 0.0558 & 0.1017 & 0.3188 \tabularnewline
171 & 0.3033 & -0.5351 & 0.3195 & 0.477 & 0.2268 & 0.4762 \tabularnewline
172 & 0.3193 & -0.5822 & 0.3852 & 0.6993 & 0.3449 & 0.5873 \tabularnewline
173 & 0.4163 & -1 & 0.5081 & 1.5429 & 0.5845 & 0.7645 \tabularnewline
174 & 0.5194 & -1.0912 & 0.6053 & 1.4317 & 0.7257 & 0.8519 \tabularnewline
175 & 0.5633 & -1.5472 & 0.7399 & 2.8782 & 1.0332 & 1.0165 \tabularnewline
176 & 0.5548 & -1.1676 & 0.7933 & 1.9421 & 1.1468 & 1.0709 \tabularnewline
177 & 0.5454 & -1.2324 & 0.8421 & 2.5302 & 1.3005 & 1.1404 \tabularnewline
178 & 0.5007 & -1.0674 & 0.8646 & 2.5115 & 1.4216 & 1.1923 \tabularnewline
179 & 0.3868 & -0.7523 & 0.8544 & 2.3061 & 1.502 & 1.2256 \tabularnewline
180 & 0.3611 & -0.602 & 0.8334 & 1.853 & 1.5313 & 1.2374 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160487&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.133[/C][C]-0.2588[/C][C]0[/C][C]0.1475[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]170[/C][C]0.216[/C][C]-0.1645[/C][C]0.2116[/C][C]0.0558[/C][C]0.1017[/C][C]0.3188[/C][/ROW]
[ROW][C]171[/C][C]0.3033[/C][C]-0.5351[/C][C]0.3195[/C][C]0.477[/C][C]0.2268[/C][C]0.4762[/C][/ROW]
[ROW][C]172[/C][C]0.3193[/C][C]-0.5822[/C][C]0.3852[/C][C]0.6993[/C][C]0.3449[/C][C]0.5873[/C][/ROW]
[ROW][C]173[/C][C]0.4163[/C][C]-1[/C][C]0.5081[/C][C]1.5429[/C][C]0.5845[/C][C]0.7645[/C][/ROW]
[ROW][C]174[/C][C]0.5194[/C][C]-1.0912[/C][C]0.6053[/C][C]1.4317[/C][C]0.7257[/C][C]0.8519[/C][/ROW]
[ROW][C]175[/C][C]0.5633[/C][C]-1.5472[/C][C]0.7399[/C][C]2.8782[/C][C]1.0332[/C][C]1.0165[/C][/ROW]
[ROW][C]176[/C][C]0.5548[/C][C]-1.1676[/C][C]0.7933[/C][C]1.9421[/C][C]1.1468[/C][C]1.0709[/C][/ROW]
[ROW][C]177[/C][C]0.5454[/C][C]-1.2324[/C][C]0.8421[/C][C]2.5302[/C][C]1.3005[/C][C]1.1404[/C][/ROW]
[ROW][C]178[/C][C]0.5007[/C][C]-1.0674[/C][C]0.8646[/C][C]2.5115[/C][C]1.4216[/C][C]1.1923[/C][/ROW]
[ROW][C]179[/C][C]0.3868[/C][C]-0.7523[/C][C]0.8544[/C][C]2.3061[/C][C]1.502[/C][C]1.2256[/C][/ROW]
[ROW][C]180[/C][C]0.3611[/C][C]-0.602[/C][C]0.8334[/C][C]1.853[/C][C]1.5313[/C][C]1.2374[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160487&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160487&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.133-0.258800.147500
1700.216-0.16450.21160.05580.10170.3188
1710.3033-0.53510.31950.4770.22680.4762
1720.3193-0.58220.38520.69930.34490.5873
1730.4163-10.50811.54290.58450.7645
1740.5194-1.09120.60531.43170.72570.8519
1750.5633-1.54720.73992.87821.03321.0165
1760.5548-1.16760.79331.94211.14681.0709
1770.5454-1.23240.84212.53021.30051.1404
1780.5007-1.06740.86462.51151.42161.1923
1790.3868-0.75230.85442.30611.5021.2256
1800.3611-0.6020.83341.8531.53131.2374



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