Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSun, 21 Dec 2008 12:36:09 -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/2008/Dec/21/t1229888283k3hyaso912ytt08.htm/, Retrieved Tue, 28 May 2024 10:54:09 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=35782, Retrieved Tue, 28 May 2024 10:54:09 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact133
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2008-12-21 19:36:09] [a2d5a6282476ec2b5afae6fb53d308f8] [Current]
Feedback Forum

Post a new message
Dataseries X:
106.7
101.1
97.8
113.8
107.1
117.5
113.7
106.6
109.8
108.8
102.0
114.5
116.5
108.6
113.9
109.3
112.5
123.4
115.2
110.8
120.4
117.6
111.2
131.1
118.9
115.7
119.6
113.1
106.4
115.5
111.8
109.6
121.5
109.5
109.0
113.4
112.7
114.4
109.2
116.2
113.8
123.6
112.6
117.7
113.3
110.7
114.7
116.9
120.6
111.6
111.9
116.1
111.9
125.1
115.1
116.7
115.8
116.8
113.0
106.5




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 2 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=35782&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=35782&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35782&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 time2 seconds
R Server'George Udny Yule' @ 72.249.76.132







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])
36113.4-------
37112.7-------
38114.4-------
39109.2-------
40116.2-------
41113.8-------
42123.6-------
43112.6-------
44117.7-------
45113.3-------
46110.7-------
47114.7-------
48116.9-------
49120.6114.0301103.3918124.66840.11310.29850.59680.2985
50111.6115.5974104.5535126.64130.2390.18730.58410.4086
51111.9114.4038102.6554126.15220.33810.680.80730.3385
52116.1115.1692101.7505128.58780.44590.68350.44020.4002
53111.9114.6241100.5472128.7010.35220.41860.54570.3757
54125.1117.2415102.365132.11810.15030.75920.20110.5179
55115.1114.340198.533130.14720.46250.09110.58540.3755
56116.7115.481898.9852131.97850.44250.51810.39610.4331
57115.8114.994597.7742132.21480.46350.4230.57650.4142
58116.8113.700695.7584131.64270.36750.40930.62850.3634
59113114.591596.0005133.18250.43340.40790.49540.4039
60106.5115.273896.0368134.51090.18570.59160.43420.4342

\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 & 113.4 & - & - & - & - & - & - & - \tabularnewline
37 & 112.7 & - & - & - & - & - & - & - \tabularnewline
38 & 114.4 & - & - & - & - & - & - & - \tabularnewline
39 & 109.2 & - & - & - & - & - & - & - \tabularnewline
40 & 116.2 & - & - & - & - & - & - & - \tabularnewline
41 & 113.8 & - & - & - & - & - & - & - \tabularnewline
42 & 123.6 & - & - & - & - & - & - & - \tabularnewline
43 & 112.6 & - & - & - & - & - & - & - \tabularnewline
44 & 117.7 & - & - & - & - & - & - & - \tabularnewline
45 & 113.3 & - & - & - & - & - & - & - \tabularnewline
46 & 110.7 & - & - & - & - & - & - & - \tabularnewline
47 & 114.7 & - & - & - & - & - & - & - \tabularnewline
48 & 116.9 & - & - & - & - & - & - & - \tabularnewline
49 & 120.6 & 114.0301 & 103.3918 & 124.6684 & 0.1131 & 0.2985 & 0.5968 & 0.2985 \tabularnewline
50 & 111.6 & 115.5974 & 104.5535 & 126.6413 & 0.239 & 0.1873 & 0.5841 & 0.4086 \tabularnewline
51 & 111.9 & 114.4038 & 102.6554 & 126.1522 & 0.3381 & 0.68 & 0.8073 & 0.3385 \tabularnewline
52 & 116.1 & 115.1692 & 101.7505 & 128.5878 & 0.4459 & 0.6835 & 0.4402 & 0.4002 \tabularnewline
53 & 111.9 & 114.6241 & 100.5472 & 128.701 & 0.3522 & 0.4186 & 0.5457 & 0.3757 \tabularnewline
54 & 125.1 & 117.2415 & 102.365 & 132.1181 & 0.1503 & 0.7592 & 0.2011 & 0.5179 \tabularnewline
55 & 115.1 & 114.3401 & 98.533 & 130.1472 & 0.4625 & 0.0911 & 0.5854 & 0.3755 \tabularnewline
56 & 116.7 & 115.4818 & 98.9852 & 131.9785 & 0.4425 & 0.5181 & 0.3961 & 0.4331 \tabularnewline
57 & 115.8 & 114.9945 & 97.7742 & 132.2148 & 0.4635 & 0.423 & 0.5765 & 0.4142 \tabularnewline
58 & 116.8 & 113.7006 & 95.7584 & 131.6427 & 0.3675 & 0.4093 & 0.6285 & 0.3634 \tabularnewline
59 & 113 & 114.5915 & 96.0005 & 133.1825 & 0.4334 & 0.4079 & 0.4954 & 0.4039 \tabularnewline
60 & 106.5 & 115.2738 & 96.0368 & 134.5109 & 0.1857 & 0.5916 & 0.4342 & 0.4342 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=35782&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]113.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]112.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]114.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]109.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]116.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]113.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]123.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]112.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]117.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]113.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]110.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]114.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]116.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]120.6[/C][C]114.0301[/C][C]103.3918[/C][C]124.6684[/C][C]0.1131[/C][C]0.2985[/C][C]0.5968[/C][C]0.2985[/C][/ROW]
[ROW][C]50[/C][C]111.6[/C][C]115.5974[/C][C]104.5535[/C][C]126.6413[/C][C]0.239[/C][C]0.1873[/C][C]0.5841[/C][C]0.4086[/C][/ROW]
[ROW][C]51[/C][C]111.9[/C][C]114.4038[/C][C]102.6554[/C][C]126.1522[/C][C]0.3381[/C][C]0.68[/C][C]0.8073[/C][C]0.3385[/C][/ROW]
[ROW][C]52[/C][C]116.1[/C][C]115.1692[/C][C]101.7505[/C][C]128.5878[/C][C]0.4459[/C][C]0.6835[/C][C]0.4402[/C][C]0.4002[/C][/ROW]
[ROW][C]53[/C][C]111.9[/C][C]114.6241[/C][C]100.5472[/C][C]128.701[/C][C]0.3522[/C][C]0.4186[/C][C]0.5457[/C][C]0.3757[/C][/ROW]
[ROW][C]54[/C][C]125.1[/C][C]117.2415[/C][C]102.365[/C][C]132.1181[/C][C]0.1503[/C][C]0.7592[/C][C]0.2011[/C][C]0.5179[/C][/ROW]
[ROW][C]55[/C][C]115.1[/C][C]114.3401[/C][C]98.533[/C][C]130.1472[/C][C]0.4625[/C][C]0.0911[/C][C]0.5854[/C][C]0.3755[/C][/ROW]
[ROW][C]56[/C][C]116.7[/C][C]115.4818[/C][C]98.9852[/C][C]131.9785[/C][C]0.4425[/C][C]0.5181[/C][C]0.3961[/C][C]0.4331[/C][/ROW]
[ROW][C]57[/C][C]115.8[/C][C]114.9945[/C][C]97.7742[/C][C]132.2148[/C][C]0.4635[/C][C]0.423[/C][C]0.5765[/C][C]0.4142[/C][/ROW]
[ROW][C]58[/C][C]116.8[/C][C]113.7006[/C][C]95.7584[/C][C]131.6427[/C][C]0.3675[/C][C]0.4093[/C][C]0.6285[/C][C]0.3634[/C][/ROW]
[ROW][C]59[/C][C]113[/C][C]114.5915[/C][C]96.0005[/C][C]133.1825[/C][C]0.4334[/C][C]0.4079[/C][C]0.4954[/C][C]0.4039[/C][/ROW]
[ROW][C]60[/C][C]106.5[/C][C]115.2738[/C][C]96.0368[/C][C]134.5109[/C][C]0.1857[/C][C]0.5916[/C][C]0.4342[/C][C]0.4342[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=35782&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35782&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])
36113.4-------
37112.7-------
38114.4-------
39109.2-------
40116.2-------
41113.8-------
42123.6-------
43112.6-------
44117.7-------
45113.3-------
46110.7-------
47114.7-------
48116.9-------
49120.6114.0301103.3918124.66840.11310.29850.59680.2985
50111.6115.5974104.5535126.64130.2390.18730.58410.4086
51111.9114.4038102.6554126.15220.33810.680.80730.3385
52116.1115.1692101.7505128.58780.44590.68350.44020.4002
53111.9114.6241100.5472128.7010.35220.41860.54570.3757
54125.1117.2415102.365132.11810.15030.75920.20110.5179
55115.1114.340198.533130.14720.46250.09110.58540.3755
56116.7115.481898.9852131.97850.44250.51810.39610.4331
57115.8114.994597.7742132.21480.46350.4230.57650.4142
58116.8113.700695.7584131.64270.36750.40930.62850.3634
59113114.591596.0005133.18250.43340.40790.49540.4039
60106.5115.273896.0368134.51090.18570.59160.43420.4342







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.04760.05760.004843.16363.5971.8966
500.0487-0.03460.002915.97911.33161.1539
510.0524-0.02190.00186.2690.52240.7228
520.05940.00817e-040.86650.07220.2687
530.0627-0.02380.0027.42050.61840.7864
540.06470.0670.005661.75535.14632.2685
550.07050.00666e-040.57750.04810.2194
560.07290.01059e-041.4840.12370.3517
570.07640.0076e-040.64880.05410.2325
580.08050.02730.00239.60640.80050.8947
590.0828-0.01390.00122.53280.21110.4594
600.0851-0.07610.006376.98046.4152.5328

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0476 & 0.0576 & 0.0048 & 43.1636 & 3.597 & 1.8966 \tabularnewline
50 & 0.0487 & -0.0346 & 0.0029 & 15.9791 & 1.3316 & 1.1539 \tabularnewline
51 & 0.0524 & -0.0219 & 0.0018 & 6.269 & 0.5224 & 0.7228 \tabularnewline
52 & 0.0594 & 0.0081 & 7e-04 & 0.8665 & 0.0722 & 0.2687 \tabularnewline
53 & 0.0627 & -0.0238 & 0.002 & 7.4205 & 0.6184 & 0.7864 \tabularnewline
54 & 0.0647 & 0.067 & 0.0056 & 61.7553 & 5.1463 & 2.2685 \tabularnewline
55 & 0.0705 & 0.0066 & 6e-04 & 0.5775 & 0.0481 & 0.2194 \tabularnewline
56 & 0.0729 & 0.0105 & 9e-04 & 1.484 & 0.1237 & 0.3517 \tabularnewline
57 & 0.0764 & 0.007 & 6e-04 & 0.6488 & 0.0541 & 0.2325 \tabularnewline
58 & 0.0805 & 0.0273 & 0.0023 & 9.6064 & 0.8005 & 0.8947 \tabularnewline
59 & 0.0828 & -0.0139 & 0.0012 & 2.5328 & 0.2111 & 0.4594 \tabularnewline
60 & 0.0851 & -0.0761 & 0.0063 & 76.9804 & 6.415 & 2.5328 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=35782&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.0476[/C][C]0.0576[/C][C]0.0048[/C][C]43.1636[/C][C]3.597[/C][C]1.8966[/C][/ROW]
[ROW][C]50[/C][C]0.0487[/C][C]-0.0346[/C][C]0.0029[/C][C]15.9791[/C][C]1.3316[/C][C]1.1539[/C][/ROW]
[ROW][C]51[/C][C]0.0524[/C][C]-0.0219[/C][C]0.0018[/C][C]6.269[/C][C]0.5224[/C][C]0.7228[/C][/ROW]
[ROW][C]52[/C][C]0.0594[/C][C]0.0081[/C][C]7e-04[/C][C]0.8665[/C][C]0.0722[/C][C]0.2687[/C][/ROW]
[ROW][C]53[/C][C]0.0627[/C][C]-0.0238[/C][C]0.002[/C][C]7.4205[/C][C]0.6184[/C][C]0.7864[/C][/ROW]
[ROW][C]54[/C][C]0.0647[/C][C]0.067[/C][C]0.0056[/C][C]61.7553[/C][C]5.1463[/C][C]2.2685[/C][/ROW]
[ROW][C]55[/C][C]0.0705[/C][C]0.0066[/C][C]6e-04[/C][C]0.5775[/C][C]0.0481[/C][C]0.2194[/C][/ROW]
[ROW][C]56[/C][C]0.0729[/C][C]0.0105[/C][C]9e-04[/C][C]1.484[/C][C]0.1237[/C][C]0.3517[/C][/ROW]
[ROW][C]57[/C][C]0.0764[/C][C]0.007[/C][C]6e-04[/C][C]0.6488[/C][C]0.0541[/C][C]0.2325[/C][/ROW]
[ROW][C]58[/C][C]0.0805[/C][C]0.0273[/C][C]0.0023[/C][C]9.6064[/C][C]0.8005[/C][C]0.8947[/C][/ROW]
[ROW][C]59[/C][C]0.0828[/C][C]-0.0139[/C][C]0.0012[/C][C]2.5328[/C][C]0.2111[/C][C]0.4594[/C][/ROW]
[ROW][C]60[/C][C]0.0851[/C][C]-0.0761[/C][C]0.0063[/C][C]76.9804[/C][C]6.415[/C][C]2.5328[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=35782&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35782&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.04760.05760.004843.16363.5971.8966
500.0487-0.03460.002915.97911.33161.1539
510.0524-0.02190.00186.2690.52240.7228
520.05940.00817e-040.86650.07220.2687
530.0627-0.02380.0027.42050.61840.7864
540.06470.0670.005661.75535.14632.2685
550.07050.00666e-040.57750.04810.2194
560.07290.01059e-041.4840.12370.3517
570.07640.0076e-040.64880.05410.2325
580.08050.02730.00239.60640.80050.8947
590.0828-0.01390.00122.53280.21110.4594
600.0851-0.07610.006376.98046.4152.5328



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