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 computationSat, 12 Dec 2009 09:13: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/2009/Dec/12/t12606345203hgbn9j55oax31t.htm/, Retrieved Mon, 29 Apr 2024 15:13:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=67037, Retrieved Mon, 29 Apr 2024 15:13:08 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact110
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] [forecast] [2009-12-11 14:53:07] [03557919bc1ce1475f4920f6a43c36b0]
- R P       [ARIMA Forecasting] [verbetering workshop] [2009-12-12 16:13:58] [a931a0a30926b49d162330b43e89b999] [Current]
Feedback Forum

Post a new message
Dataseries X:
130.7
117.2
110.8
111.4
108.2
108.8
110.2
109.5
109.5
116
111.2
112.1
114
119.1
114.1
115.1
115.4
110.8
116
119.2
126.5
127.8
131.3
140.3
137.3
143
134.5
139.9
159.3
170.4
175
175.8
180.9
180.3
169.6
172.3
184.8
177.7
184.6
211.4
215.3
215.9
244.7
259.3
289
310.9
321
315.1
333.2
314.1
284.7
273.9
216
196.4
190.9
206.4
196.3
199.5
198.9
214.4




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67037&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67037&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67037&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'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[48])
36172.3-------
37184.8-------
38177.7-------
39184.6-------
40211.4-------
41215.3-------
42215.9-------
43244.7-------
44259.3-------
45289-------
46310.9-------
47321-------
48315.1-------
49333.2313.7301260.0462395.3450.320.48690.9990.4869
50314.1313.7301237.4065462.38030.49810.39870.96360.4928
51284.7313.7301223.2821527.35190.3950.49860.88190.495
52273.9313.7301212.8191596.63020.39130.57970.76080.4962
53216313.7301204.4662673.79890.29740.58580.70390.497
54196.4313.7301197.5036762.36540.30410.66530.66550.4976
55190.9313.7301191.5324866.65810.33160.66130.59670.4981
56206.4313.7301186.3065992.64680.37830.63860.56240.4984
57196.3313.7301181.66261149.16780.39150.59940.52310.4987
58199.5313.7301177.48621350.13840.41450.58790.50210.499
59198.9313.7301173.6941619.02570.43160.56810.49560.4992
60214.4313.7301170.22331998.91650.4540.55310.49940.4994

\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[48]) \tabularnewline
36 & 172.3 & - & - & - & - & - & - & - \tabularnewline
37 & 184.8 & - & - & - & - & - & - & - \tabularnewline
38 & 177.7 & - & - & - & - & - & - & - \tabularnewline
39 & 184.6 & - & - & - & - & - & - & - \tabularnewline
40 & 211.4 & - & - & - & - & - & - & - \tabularnewline
41 & 215.3 & - & - & - & - & - & - & - \tabularnewline
42 & 215.9 & - & - & - & - & - & - & - \tabularnewline
43 & 244.7 & - & - & - & - & - & - & - \tabularnewline
44 & 259.3 & - & - & - & - & - & - & - \tabularnewline
45 & 289 & - & - & - & - & - & - & - \tabularnewline
46 & 310.9 & - & - & - & - & - & - & - \tabularnewline
47 & 321 & - & - & - & - & - & - & - \tabularnewline
48 & 315.1 & - & - & - & - & - & - & - \tabularnewline
49 & 333.2 & 313.7301 & 260.0462 & 395.345 & 0.32 & 0.4869 & 0.999 & 0.4869 \tabularnewline
50 & 314.1 & 313.7301 & 237.4065 & 462.3803 & 0.4981 & 0.3987 & 0.9636 & 0.4928 \tabularnewline
51 & 284.7 & 313.7301 & 223.2821 & 527.3519 & 0.395 & 0.4986 & 0.8819 & 0.495 \tabularnewline
52 & 273.9 & 313.7301 & 212.8191 & 596.6302 & 0.3913 & 0.5797 & 0.7608 & 0.4962 \tabularnewline
53 & 216 & 313.7301 & 204.4662 & 673.7989 & 0.2974 & 0.5858 & 0.7039 & 0.497 \tabularnewline
54 & 196.4 & 313.7301 & 197.5036 & 762.3654 & 0.3041 & 0.6653 & 0.6655 & 0.4976 \tabularnewline
55 & 190.9 & 313.7301 & 191.5324 & 866.6581 & 0.3316 & 0.6613 & 0.5967 & 0.4981 \tabularnewline
56 & 206.4 & 313.7301 & 186.3065 & 992.6468 & 0.3783 & 0.6386 & 0.5624 & 0.4984 \tabularnewline
57 & 196.3 & 313.7301 & 181.6626 & 1149.1678 & 0.3915 & 0.5994 & 0.5231 & 0.4987 \tabularnewline
58 & 199.5 & 313.7301 & 177.4862 & 1350.1384 & 0.4145 & 0.5879 & 0.5021 & 0.499 \tabularnewline
59 & 198.9 & 313.7301 & 173.694 & 1619.0257 & 0.4316 & 0.5681 & 0.4956 & 0.4992 \tabularnewline
60 & 214.4 & 313.7301 & 170.2233 & 1998.9165 & 0.454 & 0.5531 & 0.4994 & 0.4994 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67037&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[48])[/C][/ROW]
[ROW][C]36[/C][C]172.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]184.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]177.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]184.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]211.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]215.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]215.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]244.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]259.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]289[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]310.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]321[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]315.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]333.2[/C][C]313.7301[/C][C]260.0462[/C][C]395.345[/C][C]0.32[/C][C]0.4869[/C][C]0.999[/C][C]0.4869[/C][/ROW]
[ROW][C]50[/C][C]314.1[/C][C]313.7301[/C][C]237.4065[/C][C]462.3803[/C][C]0.4981[/C][C]0.3987[/C][C]0.9636[/C][C]0.4928[/C][/ROW]
[ROW][C]51[/C][C]284.7[/C][C]313.7301[/C][C]223.2821[/C][C]527.3519[/C][C]0.395[/C][C]0.4986[/C][C]0.8819[/C][C]0.495[/C][/ROW]
[ROW][C]52[/C][C]273.9[/C][C]313.7301[/C][C]212.8191[/C][C]596.6302[/C][C]0.3913[/C][C]0.5797[/C][C]0.7608[/C][C]0.4962[/C][/ROW]
[ROW][C]53[/C][C]216[/C][C]313.7301[/C][C]204.4662[/C][C]673.7989[/C][C]0.2974[/C][C]0.5858[/C][C]0.7039[/C][C]0.497[/C][/ROW]
[ROW][C]54[/C][C]196.4[/C][C]313.7301[/C][C]197.5036[/C][C]762.3654[/C][C]0.3041[/C][C]0.6653[/C][C]0.6655[/C][C]0.4976[/C][/ROW]
[ROW][C]55[/C][C]190.9[/C][C]313.7301[/C][C]191.5324[/C][C]866.6581[/C][C]0.3316[/C][C]0.6613[/C][C]0.5967[/C][C]0.4981[/C][/ROW]
[ROW][C]56[/C][C]206.4[/C][C]313.7301[/C][C]186.3065[/C][C]992.6468[/C][C]0.3783[/C][C]0.6386[/C][C]0.5624[/C][C]0.4984[/C][/ROW]
[ROW][C]57[/C][C]196.3[/C][C]313.7301[/C][C]181.6626[/C][C]1149.1678[/C][C]0.3915[/C][C]0.5994[/C][C]0.5231[/C][C]0.4987[/C][/ROW]
[ROW][C]58[/C][C]199.5[/C][C]313.7301[/C][C]177.4862[/C][C]1350.1384[/C][C]0.4145[/C][C]0.5879[/C][C]0.5021[/C][C]0.499[/C][/ROW]
[ROW][C]59[/C][C]198.9[/C][C]313.7301[/C][C]173.694[/C][C]1619.0257[/C][C]0.4316[/C][C]0.5681[/C][C]0.4956[/C][C]0.4992[/C][/ROW]
[ROW][C]60[/C][C]214.4[/C][C]313.7301[/C][C]170.2233[/C][C]1998.9165[/C][C]0.454[/C][C]0.5531[/C][C]0.4994[/C][C]0.4994[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67037&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67037&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[48])
36172.3-------
37184.8-------
38177.7-------
39184.6-------
40211.4-------
41215.3-------
42215.9-------
43244.7-------
44259.3-------
45289-------
46310.9-------
47321-------
48315.1-------
49333.2313.7301260.0462395.3450.320.48690.9990.4869
50314.1313.7301237.4065462.38030.49810.39870.96360.4928
51284.7313.7301223.2821527.35190.3950.49860.88190.495
52273.9313.7301212.8191596.63020.39130.57970.76080.4962
53216313.7301204.4662673.79890.29740.58580.70390.497
54196.4313.7301197.5036762.36540.30410.66530.66550.4976
55190.9313.7301191.5324866.65810.33160.66130.59670.4981
56206.4313.7301186.3065992.64680.37830.63860.56240.4984
57196.3313.7301181.66261149.16780.39150.59940.52310.4987
58199.5313.7301177.48621350.13840.41450.58790.50210.499
59198.9313.7301173.6941619.02570.43160.56810.49560.4992
60214.4313.7301170.22331998.91650.4540.55310.49940.4994







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.13270.06210379.076400
500.24170.00120.03160.1368189.606613.7698
510.3474-0.09250.0519842.7475407.320320.1822
520.4601-0.1270.07071586.438702.099726.4972
530.5856-0.31150.11889551.17532471.914849.7184
540.7296-0.3740.161413766.35584354.321665.9873
550.8992-0.39150.194215087.2375887.595376.7307
561.1041-0.34210.212711519.75356591.61581.1888
571.3586-0.37430.230713789.83187391.416985.9733
581.6855-0.36410.24413048.5197957.127189.2027
592.1227-0.3660.255113185.95528432.475191.8285
602.7405-0.31660.26029866.47168551.974892.4769

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1327 & 0.0621 & 0 & 379.0764 & 0 & 0 \tabularnewline
50 & 0.2417 & 0.0012 & 0.0316 & 0.1368 & 189.6066 & 13.7698 \tabularnewline
51 & 0.3474 & -0.0925 & 0.0519 & 842.7475 & 407.3203 & 20.1822 \tabularnewline
52 & 0.4601 & -0.127 & 0.0707 & 1586.438 & 702.0997 & 26.4972 \tabularnewline
53 & 0.5856 & -0.3115 & 0.1188 & 9551.1753 & 2471.9148 & 49.7184 \tabularnewline
54 & 0.7296 & -0.374 & 0.1614 & 13766.3558 & 4354.3216 & 65.9873 \tabularnewline
55 & 0.8992 & -0.3915 & 0.1942 & 15087.237 & 5887.5953 & 76.7307 \tabularnewline
56 & 1.1041 & -0.3421 & 0.2127 & 11519.7535 & 6591.615 & 81.1888 \tabularnewline
57 & 1.3586 & -0.3743 & 0.2307 & 13789.8318 & 7391.4169 & 85.9733 \tabularnewline
58 & 1.6855 & -0.3641 & 0.244 & 13048.519 & 7957.1271 & 89.2027 \tabularnewline
59 & 2.1227 & -0.366 & 0.2551 & 13185.9552 & 8432.4751 & 91.8285 \tabularnewline
60 & 2.7405 & -0.3166 & 0.2602 & 9866.4716 & 8551.9748 & 92.4769 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67037&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]49[/C][C]0.1327[/C][C]0.0621[/C][C]0[/C][C]379.0764[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.2417[/C][C]0.0012[/C][C]0.0316[/C][C]0.1368[/C][C]189.6066[/C][C]13.7698[/C][/ROW]
[ROW][C]51[/C][C]0.3474[/C][C]-0.0925[/C][C]0.0519[/C][C]842.7475[/C][C]407.3203[/C][C]20.1822[/C][/ROW]
[ROW][C]52[/C][C]0.4601[/C][C]-0.127[/C][C]0.0707[/C][C]1586.438[/C][C]702.0997[/C][C]26.4972[/C][/ROW]
[ROW][C]53[/C][C]0.5856[/C][C]-0.3115[/C][C]0.1188[/C][C]9551.1753[/C][C]2471.9148[/C][C]49.7184[/C][/ROW]
[ROW][C]54[/C][C]0.7296[/C][C]-0.374[/C][C]0.1614[/C][C]13766.3558[/C][C]4354.3216[/C][C]65.9873[/C][/ROW]
[ROW][C]55[/C][C]0.8992[/C][C]-0.3915[/C][C]0.1942[/C][C]15087.237[/C][C]5887.5953[/C][C]76.7307[/C][/ROW]
[ROW][C]56[/C][C]1.1041[/C][C]-0.3421[/C][C]0.2127[/C][C]11519.7535[/C][C]6591.615[/C][C]81.1888[/C][/ROW]
[ROW][C]57[/C][C]1.3586[/C][C]-0.3743[/C][C]0.2307[/C][C]13789.8318[/C][C]7391.4169[/C][C]85.9733[/C][/ROW]
[ROW][C]58[/C][C]1.6855[/C][C]-0.3641[/C][C]0.244[/C][C]13048.519[/C][C]7957.1271[/C][C]89.2027[/C][/ROW]
[ROW][C]59[/C][C]2.1227[/C][C]-0.366[/C][C]0.2551[/C][C]13185.9552[/C][C]8432.4751[/C][C]91.8285[/C][/ROW]
[ROW][C]60[/C][C]2.7405[/C][C]-0.3166[/C][C]0.2602[/C][C]9866.4716[/C][C]8551.9748[/C][C]92.4769[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67037&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67037&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
490.13270.06210379.076400
500.24170.00120.03160.1368189.606613.7698
510.3474-0.09250.0519842.7475407.320320.1822
520.4601-0.1270.07071586.438702.099726.4972
530.5856-0.31150.11889551.17532471.914849.7184
540.7296-0.3740.161413766.35584354.321665.9873
550.8992-0.39150.194215087.2375887.595376.7307
561.1041-0.34210.212711519.75356591.61581.1888
571.3586-0.37430.230713789.83187391.416985.9733
581.6855-0.36410.24413048.5197957.127189.2027
592.1227-0.3660.255113185.95528432.475191.8285
602.7405-0.31660.26029866.47168551.974892.4769



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