Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 11 Dec 2007 12:26:45 -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/2007/Dec/11/t11974004159kzd3cd9w1wowx6.htm/, Retrieved Mon, 29 Apr 2024 01:59:11 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3160, Retrieved Mon, 29 Apr 2024 01:59:11 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsmet lambda = 0
Estimated Impact197
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting...] [2007-12-11 19:26:45] [bebbf4ab6ac77d61a56e6916ab0650f9] [Current]
Feedback Forum

Post a new message
Dataseries X:
75.9
77.7
86.9
90.7
91.0
89.5
92.5
94.1
98.5
96.8
91.2
97.1
104.9
110.9
104.8
94.1
95.8
99.3
101.1
104.0
99.0
105.4
107.1
110.7
117.1
118.7
126.5
127.5
134.6
131.8
135.9
142.7
141.7
153.4
145.0
137.7
148.3
152.2
169.4
168.6
161.1
174.1
179.0
190.6
190.0
181.6
174.8
180.5
196.8
193.8
197.0
216.3
221.4
217.9
229.7
227.4
204.2
196.6
198.8
207.5
190.7
201.6
210.5
223.5
223.8
231.2
244.0




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 2 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3160&T=0

[TABLE]
[ROW][C]Summary of compuational 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]2 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=3160&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3160&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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[55])
43179-------
44190.6-------
45190-------
46181.6-------
47174.8-------
48180.5-------
49196.8-------
50193.8-------
51197-------
52216.3-------
53221.4-------
54217.9-------
55229.7-------
56227.4241.7905220.1772265.52540.11730.84110.841
57204.2238.9129208.935273.19210.02360.74480.99740.7008
58196.6242.7259209.1028281.75540.01030.97350.99890.7435
59198.8235.4826200.2334276.93710.04140.9670.99790.6077
60207.5240.269201.0749287.1030.08510.95870.99380.6709
61190.7257.0597211.9419311.7820.00870.96210.98450.8364
62201.6262.2996213.6319322.05430.02320.99060.98770.8575
63210.5275.4001221.7493342.03150.02810.9850.98940.9106
64223.5277.1949220.7095348.13630.0690.96730.95380.9053
65223.8280.1267220.6682355.6060.07180.92930.93640.9048
66231.2283.4947221.068363.54980.10020.92810.94590.9061
67244292.8839226.1776379.26370.13370.91920.92420.9242

\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[55]) \tabularnewline
43 & 179 & - & - & - & - & - & - & - \tabularnewline
44 & 190.6 & - & - & - & - & - & - & - \tabularnewline
45 & 190 & - & - & - & - & - & - & - \tabularnewline
46 & 181.6 & - & - & - & - & - & - & - \tabularnewline
47 & 174.8 & - & - & - & - & - & - & - \tabularnewline
48 & 180.5 & - & - & - & - & - & - & - \tabularnewline
49 & 196.8 & - & - & - & - & - & - & - \tabularnewline
50 & 193.8 & - & - & - & - & - & - & - \tabularnewline
51 & 197 & - & - & - & - & - & - & - \tabularnewline
52 & 216.3 & - & - & - & - & - & - & - \tabularnewline
53 & 221.4 & - & - & - & - & - & - & - \tabularnewline
54 & 217.9 & - & - & - & - & - & - & - \tabularnewline
55 & 229.7 & - & - & - & - & - & - & - \tabularnewline
56 & 227.4 & 241.7905 & 220.1772 & 265.5254 & 0.1173 & 0.841 & 1 & 0.841 \tabularnewline
57 & 204.2 & 238.9129 & 208.935 & 273.1921 & 0.0236 & 0.7448 & 0.9974 & 0.7008 \tabularnewline
58 & 196.6 & 242.7259 & 209.1028 & 281.7554 & 0.0103 & 0.9735 & 0.9989 & 0.7435 \tabularnewline
59 & 198.8 & 235.4826 & 200.2334 & 276.9371 & 0.0414 & 0.967 & 0.9979 & 0.6077 \tabularnewline
60 & 207.5 & 240.269 & 201.0749 & 287.103 & 0.0851 & 0.9587 & 0.9938 & 0.6709 \tabularnewline
61 & 190.7 & 257.0597 & 211.9419 & 311.782 & 0.0087 & 0.9621 & 0.9845 & 0.8364 \tabularnewline
62 & 201.6 & 262.2996 & 213.6319 & 322.0543 & 0.0232 & 0.9906 & 0.9877 & 0.8575 \tabularnewline
63 & 210.5 & 275.4001 & 221.7493 & 342.0315 & 0.0281 & 0.985 & 0.9894 & 0.9106 \tabularnewline
64 & 223.5 & 277.1949 & 220.7095 & 348.1363 & 0.069 & 0.9673 & 0.9538 & 0.9053 \tabularnewline
65 & 223.8 & 280.1267 & 220.6682 & 355.606 & 0.0718 & 0.9293 & 0.9364 & 0.9048 \tabularnewline
66 & 231.2 & 283.4947 & 221.068 & 363.5498 & 0.1002 & 0.9281 & 0.9459 & 0.9061 \tabularnewline
67 & 244 & 292.8839 & 226.1776 & 379.2637 & 0.1337 & 0.9192 & 0.9242 & 0.9242 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3160&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[55])[/C][/ROW]
[ROW][C]43[/C][C]179[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]190.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]190[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]181.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]174.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]180.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]196.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]193.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]197[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]216.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]221.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]217.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]229.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]227.4[/C][C]241.7905[/C][C]220.1772[/C][C]265.5254[/C][C]0.1173[/C][C]0.841[/C][C]1[/C][C]0.841[/C][/ROW]
[ROW][C]57[/C][C]204.2[/C][C]238.9129[/C][C]208.935[/C][C]273.1921[/C][C]0.0236[/C][C]0.7448[/C][C]0.9974[/C][C]0.7008[/C][/ROW]
[ROW][C]58[/C][C]196.6[/C][C]242.7259[/C][C]209.1028[/C][C]281.7554[/C][C]0.0103[/C][C]0.9735[/C][C]0.9989[/C][C]0.7435[/C][/ROW]
[ROW][C]59[/C][C]198.8[/C][C]235.4826[/C][C]200.2334[/C][C]276.9371[/C][C]0.0414[/C][C]0.967[/C][C]0.9979[/C][C]0.6077[/C][/ROW]
[ROW][C]60[/C][C]207.5[/C][C]240.269[/C][C]201.0749[/C][C]287.103[/C][C]0.0851[/C][C]0.9587[/C][C]0.9938[/C][C]0.6709[/C][/ROW]
[ROW][C]61[/C][C]190.7[/C][C]257.0597[/C][C]211.9419[/C][C]311.782[/C][C]0.0087[/C][C]0.9621[/C][C]0.9845[/C][C]0.8364[/C][/ROW]
[ROW][C]62[/C][C]201.6[/C][C]262.2996[/C][C]213.6319[/C][C]322.0543[/C][C]0.0232[/C][C]0.9906[/C][C]0.9877[/C][C]0.8575[/C][/ROW]
[ROW][C]63[/C][C]210.5[/C][C]275.4001[/C][C]221.7493[/C][C]342.0315[/C][C]0.0281[/C][C]0.985[/C][C]0.9894[/C][C]0.9106[/C][/ROW]
[ROW][C]64[/C][C]223.5[/C][C]277.1949[/C][C]220.7095[/C][C]348.1363[/C][C]0.069[/C][C]0.9673[/C][C]0.9538[/C][C]0.9053[/C][/ROW]
[ROW][C]65[/C][C]223.8[/C][C]280.1267[/C][C]220.6682[/C][C]355.606[/C][C]0.0718[/C][C]0.9293[/C][C]0.9364[/C][C]0.9048[/C][/ROW]
[ROW][C]66[/C][C]231.2[/C][C]283.4947[/C][C]221.068[/C][C]363.5498[/C][C]0.1002[/C][C]0.9281[/C][C]0.9459[/C][C]0.9061[/C][/ROW]
[ROW][C]67[/C][C]244[/C][C]292.8839[/C][C]226.1776[/C][C]379.2637[/C][C]0.1337[/C][C]0.9192[/C][C]0.9242[/C][C]0.9242[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3160&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3160&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[55])
43179-------
44190.6-------
45190-------
46181.6-------
47174.8-------
48180.5-------
49196.8-------
50193.8-------
51197-------
52216.3-------
53221.4-------
54217.9-------
55229.7-------
56227.4241.7905220.1772265.52540.11730.84110.841
57204.2238.9129208.935273.19210.02360.74480.99740.7008
58196.6242.7259209.1028281.75540.01030.97350.99890.7435
59198.8235.4826200.2334276.93710.04140.9670.99790.6077
60207.5240.269201.0749287.1030.08510.95870.99380.6709
61190.7257.0597211.9419311.7820.00870.96210.98450.8364
62201.6262.2996213.6319322.05430.02320.99060.98770.8575
63210.5275.4001221.7493342.03150.02810.9850.98940.9106
64223.5277.1949220.7095348.13630.0690.96730.95380.9053
65223.8280.1267220.6682355.6060.07180.92930.93640.9048
66231.2283.4947221.068363.54980.10020.92810.94590.9061
67244292.8839226.1776379.26370.13370.91920.92420.9242







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
560.0501-0.05950.005207.086817.25724.1542
570.0732-0.14530.01211204.9858100.415510.0208
580.082-0.190.01582127.5955177.299613.3154
590.0898-0.15580.0131345.6143112.134510.5894
600.0995-0.13640.01141073.810189.48429.4596
610.1086-0.25810.02154403.6071366.967319.1564
620.1162-0.23140.01933684.4387307.036617.5225
630.1234-0.23570.01964212.0287351.002418.7351
640.1306-0.19370.01612883.1388240.261615.5004
650.1375-0.20110.01683172.6932264.391116.2601
660.1441-0.18450.01542734.7324227.894415.0962
670.1505-0.16690.01392389.633199.136114.1116

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
56 & 0.0501 & -0.0595 & 0.005 & 207.0868 & 17.2572 & 4.1542 \tabularnewline
57 & 0.0732 & -0.1453 & 0.0121 & 1204.9858 & 100.4155 & 10.0208 \tabularnewline
58 & 0.082 & -0.19 & 0.0158 & 2127.5955 & 177.2996 & 13.3154 \tabularnewline
59 & 0.0898 & -0.1558 & 0.013 & 1345.6143 & 112.1345 & 10.5894 \tabularnewline
60 & 0.0995 & -0.1364 & 0.0114 & 1073.8101 & 89.4842 & 9.4596 \tabularnewline
61 & 0.1086 & -0.2581 & 0.0215 & 4403.6071 & 366.9673 & 19.1564 \tabularnewline
62 & 0.1162 & -0.2314 & 0.0193 & 3684.4387 & 307.0366 & 17.5225 \tabularnewline
63 & 0.1234 & -0.2357 & 0.0196 & 4212.0287 & 351.0024 & 18.7351 \tabularnewline
64 & 0.1306 & -0.1937 & 0.0161 & 2883.1388 & 240.2616 & 15.5004 \tabularnewline
65 & 0.1375 & -0.2011 & 0.0168 & 3172.6932 & 264.3911 & 16.2601 \tabularnewline
66 & 0.1441 & -0.1845 & 0.0154 & 2734.7324 & 227.8944 & 15.0962 \tabularnewline
67 & 0.1505 & -0.1669 & 0.0139 & 2389.633 & 199.1361 & 14.1116 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3160&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]56[/C][C]0.0501[/C][C]-0.0595[/C][C]0.005[/C][C]207.0868[/C][C]17.2572[/C][C]4.1542[/C][/ROW]
[ROW][C]57[/C][C]0.0732[/C][C]-0.1453[/C][C]0.0121[/C][C]1204.9858[/C][C]100.4155[/C][C]10.0208[/C][/ROW]
[ROW][C]58[/C][C]0.082[/C][C]-0.19[/C][C]0.0158[/C][C]2127.5955[/C][C]177.2996[/C][C]13.3154[/C][/ROW]
[ROW][C]59[/C][C]0.0898[/C][C]-0.1558[/C][C]0.013[/C][C]1345.6143[/C][C]112.1345[/C][C]10.5894[/C][/ROW]
[ROW][C]60[/C][C]0.0995[/C][C]-0.1364[/C][C]0.0114[/C][C]1073.8101[/C][C]89.4842[/C][C]9.4596[/C][/ROW]
[ROW][C]61[/C][C]0.1086[/C][C]-0.2581[/C][C]0.0215[/C][C]4403.6071[/C][C]366.9673[/C][C]19.1564[/C][/ROW]
[ROW][C]62[/C][C]0.1162[/C][C]-0.2314[/C][C]0.0193[/C][C]3684.4387[/C][C]307.0366[/C][C]17.5225[/C][/ROW]
[ROW][C]63[/C][C]0.1234[/C][C]-0.2357[/C][C]0.0196[/C][C]4212.0287[/C][C]351.0024[/C][C]18.7351[/C][/ROW]
[ROW][C]64[/C][C]0.1306[/C][C]-0.1937[/C][C]0.0161[/C][C]2883.1388[/C][C]240.2616[/C][C]15.5004[/C][/ROW]
[ROW][C]65[/C][C]0.1375[/C][C]-0.2011[/C][C]0.0168[/C][C]3172.6932[/C][C]264.3911[/C][C]16.2601[/C][/ROW]
[ROW][C]66[/C][C]0.1441[/C][C]-0.1845[/C][C]0.0154[/C][C]2734.7324[/C][C]227.8944[/C][C]15.0962[/C][/ROW]
[ROW][C]67[/C][C]0.1505[/C][C]-0.1669[/C][C]0.0139[/C][C]2389.633[/C][C]199.1361[/C][C]14.1116[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3160&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3160&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
560.0501-0.05950.005207.086817.25724.1542
570.0732-0.14530.01211204.9858100.415510.0208
580.082-0.190.01582127.5955177.299613.3154
590.0898-0.15580.0131345.6143112.134510.5894
600.0995-0.13640.01141073.810189.48429.4596
610.1086-0.25810.02154403.6071366.967319.1564
620.1162-0.23140.01933684.4387307.036617.5225
630.1234-0.23570.01964212.0287351.002418.7351
640.1306-0.19370.01612883.1388240.261615.5004
650.1375-0.20110.01683172.6932264.391116.2601
660.1441-0.18450.01542734.7324227.894415.0962
670.1505-0.16690.01392389.633199.136114.1116



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