Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSat, 13 Dec 2008 06:50:39 -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/13/t1229176295acirwriyly6ui8x.htm/, Retrieved Sun, 19 May 2024 05:51:04 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33090, Retrieved Sun, 19 May 2024 05:51:04 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact167
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2008-12-13 13:50:39] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
132.7
128.6
127.8
128.9
124.6
129.2
130.5
124.3
125.8
123.5
120.7
123.1
122.0
121.0
121.2
117.4
113.0
113.1
116.1
121.3
108.6
114.3
113.5
111.2
109.3
108.2
102.7
110.4
108.1
112.8
108.1
102.6
109.2
108.2
107.1
108.4
103.6
104.0
111.5
105.4




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33090&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]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33090&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33090&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'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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[28])
16117.4-------
17113-------
18113.1-------
19116.1-------
20121.3-------
21108.6-------
22114.3-------
23113.5-------
24111.2-------
25109.3-------
26108.2-------
27102.7-------
28110.4-------
29108.1111.7559103.8171119.69480.18340.63110.37940.6311
30112.8111.7251100.4979122.95230.42560.73660.40520.5915
31108.1110.800697.0501124.55110.35010.38780.2250.5228
32102.6109.198293.3205125.07590.20770.55390.06760.441
33109.2113.111895.36130.86360.33290.87710.69080.6177
34108.2111.355391.9092130.80140.37520.5860.38330.5384
35107.1111.601890.5976132.6060.33720.62450.42970.5446
36108.4112.310689.8562134.7650.36640.67540.53860.5662
37103.6112.896189.0796136.71260.22210.64430.61640.5814
38104113.235188.1303138.33990.23550.7740.65290.5876
39111.5114.9388.5998141.26010.39920.79210.81870.632
40105.4112.557185.0562140.05810.3050.530.56110.5611

\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[28]) \tabularnewline
16 & 117.4 & - & - & - & - & - & - & - \tabularnewline
17 & 113 & - & - & - & - & - & - & - \tabularnewline
18 & 113.1 & - & - & - & - & - & - & - \tabularnewline
19 & 116.1 & - & - & - & - & - & - & - \tabularnewline
20 & 121.3 & - & - & - & - & - & - & - \tabularnewline
21 & 108.6 & - & - & - & - & - & - & - \tabularnewline
22 & 114.3 & - & - & - & - & - & - & - \tabularnewline
23 & 113.5 & - & - & - & - & - & - & - \tabularnewline
24 & 111.2 & - & - & - & - & - & - & - \tabularnewline
25 & 109.3 & - & - & - & - & - & - & - \tabularnewline
26 & 108.2 & - & - & - & - & - & - & - \tabularnewline
27 & 102.7 & - & - & - & - & - & - & - \tabularnewline
28 & 110.4 & - & - & - & - & - & - & - \tabularnewline
29 & 108.1 & 111.7559 & 103.8171 & 119.6948 & 0.1834 & 0.6311 & 0.3794 & 0.6311 \tabularnewline
30 & 112.8 & 111.7251 & 100.4979 & 122.9523 & 0.4256 & 0.7366 & 0.4052 & 0.5915 \tabularnewline
31 & 108.1 & 110.8006 & 97.0501 & 124.5511 & 0.3501 & 0.3878 & 0.225 & 0.5228 \tabularnewline
32 & 102.6 & 109.1982 & 93.3205 & 125.0759 & 0.2077 & 0.5539 & 0.0676 & 0.441 \tabularnewline
33 & 109.2 & 113.1118 & 95.36 & 130.8636 & 0.3329 & 0.8771 & 0.6908 & 0.6177 \tabularnewline
34 & 108.2 & 111.3553 & 91.9092 & 130.8014 & 0.3752 & 0.586 & 0.3833 & 0.5384 \tabularnewline
35 & 107.1 & 111.6018 & 90.5976 & 132.606 & 0.3372 & 0.6245 & 0.4297 & 0.5446 \tabularnewline
36 & 108.4 & 112.3106 & 89.8562 & 134.765 & 0.3664 & 0.6754 & 0.5386 & 0.5662 \tabularnewline
37 & 103.6 & 112.8961 & 89.0796 & 136.7126 & 0.2221 & 0.6443 & 0.6164 & 0.5814 \tabularnewline
38 & 104 & 113.2351 & 88.1303 & 138.3399 & 0.2355 & 0.774 & 0.6529 & 0.5876 \tabularnewline
39 & 111.5 & 114.93 & 88.5998 & 141.2601 & 0.3992 & 0.7921 & 0.8187 & 0.632 \tabularnewline
40 & 105.4 & 112.5571 & 85.0562 & 140.0581 & 0.305 & 0.53 & 0.5611 & 0.5611 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33090&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[28])[/C][/ROW]
[ROW][C]16[/C][C]117.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]17[/C][C]113[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]18[/C][C]113.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]19[/C][C]116.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]20[/C][C]121.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]21[/C][C]108.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]22[/C][C]114.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]23[/C][C]113.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]24[/C][C]111.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]109.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]26[/C][C]108.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]102.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]110.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]108.1[/C][C]111.7559[/C][C]103.8171[/C][C]119.6948[/C][C]0.1834[/C][C]0.6311[/C][C]0.3794[/C][C]0.6311[/C][/ROW]
[ROW][C]30[/C][C]112.8[/C][C]111.7251[/C][C]100.4979[/C][C]122.9523[/C][C]0.4256[/C][C]0.7366[/C][C]0.4052[/C][C]0.5915[/C][/ROW]
[ROW][C]31[/C][C]108.1[/C][C]110.8006[/C][C]97.0501[/C][C]124.5511[/C][C]0.3501[/C][C]0.3878[/C][C]0.225[/C][C]0.5228[/C][/ROW]
[ROW][C]32[/C][C]102.6[/C][C]109.1982[/C][C]93.3205[/C][C]125.0759[/C][C]0.2077[/C][C]0.5539[/C][C]0.0676[/C][C]0.441[/C][/ROW]
[ROW][C]33[/C][C]109.2[/C][C]113.1118[/C][C]95.36[/C][C]130.8636[/C][C]0.3329[/C][C]0.8771[/C][C]0.6908[/C][C]0.6177[/C][/ROW]
[ROW][C]34[/C][C]108.2[/C][C]111.3553[/C][C]91.9092[/C][C]130.8014[/C][C]0.3752[/C][C]0.586[/C][C]0.3833[/C][C]0.5384[/C][/ROW]
[ROW][C]35[/C][C]107.1[/C][C]111.6018[/C][C]90.5976[/C][C]132.606[/C][C]0.3372[/C][C]0.6245[/C][C]0.4297[/C][C]0.5446[/C][/ROW]
[ROW][C]36[/C][C]108.4[/C][C]112.3106[/C][C]89.8562[/C][C]134.765[/C][C]0.3664[/C][C]0.6754[/C][C]0.5386[/C][C]0.5662[/C][/ROW]
[ROW][C]37[/C][C]103.6[/C][C]112.8961[/C][C]89.0796[/C][C]136.7126[/C][C]0.2221[/C][C]0.6443[/C][C]0.6164[/C][C]0.5814[/C][/ROW]
[ROW][C]38[/C][C]104[/C][C]113.2351[/C][C]88.1303[/C][C]138.3399[/C][C]0.2355[/C][C]0.774[/C][C]0.6529[/C][C]0.5876[/C][/ROW]
[ROW][C]39[/C][C]111.5[/C][C]114.93[/C][C]88.5998[/C][C]141.2601[/C][C]0.3992[/C][C]0.7921[/C][C]0.8187[/C][C]0.632[/C][/ROW]
[ROW][C]40[/C][C]105.4[/C][C]112.5571[/C][C]85.0562[/C][C]140.0581[/C][C]0.305[/C][C]0.53[/C][C]0.5611[/C][C]0.5611[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33090&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33090&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[28])
16117.4-------
17113-------
18113.1-------
19116.1-------
20121.3-------
21108.6-------
22114.3-------
23113.5-------
24111.2-------
25109.3-------
26108.2-------
27102.7-------
28110.4-------
29108.1111.7559103.8171119.69480.18340.63110.37940.6311
30112.8111.7251100.4979122.95230.42560.73660.40520.5915
31108.1110.800697.0501124.55110.35010.38780.2250.5228
32102.6109.198293.3205125.07590.20770.55390.06760.441
33109.2113.111895.36130.86360.33290.87710.69080.6177
34108.2111.355391.9092130.80140.37520.5860.38330.5384
35107.1111.601890.5976132.6060.33720.62450.42970.5446
36108.4112.310689.8562134.7650.36640.67540.53860.5662
37103.6112.896189.0796136.71260.22210.64430.61640.5814
38104113.235188.1303138.33990.23550.7740.65290.5876
39111.5114.9388.5998141.26010.39920.79210.81870.632
40105.4112.557185.0562140.05810.3050.530.56110.5611







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
290.0362-0.03270.002713.36571.11381.0554
300.05130.00968e-041.15540.09630.3103
310.0633-0.02440.0027.29330.60780.7796
320.0742-0.06040.00543.53583.6281.9047
330.0801-0.03460.002915.30241.27521.1292
340.0891-0.02830.00249.95590.82970.9109
350.096-0.04030.003420.26651.68891.2996
360.102-0.03480.002915.29281.27441.1289
370.1076-0.08230.006986.41777.20152.6836
380.1131-0.08160.006885.28697.10722.6659
390.1169-0.02980.002511.76480.98040.9902
400.1247-0.06360.005351.22464.26872.0661

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
29 & 0.0362 & -0.0327 & 0.0027 & 13.3657 & 1.1138 & 1.0554 \tabularnewline
30 & 0.0513 & 0.0096 & 8e-04 & 1.1554 & 0.0963 & 0.3103 \tabularnewline
31 & 0.0633 & -0.0244 & 0.002 & 7.2933 & 0.6078 & 0.7796 \tabularnewline
32 & 0.0742 & -0.0604 & 0.005 & 43.5358 & 3.628 & 1.9047 \tabularnewline
33 & 0.0801 & -0.0346 & 0.0029 & 15.3024 & 1.2752 & 1.1292 \tabularnewline
34 & 0.0891 & -0.0283 & 0.0024 & 9.9559 & 0.8297 & 0.9109 \tabularnewline
35 & 0.096 & -0.0403 & 0.0034 & 20.2665 & 1.6889 & 1.2996 \tabularnewline
36 & 0.102 & -0.0348 & 0.0029 & 15.2928 & 1.2744 & 1.1289 \tabularnewline
37 & 0.1076 & -0.0823 & 0.0069 & 86.4177 & 7.2015 & 2.6836 \tabularnewline
38 & 0.1131 & -0.0816 & 0.0068 & 85.2869 & 7.1072 & 2.6659 \tabularnewline
39 & 0.1169 & -0.0298 & 0.0025 & 11.7648 & 0.9804 & 0.9902 \tabularnewline
40 & 0.1247 & -0.0636 & 0.0053 & 51.2246 & 4.2687 & 2.0661 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33090&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]29[/C][C]0.0362[/C][C]-0.0327[/C][C]0.0027[/C][C]13.3657[/C][C]1.1138[/C][C]1.0554[/C][/ROW]
[ROW][C]30[/C][C]0.0513[/C][C]0.0096[/C][C]8e-04[/C][C]1.1554[/C][C]0.0963[/C][C]0.3103[/C][/ROW]
[ROW][C]31[/C][C]0.0633[/C][C]-0.0244[/C][C]0.002[/C][C]7.2933[/C][C]0.6078[/C][C]0.7796[/C][/ROW]
[ROW][C]32[/C][C]0.0742[/C][C]-0.0604[/C][C]0.005[/C][C]43.5358[/C][C]3.628[/C][C]1.9047[/C][/ROW]
[ROW][C]33[/C][C]0.0801[/C][C]-0.0346[/C][C]0.0029[/C][C]15.3024[/C][C]1.2752[/C][C]1.1292[/C][/ROW]
[ROW][C]34[/C][C]0.0891[/C][C]-0.0283[/C][C]0.0024[/C][C]9.9559[/C][C]0.8297[/C][C]0.9109[/C][/ROW]
[ROW][C]35[/C][C]0.096[/C][C]-0.0403[/C][C]0.0034[/C][C]20.2665[/C][C]1.6889[/C][C]1.2996[/C][/ROW]
[ROW][C]36[/C][C]0.102[/C][C]-0.0348[/C][C]0.0029[/C][C]15.2928[/C][C]1.2744[/C][C]1.1289[/C][/ROW]
[ROW][C]37[/C][C]0.1076[/C][C]-0.0823[/C][C]0.0069[/C][C]86.4177[/C][C]7.2015[/C][C]2.6836[/C][/ROW]
[ROW][C]38[/C][C]0.1131[/C][C]-0.0816[/C][C]0.0068[/C][C]85.2869[/C][C]7.1072[/C][C]2.6659[/C][/ROW]
[ROW][C]39[/C][C]0.1169[/C][C]-0.0298[/C][C]0.0025[/C][C]11.7648[/C][C]0.9804[/C][C]0.9902[/C][/ROW]
[ROW][C]40[/C][C]0.1247[/C][C]-0.0636[/C][C]0.0053[/C][C]51.2246[/C][C]4.2687[/C][C]2.0661[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33090&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33090&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
290.0362-0.03270.002713.36571.11381.0554
300.05130.00968e-041.15540.09630.3103
310.0633-0.02440.0027.29330.60780.7796
320.0742-0.06040.00543.53583.6281.9047
330.0801-0.03460.002915.30241.27521.1292
340.0891-0.02830.00249.95590.82970.9109
350.096-0.04030.003420.26651.68891.2996
360.102-0.03480.002915.29281.27441.1289
370.1076-0.08230.006986.41777.20152.6836
380.1131-0.08160.006885.28697.10722.6659
390.1169-0.02980.002511.76480.98040.9902
400.1247-0.06360.005351.22464.26872.0661



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