Transcript Polynomials

Seasonal ARMA forecasting
and
Fitting the bivariate data to GARCH
John DOE
Outline
Part I : Data description for the project
Part II : Fitting the data to Seasonal ARIMA model
and Forecasting
Part III: Fitting the bivariate data to GARCH model
1. Data description
• MEASLBAL.DAT
(http://www.robihyndman.com/TSDL/epi/measlbal.dat)
Monthly reported number of cases of measles, Baltimore,
Jan. 1939 to June 1972.
• MEASLNYC,DAT
(http://www.robihyndman.com/TSDL/epi/measlnyc.dat)
Monthly reported number of cases of measles, New York
city, 1928-1972.
Jan. 1939 to June 1972
2. Fitting the data
to Seasonal ARIMA model
SARIMA
fitting
SARIMA
fitting
Since the number of cases are strictly positive
and non stationary in the variance, the log was taken
SARIMA
fitting
Then the number of cases was seasonally
and lag 1 differenced
For Baltimore
SARIMA
fitting
Model
For New York City
AIC
Model
AIC
(0,1,28)x(4,1,0)12
0.6668533
(0,1,28)x(5,1,0)12
-1.089954
(2,1,28)x(4,1,0)12
0.6555881
(2,1,28)x(5,1,0)12
-1.015811
(14,1,28)x(4,1,0)12
0.6725279
(11,1,28)x(5,1,0)12
-1.024259
For Baltimore, (2,1,28)  (4,1,0)12was selected,
4
2
28



12 i 
i 
(1  B )(1  B)1    i B 1  i B  ln(BALt )  1   i B i at
i
i
i





12
For New York City,
(0,1,28)  (5,1,0)12 was selected,
5
28



12 i 
(1  B )(1  B)1    i B  ln(NYCt )  1   i B i at
i
i




12
SARIMA
fitting
Parameter estimates for Baltimore
Estimate
Estimate
Estimate
AR1
-0.0251
MA11
-0.0703
MA23
0.1741
AR2
-0.5102
MA12
-0.3713
MA24
-0.4022
MA1
-0.1634
MA13
-0.0059
MA25
0.2684
MA2
0.5935
MA14
-0.4141
MA26
-0.1641
MA3
-0.2383
MA15
0.1019
MA27
0.1697
MA4
-0.0606
MA16
-0.1736
MA28
0.2311
MA5
-0.1774
MA17
0.0952
SAR1
-0.5997
MA6
-0.0807
MA18
-0.0489
SAR2
-0.1742
MA7
-0.3268
MA19
0.2081
SAR3
-0.2425
MA8
-0.051
MA20
0.0440
SAR4
-0.2760
MA9
-0.2102
MA21
0.1740
MA10
0.0755
MA22
0.0204
SARIMA
fitting
Parameter estimates for New York City
Estimate
Estimate
Estimate
MA1
0.1696
MA13
-0.1589
MA25
0.0705
MA2
0.0064
MA14
-0.1221
MA26
0.1183
MA3
-0.0679
MA15
-0.2073
MA27
0.0697
MA4
-0.1088
MA16
-0.0864
MA28
0.0766
MA5
-0.0949
MA17
0.0432
SAR1
-0.8291
MA6
-0.1407
MA18
0.1078
SAR2
-0.3674
MA7
-0.1385
MA19
0.0245
SAR3
-0.4394
MA8
-0.0638
MA20
0.1434
SAR4
-0.4480
MA9
-0.1631
MA21
0.0076
SAR5
-0.2535
MA10
-0.1373
MA22
0.0679
MA11
-0.0722
MA23
0.1556
MA12
-0.2022
MA24
-0.1542
SARIMA
fitting
The diagnostic plots of the fitted model
Predictions
Data and predictions for Baltimore
Predictions
Data and predictions for New York City
2. Fitting the bivariate data
to GARCH model
GARCH
fitting
GARCH
fitting
1. We consider the OLS estimation for the model
• Baltimore and New York City are geographically
close to each other.
• Measles is the infectious diseases
Balt  0  1NYCt   t
Balˆt  174.4826 0.06941NYCt
GARCH
fitting
2. We can compute OLS residuals and fit the residuals to
AR(p) model.
ˆt  Balˆt  Balt
AR(12) was selected.
3. Get the residuals, nˆ t , of AR(12) and calculate the
portmanteau statistics, Q (k ) ,on the squared nˆ t series.
Use the following formulas.
GARCH
fitting
k
Q(k )  n(n  2)
i 1
nˆ   
ˆ i2 (nˆ t2 )
ni
n i
ˆ i
R-code
2
t
,where
2
2
2
2
ˆ
ˆ
ˆ
ˆ
(
n


)(
n


)
t
t i
t 1
2
2 2
ˆ
ˆ
(
n


)
t 1 t
n
n
1
ˆ 2   nˆ t2
n t 1
Q<-function(k){n<-length(nhat)
lohat<-c(rep(0,k))
Q<-c(rep(0,k))
for(i in 1:k){
fir<-(nhat^2-sig.sq)
term<-fir[1:(n-i)]*fir[(1+i):n]
lohat[i]<-sum(term)/sum((nhat^2-sig.sq)^2)}
for(i in 1:k){
Q[i]<-lohat[i]^2/(n-i)}
Qk<-n*(n+2)*sum(Q)
pvalue<-(1-pchisq(Qk,k))
list(term=term,lohat=lohat,Qk=Qk,pvalue=pvalue)}
GARCH
fitting
k
Q (k )
p-value
1
66.77152
3.330669e-16
2
109.5179
0
3
121.1315
0
4
122.6261
0
5
123.5836
0
6
124.9370
0
7
130.0145
0
8
131.3887
0
9
146.4859
0
10
147.6449
0
We know that the significance of the Q (k ) statistic
Occurring only for a small value of k indicates an ARCH
model, and a persistent significance for a large value of k
implies a GARCH model. Since we could see the latter
pattern, I would suggest GARCH modeling.
GARCH
fitting
2. Fit the identified ARMA(2,1) model on the squared
residuals , which has the smallest AIC.
GARCH
fitting
Parameter estimates
nˆt2  0  1nˆt21  2nˆt22  at  1at 1
Coefficient
Value
St.E
ˆ0
8.3439
0.3087
ˆ1
0.7903
0.1731
ˆ 2
0.0464
0.0949
ˆ1
-0.5694
0.1687
ˆ1  ˆ1  ˆ1
1.3597
0.2417
ˆ2  ˆ 2
0.0464
0.1731
GARCH
fitting
So I would suggest the following model.
GARCH(1,2).
Balt  0  1NYCt   t
 t  1 t 1  2 t 2    12 t 12  nt
nt   t et
ˆt2  8.3439 0.5694 t21 1.3597nt21  0.0464nt22