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 computationFri, 11 Dec 2009 07:11:16 -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/11/t126054100937zr3zk8ndio2sj.htm/, Retrieved Sun, 28 Apr 2024 20:35:07 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66219, Retrieved Sun, 28 Apr 2024 20:35:07 +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] [WS 10, ARIMA Forc...] [2009-12-11 14:11:16] [e31f2fa83f4a5291b9a51009566cf69b] [Current]
Feedback Forum

Post a new message
Dataseries X:
95.1
97
112.7
102.9
97.4
111.4
87.4
96.8
114.1
110.3
103.9
101.6
94.6
95.9
104.7
102.8
98.1
113.9
80.9
95.7
113.2
105.9
108.8
102.3
99
100.7
115.5
100.7
109.9
114.6
85.4
100.5
114.8
116.5
112.9
102
106
105.3
118.8
106.1
109.3
117.2
92.5
104.2
112.5
122.4
113.3
100
110.7
112.8
109.8
117.3
109.1
115.9
96
99.8
116.8
115.7
99.4
94.3




Summary of computational 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 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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66219&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66219&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66219&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'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])
36102-------
37106-------
38105.3-------
39118.8-------
40106.1-------
41109.3-------
42117.2-------
4392.5-------
44104.2-------
45112.5-------
46122.4-------
47113.3-------
48100-------
49110.7106.322599.8003112.84470.09420.97130.53860.9713
50112.8102.838496.2987109.37810.00140.00920.23030.8025
51109.8113.0595106.0918120.02730.17960.52910.05320.9999
52117.3108.3652100.9428115.78750.00920.35240.72510.9864
53109.1103.387795.9503110.82510.06611e-040.05960.814
54115.9117.3533109.6603125.04620.35560.98230.51561
559690.039382.258297.82050.066600.26770.0061
5699.8101.547393.721109.37370.33080.91760.25320.6508
57116.8112.6161104.6923120.540.15040.99920.51150.9991
58115.7116.412108.454124.36990.43040.46190.07011
5999.4111.4328103.4376119.42790.00160.14780.32360.9975
6094.3100.877792.8462108.90920.05420.64080.58480.5848

\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 & 102 & - & - & - & - & - & - & - \tabularnewline
37 & 106 & - & - & - & - & - & - & - \tabularnewline
38 & 105.3 & - & - & - & - & - & - & - \tabularnewline
39 & 118.8 & - & - & - & - & - & - & - \tabularnewline
40 & 106.1 & - & - & - & - & - & - & - \tabularnewline
41 & 109.3 & - & - & - & - & - & - & - \tabularnewline
42 & 117.2 & - & - & - & - & - & - & - \tabularnewline
43 & 92.5 & - & - & - & - & - & - & - \tabularnewline
44 & 104.2 & - & - & - & - & - & - & - \tabularnewline
45 & 112.5 & - & - & - & - & - & - & - \tabularnewline
46 & 122.4 & - & - & - & - & - & - & - \tabularnewline
47 & 113.3 & - & - & - & - & - & - & - \tabularnewline
48 & 100 & - & - & - & - & - & - & - \tabularnewline
49 & 110.7 & 106.3225 & 99.8003 & 112.8447 & 0.0942 & 0.9713 & 0.5386 & 0.9713 \tabularnewline
50 & 112.8 & 102.8384 & 96.2987 & 109.3781 & 0.0014 & 0.0092 & 0.2303 & 0.8025 \tabularnewline
51 & 109.8 & 113.0595 & 106.0918 & 120.0273 & 0.1796 & 0.5291 & 0.0532 & 0.9999 \tabularnewline
52 & 117.3 & 108.3652 & 100.9428 & 115.7875 & 0.0092 & 0.3524 & 0.7251 & 0.9864 \tabularnewline
53 & 109.1 & 103.3877 & 95.9503 & 110.8251 & 0.0661 & 1e-04 & 0.0596 & 0.814 \tabularnewline
54 & 115.9 & 117.3533 & 109.6603 & 125.0462 & 0.3556 & 0.9823 & 0.5156 & 1 \tabularnewline
55 & 96 & 90.0393 & 82.2582 & 97.8205 & 0.0666 & 0 & 0.2677 & 0.0061 \tabularnewline
56 & 99.8 & 101.5473 & 93.721 & 109.3737 & 0.3308 & 0.9176 & 0.2532 & 0.6508 \tabularnewline
57 & 116.8 & 112.6161 & 104.6923 & 120.54 & 0.1504 & 0.9992 & 0.5115 & 0.9991 \tabularnewline
58 & 115.7 & 116.412 & 108.454 & 124.3699 & 0.4304 & 0.4619 & 0.0701 & 1 \tabularnewline
59 & 99.4 & 111.4328 & 103.4376 & 119.4279 & 0.0016 & 0.1478 & 0.3236 & 0.9975 \tabularnewline
60 & 94.3 & 100.8777 & 92.8462 & 108.9092 & 0.0542 & 0.6408 & 0.5848 & 0.5848 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66219&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]102[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]106[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]105.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]118.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]106.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]109.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]117.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]92.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]104.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]112.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]122.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]113.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]110.7[/C][C]106.3225[/C][C]99.8003[/C][C]112.8447[/C][C]0.0942[/C][C]0.9713[/C][C]0.5386[/C][C]0.9713[/C][/ROW]
[ROW][C]50[/C][C]112.8[/C][C]102.8384[/C][C]96.2987[/C][C]109.3781[/C][C]0.0014[/C][C]0.0092[/C][C]0.2303[/C][C]0.8025[/C][/ROW]
[ROW][C]51[/C][C]109.8[/C][C]113.0595[/C][C]106.0918[/C][C]120.0273[/C][C]0.1796[/C][C]0.5291[/C][C]0.0532[/C][C]0.9999[/C][/ROW]
[ROW][C]52[/C][C]117.3[/C][C]108.3652[/C][C]100.9428[/C][C]115.7875[/C][C]0.0092[/C][C]0.3524[/C][C]0.7251[/C][C]0.9864[/C][/ROW]
[ROW][C]53[/C][C]109.1[/C][C]103.3877[/C][C]95.9503[/C][C]110.8251[/C][C]0.0661[/C][C]1e-04[/C][C]0.0596[/C][C]0.814[/C][/ROW]
[ROW][C]54[/C][C]115.9[/C][C]117.3533[/C][C]109.6603[/C][C]125.0462[/C][C]0.3556[/C][C]0.9823[/C][C]0.5156[/C][C]1[/C][/ROW]
[ROW][C]55[/C][C]96[/C][C]90.0393[/C][C]82.2582[/C][C]97.8205[/C][C]0.0666[/C][C]0[/C][C]0.2677[/C][C]0.0061[/C][/ROW]
[ROW][C]56[/C][C]99.8[/C][C]101.5473[/C][C]93.721[/C][C]109.3737[/C][C]0.3308[/C][C]0.9176[/C][C]0.2532[/C][C]0.6508[/C][/ROW]
[ROW][C]57[/C][C]116.8[/C][C]112.6161[/C][C]104.6923[/C][C]120.54[/C][C]0.1504[/C][C]0.9992[/C][C]0.5115[/C][C]0.9991[/C][/ROW]
[ROW][C]58[/C][C]115.7[/C][C]116.412[/C][C]108.454[/C][C]124.3699[/C][C]0.4304[/C][C]0.4619[/C][C]0.0701[/C][C]1[/C][/ROW]
[ROW][C]59[/C][C]99.4[/C][C]111.4328[/C][C]103.4376[/C][C]119.4279[/C][C]0.0016[/C][C]0.1478[/C][C]0.3236[/C][C]0.9975[/C][/ROW]
[ROW][C]60[/C][C]94.3[/C][C]100.8777[/C][C]92.8462[/C][C]108.9092[/C][C]0.0542[/C][C]0.6408[/C][C]0.5848[/C][C]0.5848[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66219&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66219&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])
36102-------
37106-------
38105.3-------
39118.8-------
40106.1-------
41109.3-------
42117.2-------
4392.5-------
44104.2-------
45112.5-------
46122.4-------
47113.3-------
48100-------
49110.7106.322599.8003112.84470.09420.97130.53860.9713
50112.8102.838496.2987109.37810.00140.00920.23030.8025
51109.8113.0595106.0918120.02730.17960.52910.05320.9999
52117.3108.3652100.9428115.78750.00920.35240.72510.9864
53109.1103.387795.9503110.82510.06611e-040.05960.814
54115.9117.3533109.6603125.04620.35560.98230.51561
559690.039382.258297.82050.066600.26770.0061
5699.8101.547393.721109.37370.33080.91760.25320.6508
57116.8112.6161104.6923120.540.15040.99920.51150.9991
58115.7116.412108.454124.36990.43040.46190.07011
5999.4111.4328103.4376119.42790.00160.14780.32360.9975
6094.3100.877792.8462108.90920.05420.64080.58480.5848







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.03130.0412019.162400
500.03240.09690.06999.233859.19817.694
510.0314-0.02880.055610.624543.00696.558
520.03490.08250.062379.831452.2137.2259
530.03670.05530.060932.630548.29656.9496
540.0334-0.01240.05282.11240.59916.3717
550.04410.06620.054735.529839.87496.3147
560.0393-0.01720.053.053135.27225.939
570.03590.03720.048617.504633.2985.7704
580.0349-0.00610.04440.506930.01895.479
590.0366-0.1080.0501144.787140.45246.3602
600.0406-0.06520.051443.26640.68686.3786

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0313 & 0.0412 & 0 & 19.1624 & 0 & 0 \tabularnewline
50 & 0.0324 & 0.0969 & 0.069 & 99.2338 & 59.1981 & 7.694 \tabularnewline
51 & 0.0314 & -0.0288 & 0.0556 & 10.6245 & 43.0069 & 6.558 \tabularnewline
52 & 0.0349 & 0.0825 & 0.0623 & 79.8314 & 52.213 & 7.2259 \tabularnewline
53 & 0.0367 & 0.0553 & 0.0609 & 32.6305 & 48.2965 & 6.9496 \tabularnewline
54 & 0.0334 & -0.0124 & 0.0528 & 2.112 & 40.5991 & 6.3717 \tabularnewline
55 & 0.0441 & 0.0662 & 0.0547 & 35.5298 & 39.8749 & 6.3147 \tabularnewline
56 & 0.0393 & -0.0172 & 0.05 & 3.0531 & 35.2722 & 5.939 \tabularnewline
57 & 0.0359 & 0.0372 & 0.0486 & 17.5046 & 33.298 & 5.7704 \tabularnewline
58 & 0.0349 & -0.0061 & 0.0444 & 0.5069 & 30.0189 & 5.479 \tabularnewline
59 & 0.0366 & -0.108 & 0.0501 & 144.7871 & 40.4524 & 6.3602 \tabularnewline
60 & 0.0406 & -0.0652 & 0.0514 & 43.266 & 40.6868 & 6.3786 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66219&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.0313[/C][C]0.0412[/C][C]0[/C][C]19.1624[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0324[/C][C]0.0969[/C][C]0.069[/C][C]99.2338[/C][C]59.1981[/C][C]7.694[/C][/ROW]
[ROW][C]51[/C][C]0.0314[/C][C]-0.0288[/C][C]0.0556[/C][C]10.6245[/C][C]43.0069[/C][C]6.558[/C][/ROW]
[ROW][C]52[/C][C]0.0349[/C][C]0.0825[/C][C]0.0623[/C][C]79.8314[/C][C]52.213[/C][C]7.2259[/C][/ROW]
[ROW][C]53[/C][C]0.0367[/C][C]0.0553[/C][C]0.0609[/C][C]32.6305[/C][C]48.2965[/C][C]6.9496[/C][/ROW]
[ROW][C]54[/C][C]0.0334[/C][C]-0.0124[/C][C]0.0528[/C][C]2.112[/C][C]40.5991[/C][C]6.3717[/C][/ROW]
[ROW][C]55[/C][C]0.0441[/C][C]0.0662[/C][C]0.0547[/C][C]35.5298[/C][C]39.8749[/C][C]6.3147[/C][/ROW]
[ROW][C]56[/C][C]0.0393[/C][C]-0.0172[/C][C]0.05[/C][C]3.0531[/C][C]35.2722[/C][C]5.939[/C][/ROW]
[ROW][C]57[/C][C]0.0359[/C][C]0.0372[/C][C]0.0486[/C][C]17.5046[/C][C]33.298[/C][C]5.7704[/C][/ROW]
[ROW][C]58[/C][C]0.0349[/C][C]-0.0061[/C][C]0.0444[/C][C]0.5069[/C][C]30.0189[/C][C]5.479[/C][/ROW]
[ROW][C]59[/C][C]0.0366[/C][C]-0.108[/C][C]0.0501[/C][C]144.7871[/C][C]40.4524[/C][C]6.3602[/C][/ROW]
[ROW][C]60[/C][C]0.0406[/C][C]-0.0652[/C][C]0.0514[/C][C]43.266[/C][C]40.6868[/C][C]6.3786[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66219&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66219&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.03130.0412019.162400
500.03240.09690.06999.233859.19817.694
510.0314-0.02880.055610.624543.00696.558
520.03490.08250.062379.831452.2137.2259
530.03670.05530.060932.630548.29656.9496
540.0334-0.01240.05282.11240.59916.3717
550.04410.06620.054735.529839.87496.3147
560.0393-0.01720.053.053135.27225.939
570.03590.03720.048617.504633.2985.7704
580.0349-0.00610.04440.506930.01895.479
590.0366-0.1080.0501144.787140.45246.3602
600.0406-0.06520.051443.26640.68686.3786



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