How to compute DCC-GARCH mean quation for AR(5,1)
Posted: Tue Nov 05, 2013 11:51 am
hi,
I'm Using rats code for two step estimation DCC-GARCH. how and where should i to compute a mean equation r_t=μ+γ_1 r_(t-1)+γ_2 r_(t-1)^us+ε_t
let say if i want to see the DCC-GARCH for US VS ASEAN country.. below are code.
Thank you so much.
I'm Using rats code for two step estimation DCC-GARCH. how and where should i to compute a mean equation r_t=μ+γ_1 r_(t-1)+γ_2 r_(t-1)^us+ε_t
let say if i want to see the DCC-GARCH for US VS ASEAN country.. below are code.
Code: Select all
*
OPEN DATA "C:\Users\user\Desktop\msci rats.xls"
CALENDAR(D) 1993:1:1
DATA(FORMAT=XLS,ORG=COLUMNS,SHEET="pre",LEFT=2) 1993:01:01 1996:12:31 USXUS USXMalaysia USXPhilipines USXSingapore $
USXThailand USXIndonesia
*
* Convert exchange rates to returns, and place into the VECT[SERIES] X
* that will be used as the dependent variables in the GARCH model.
*
compute n=6
dec vect[series] x(n)
compute i=0
dofor [string] s = "US" "Malaysia" "Philipines" "Singapore" "Thailand" "Indonesia"
compute xrate="usx"+s,i=i+1
set x(i) = 100.0*log(%s(xrate)/%s(xrate){1})
end dofor
*
*
dec vect[series] eps(n)
*
* FULLBETA will be the coefficient vector for the full model. This
* includes 4 univariate GARCH coefficients for each of the dependent
* variables, plus the 2 DCC coefficients.
*
dec vect fullbeta(4*n+2)
*
* Do univariate GARCH models. Save the standardized residuals into
* eps(i). Copy the coefficients into the proper slots in the full beta
* matrix.
*
do i=1,n
garch(p=1,q=1,resids=r,hseries=h) / x(i)
set eps(i) = r/sqrt(h)
do j=1,4
compute fullbeta(n*(j-1)+i)=%beta(j)
end do j
end do i
*
* Compute the covariance matrix of the standardized residuals
*
vcv(matrix=rr)
# eps
*
* Create the series[symm] uu (outer product of residuals). Make it the
* unconditional value prior to the sample.
*
dec series[symm] uu q
gset uu %regstart() %regend() = %outerxx(%xt(eps,t))
gset uu 1 %regstart()-1 = rr
gset q = rr
*
* Log likelihood for the DCC phase, taking the residuals as given
*
nonlin a b
dec frml[symm] qf
frml qf = (qx=(1-a-b)*rr+a*uu{1}+b*q{1})
frml logl = q=qf,%logdensity(%cvtocorr(q),%xt(eps,t))
compute b=.80,a=.10
maximize logl 2 *
*
* Insert the estimates into the final two slots in fullbeta
*
compute fullbeta(4*n+1)=%beta(1),fullbeta(4*n+2)=%beta(2)
*
* Do one iteration of the full model with METHOD=BHHH to get
* the grand covariance matrix.
*
garch(p=1,q=1,mv=dcc,method=bhhh,initial=fullbeta,iters=1) / x