seasonal arma forecasting and fitting the bivariate data to garch john doe
TRANSCRIPT
Seasonal ARMA forecasting Seasonal ARMA forecasting and and
Fitting the bivariate data to Fitting the bivariate data to GARCHGARCH
John DOEJohn DOE
OutlineOutlinePart 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. 2. Fitting the data Fitting the data to Seasonal ARIMA modelto Seasonal ARIMA model
SARIMAfitting
Since the number of cases are strictly positive
and non stationary in the variance, the log was taken
SARIMAfitting
Then the number of cases was seasonally
and lag 1 differenced
SARIMAfitting
SARIMAfitting
For Baltimore For New York City
Model 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, was selected,
12)0,1,5()28,1,0(
ti
iit
i
ii
i
ii aBBALBBBB
28241212 1)ln(11)1)(1(
12)0,1,4()28,1,2(
For New York City, was selected,
ti
iit
i
ii aBNYCBBB
2851212 1)ln(1)1)(1(
Parameter estimates for BaltimoreSARIMAfitting
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
Parameter estimates for New York CitySARIMAfitting
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
The diagnostic plots of the fitted model SARIMAfitting
PredictionsData and predictions for Baltimore
PredictionsData and predictions for New York City
2. Fitting the bivariate data 2. Fitting the bivariate data to GARCH modelto GARCH model
GARCHfitting
GARCHfitting
1. We consider the OLS estimation for the model
ttt NYCBal 10
• Baltimore and New York City are geographically
close to each other.
• Measles is the infectious diseases
tt NYClBa 06941.04826.174ˆ
GARCHfitting
2. We can compute OLS residuals and fit the residuals to AR(p) model.
ttt BallBa ˆ̂ AR(12) was selected.
GARCHfitting
3. Get the residuals, , of AR(12) and calculate the portmanteau statistics, ,on the squared series. Use the following
formulas.
tn̂)(kQ tn̂
k
i
ti
in
nnnkQ
1
22 )ˆ(ˆ)2()(
n
t t
it
in
t t
tin
nnn
1
222
22
1
22
2
)ˆˆ(
)ˆˆ)(ˆˆ(ˆˆ
n
ttnn 1
22 ˆ1̂
,where
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)}
R-code
GARCHfitting
We know that the significance of the 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.
)(kQk 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
)(kQ
GARCHfitting
2. Fit the identified ARMA(2,1) model on the squared residuals , which has the smallest
AIC.
Parameter estimatesGARCHfitting
11222
2110
2 ˆˆˆ ttttt aannn
Coefficient Value St.E
8.3439 0.3087
0.7903 0.1731
0.0464 0.0949
-0.5694 0.1687
1.3597 0.2417
0.0464 0.1731
0̂
1̂
2̂
111ˆˆˆ
22 ˆˆ
1̂
GARCHfitting
So I would suggest the following model.
GARCH(1,2).
ttt NYCBal 10
ttt en
22
21
21
2 0464.03597.15694.03439.8ˆ tttt nn
ttttt n 12122211