Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 13 Dec 2007 09:31:58 -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/13/t11975625950kuqy8t93wf5rcs.htm/, Retrieved Sun, 05 May 2024 19:09:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3651, Retrieved Sun, 05 May 2024 19:09:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact193
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting...] [2007-12-13 16:31:58] [1a2581828a3030ed7733053b32a6f065] [Current]
Feedback Forum

Post a new message
Dataseries X:
114.9
124.5
142.2
159.7
165.2
198.6
207.8
219.6
239.6
235.3
218.5
213.8
205.5
198.4
198.5
190.2
180.7
193.6
192.8
195.5
197.2
196.9
178.9
172.4
156.4
143.7
153.6
168.8
185.8
199.9
205.4
197.5
199.6
200.5
193.7
179.6
169.1
169.8
195.5
194.8
204.5
203.8
204.8
204.9
240
248.3
258.4
254.9




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\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 & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3651&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3651&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3651&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 time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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[36])
24172.4-------
25156.4-------
26143.7-------
27153.6-------
28168.8-------
29185.8-------
30199.9-------
31205.4-------
32197.5-------
33199.6-------
34200.5-------
35193.7-------
36179.6-------
37169.1165.8167223.1632137.30.58930.82830.25870.8283
38169.8168.8596268.3324132.50.52020.50520.08750.7187
39195.5175.3221295.2412135.63410.84050.39250.14170.5837
40194.8180.2157319.0823137.92280.75040.76060.29840.4886
41204.5182.8113333.2756139.1080.83460.70460.55330.4427
42203.8196.1988433.531144.91590.61430.62450.55620.2629
43204.8197.8598450.8367145.60210.60270.58820.61130.2467
44204.9196.3404434.9475144.97470.6280.62660.51760.2615
45240198.2069454.6542145.74450.94080.59870.52080.2435
46248.3198.4026456.8409145.82480.96860.93950.53120.2417
47258.4184.7602344.7773139.9850.99940.99730.65220.4106
48254.9175.3476295.3567135.6462110.58310.5831

\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[36]) \tabularnewline
24 & 172.4 & - & - & - & - & - & - & - \tabularnewline
25 & 156.4 & - & - & - & - & - & - & - \tabularnewline
26 & 143.7 & - & - & - & - & - & - & - \tabularnewline
27 & 153.6 & - & - & - & - & - & - & - \tabularnewline
28 & 168.8 & - & - & - & - & - & - & - \tabularnewline
29 & 185.8 & - & - & - & - & - & - & - \tabularnewline
30 & 199.9 & - & - & - & - & - & - & - \tabularnewline
31 & 205.4 & - & - & - & - & - & - & - \tabularnewline
32 & 197.5 & - & - & - & - & - & - & - \tabularnewline
33 & 199.6 & - & - & - & - & - & - & - \tabularnewline
34 & 200.5 & - & - & - & - & - & - & - \tabularnewline
35 & 193.7 & - & - & - & - & - & - & - \tabularnewline
36 & 179.6 & - & - & - & - & - & - & - \tabularnewline
37 & 169.1 & 165.8167 & 223.1632 & 137.3 & 0.5893 & 0.8283 & 0.2587 & 0.8283 \tabularnewline
38 & 169.8 & 168.8596 & 268.3324 & 132.5 & 0.5202 & 0.5052 & 0.0875 & 0.7187 \tabularnewline
39 & 195.5 & 175.3221 & 295.2412 & 135.6341 & 0.8405 & 0.3925 & 0.1417 & 0.5837 \tabularnewline
40 & 194.8 & 180.2157 & 319.0823 & 137.9228 & 0.7504 & 0.7606 & 0.2984 & 0.4886 \tabularnewline
41 & 204.5 & 182.8113 & 333.2756 & 139.108 & 0.8346 & 0.7046 & 0.5533 & 0.4427 \tabularnewline
42 & 203.8 & 196.1988 & 433.531 & 144.9159 & 0.6143 & 0.6245 & 0.5562 & 0.2629 \tabularnewline
43 & 204.8 & 197.8598 & 450.8367 & 145.6021 & 0.6027 & 0.5882 & 0.6113 & 0.2467 \tabularnewline
44 & 204.9 & 196.3404 & 434.9475 & 144.9747 & 0.628 & 0.6266 & 0.5176 & 0.2615 \tabularnewline
45 & 240 & 198.2069 & 454.6542 & 145.7445 & 0.9408 & 0.5987 & 0.5208 & 0.2435 \tabularnewline
46 & 248.3 & 198.4026 & 456.8409 & 145.8248 & 0.9686 & 0.9395 & 0.5312 & 0.2417 \tabularnewline
47 & 258.4 & 184.7602 & 344.7773 & 139.985 & 0.9994 & 0.9973 & 0.6522 & 0.4106 \tabularnewline
48 & 254.9 & 175.3476 & 295.3567 & 135.6462 & 1 & 1 & 0.5831 & 0.5831 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3651&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[36])[/C][/ROW]
[ROW][C]24[/C][C]172.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]156.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]26[/C][C]143.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]153.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]168.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]185.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]199.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]205.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]197.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]199.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]200.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]193.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]179.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]169.1[/C][C]165.8167[/C][C]223.1632[/C][C]137.3[/C][C]0.5893[/C][C]0.8283[/C][C]0.2587[/C][C]0.8283[/C][/ROW]
[ROW][C]38[/C][C]169.8[/C][C]168.8596[/C][C]268.3324[/C][C]132.5[/C][C]0.5202[/C][C]0.5052[/C][C]0.0875[/C][C]0.7187[/C][/ROW]
[ROW][C]39[/C][C]195.5[/C][C]175.3221[/C][C]295.2412[/C][C]135.6341[/C][C]0.8405[/C][C]0.3925[/C][C]0.1417[/C][C]0.5837[/C][/ROW]
[ROW][C]40[/C][C]194.8[/C][C]180.2157[/C][C]319.0823[/C][C]137.9228[/C][C]0.7504[/C][C]0.7606[/C][C]0.2984[/C][C]0.4886[/C][/ROW]
[ROW][C]41[/C][C]204.5[/C][C]182.8113[/C][C]333.2756[/C][C]139.108[/C][C]0.8346[/C][C]0.7046[/C][C]0.5533[/C][C]0.4427[/C][/ROW]
[ROW][C]42[/C][C]203.8[/C][C]196.1988[/C][C]433.531[/C][C]144.9159[/C][C]0.6143[/C][C]0.6245[/C][C]0.5562[/C][C]0.2629[/C][/ROW]
[ROW][C]43[/C][C]204.8[/C][C]197.8598[/C][C]450.8367[/C][C]145.6021[/C][C]0.6027[/C][C]0.5882[/C][C]0.6113[/C][C]0.2467[/C][/ROW]
[ROW][C]44[/C][C]204.9[/C][C]196.3404[/C][C]434.9475[/C][C]144.9747[/C][C]0.628[/C][C]0.6266[/C][C]0.5176[/C][C]0.2615[/C][/ROW]
[ROW][C]45[/C][C]240[/C][C]198.2069[/C][C]454.6542[/C][C]145.7445[/C][C]0.9408[/C][C]0.5987[/C][C]0.5208[/C][C]0.2435[/C][/ROW]
[ROW][C]46[/C][C]248.3[/C][C]198.4026[/C][C]456.8409[/C][C]145.8248[/C][C]0.9686[/C][C]0.9395[/C][C]0.5312[/C][C]0.2417[/C][/ROW]
[ROW][C]47[/C][C]258.4[/C][C]184.7602[/C][C]344.7773[/C][C]139.985[/C][C]0.9994[/C][C]0.9973[/C][C]0.6522[/C][C]0.4106[/C][/ROW]
[ROW][C]48[/C][C]254.9[/C][C]175.3476[/C][C]295.3567[/C][C]135.6462[/C][C]1[/C][C]1[/C][C]0.5831[/C][C]0.5831[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3651&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3651&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[36])
24172.4-------
25156.4-------
26143.7-------
27153.6-------
28168.8-------
29185.8-------
30199.9-------
31205.4-------
32197.5-------
33199.6-------
34200.5-------
35193.7-------
36179.6-------
37169.1165.8167223.1632137.30.58930.82830.25870.8283
38169.8168.8596268.3324132.50.52020.50520.08750.7187
39195.5175.3221295.2412135.63410.84050.39250.14170.5837
40194.8180.2157319.0823137.92280.75040.76060.29840.4886
41204.5182.8113333.2756139.1080.83460.70460.55330.4427
42203.8196.1988433.531144.91590.61430.62450.55620.2629
43204.8197.8598450.8367145.60210.60270.58820.61130.2467
44204.9196.3404434.9475144.97470.6280.62660.51760.2615
45240198.2069454.6542145.74450.94080.59870.52080.2435
46248.3198.4026456.8409145.82480.96860.93950.53120.2417
47258.4184.7602344.7773139.9850.99940.99730.65220.4106
48254.9175.3476295.3567135.6462110.58310.5831







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
37-0.08770.01980.001710.77980.89830.9478
38-0.10990.00565e-040.88430.07370.2715
39-0.11550.11510.0096407.14633.92885.8248
40-0.11970.08090.0067212.702617.72524.2101
41-0.1220.11860.0099470.399939.26.261
42-0.13340.03870.003257.77834.81492.1943
43-0.13480.03510.002948.16584.01382.0035
44-0.13350.04360.003673.26676.10562.4709
45-0.1350.21090.01761746.667145.555612.0646
46-0.13520.25150.0212489.7469207.478914.4041
47-0.12360.39860.03325422.813451.901121.258
48-0.11550.45370.03786328.5836527.38222.9648

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
37 & -0.0877 & 0.0198 & 0.0017 & 10.7798 & 0.8983 & 0.9478 \tabularnewline
38 & -0.1099 & 0.0056 & 5e-04 & 0.8843 & 0.0737 & 0.2715 \tabularnewline
39 & -0.1155 & 0.1151 & 0.0096 & 407.146 & 33.9288 & 5.8248 \tabularnewline
40 & -0.1197 & 0.0809 & 0.0067 & 212.7026 & 17.7252 & 4.2101 \tabularnewline
41 & -0.122 & 0.1186 & 0.0099 & 470.3999 & 39.2 & 6.261 \tabularnewline
42 & -0.1334 & 0.0387 & 0.0032 & 57.7783 & 4.8149 & 2.1943 \tabularnewline
43 & -0.1348 & 0.0351 & 0.0029 & 48.1658 & 4.0138 & 2.0035 \tabularnewline
44 & -0.1335 & 0.0436 & 0.0036 & 73.2667 & 6.1056 & 2.4709 \tabularnewline
45 & -0.135 & 0.2109 & 0.0176 & 1746.667 & 145.5556 & 12.0646 \tabularnewline
46 & -0.1352 & 0.2515 & 0.021 & 2489.7469 & 207.4789 & 14.4041 \tabularnewline
47 & -0.1236 & 0.3986 & 0.0332 & 5422.813 & 451.9011 & 21.258 \tabularnewline
48 & -0.1155 & 0.4537 & 0.0378 & 6328.5836 & 527.382 & 22.9648 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3651&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]37[/C][C]-0.0877[/C][C]0.0198[/C][C]0.0017[/C][C]10.7798[/C][C]0.8983[/C][C]0.9478[/C][/ROW]
[ROW][C]38[/C][C]-0.1099[/C][C]0.0056[/C][C]5e-04[/C][C]0.8843[/C][C]0.0737[/C][C]0.2715[/C][/ROW]
[ROW][C]39[/C][C]-0.1155[/C][C]0.1151[/C][C]0.0096[/C][C]407.146[/C][C]33.9288[/C][C]5.8248[/C][/ROW]
[ROW][C]40[/C][C]-0.1197[/C][C]0.0809[/C][C]0.0067[/C][C]212.7026[/C][C]17.7252[/C][C]4.2101[/C][/ROW]
[ROW][C]41[/C][C]-0.122[/C][C]0.1186[/C][C]0.0099[/C][C]470.3999[/C][C]39.2[/C][C]6.261[/C][/ROW]
[ROW][C]42[/C][C]-0.1334[/C][C]0.0387[/C][C]0.0032[/C][C]57.7783[/C][C]4.8149[/C][C]2.1943[/C][/ROW]
[ROW][C]43[/C][C]-0.1348[/C][C]0.0351[/C][C]0.0029[/C][C]48.1658[/C][C]4.0138[/C][C]2.0035[/C][/ROW]
[ROW][C]44[/C][C]-0.1335[/C][C]0.0436[/C][C]0.0036[/C][C]73.2667[/C][C]6.1056[/C][C]2.4709[/C][/ROW]
[ROW][C]45[/C][C]-0.135[/C][C]0.2109[/C][C]0.0176[/C][C]1746.667[/C][C]145.5556[/C][C]12.0646[/C][/ROW]
[ROW][C]46[/C][C]-0.1352[/C][C]0.2515[/C][C]0.021[/C][C]2489.7469[/C][C]207.4789[/C][C]14.4041[/C][/ROW]
[ROW][C]47[/C][C]-0.1236[/C][C]0.3986[/C][C]0.0332[/C][C]5422.813[/C][C]451.9011[/C][C]21.258[/C][/ROW]
[ROW][C]48[/C][C]-0.1155[/C][C]0.4537[/C][C]0.0378[/C][C]6328.5836[/C][C]527.382[/C][C]22.9648[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3651&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3651&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
37-0.08770.01980.001710.77980.89830.9478
38-0.10990.00565e-040.88430.07370.2715
39-0.11550.11510.0096407.14633.92885.8248
40-0.11970.08090.0067212.702617.72524.2101
41-0.1220.11860.0099470.399939.26.261
42-0.13340.03870.003257.77834.81492.1943
43-0.13480.03510.002948.16584.01382.0035
44-0.13350.04360.003673.26676.10562.4709
45-0.1350.21090.01761746.667145.555612.0646
46-0.13520.25150.0212489.7469207.478914.4041
47-0.12360.39860.03325422.813451.901121.258
48-0.11550.45370.03786328.5836527.38222.9648



Parameters (Session):
par1 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = -1.9 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; 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,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')