trivariate DCC with VAR(1) MEAN EQUATIONS

Discussions of ARCH, GARCH, and related models
amcqeen
Posts: 17
Joined: Wed Jan 14, 2009 6:42 am

trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by amcqeen »

Hi, i am trying to estimate a trivariate VAR-GARCH(1,1) with DCC. I am using the rats code mgarchdcc2 i got from the estima website. The problem is that i cannot make my mean equations be a VAR(1) instead of an AR(1). I have tried to define each frml separately but when i run it it does not regognize it. Below is the DCC2 code simply modofied to be tri-variate. How or where can i define my mean equation to be a VAR ?

thank you
Maria

The code :*
* Multivariate GARCH with two-step DCC estimator
*
open data chi.xls
data(format=xls,org=columns) / LMR FXR MMR
compute gstart=2,gend=284
compute n=3
dec vect[series] x(n) u(n)
dec vect[frml] resid(n)
set x(1) = lmr
set x(2) = fxr
set x(3) = mmr

compute i=0
*
*
dec vect[series] eps(n)
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 *
*
* Compute 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,robust) / x
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by TomDoan »

I would recommend just using the basic instruction. It's only a 3 variable model, so it should work fine to just do the full system estimates rather than one equation at a time. There's also likely to be a much greater efficiency gain doing the system estimates because you have the more complicated mean model.

Code: Select all

*
* Multivariate GARCH with two-step DCC estimator
*
open data chi.xls
data(format=xls,org=columns) / LMR FXR MMR
*
system(model=var1)
variables lmr fxr mmr
lags 1
det constant
end(system)
*
garch(p=1,q=1,mv=dcc,model=var1,method=bhhh)
xyzh
Posts: 14
Joined: Wed Jun 03, 2009 7:52 am

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by xyzh »

how can i include the asymmetric effect in the codes? Tks:)
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by moderator »

Including asymmetry terms is covered in the manuals. See "GARCH" in the Reference Manual and Chapter 12 in the User's Guide.
amcqeen
Posts: 17
Joined: Wed Jan 14, 2009 6:42 am

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by amcqeen »

Hi, regarding my question previously and the answer [for the VAR(1) - GARCH(1,1) trivariate model]

(i) what are the DCC(1) and DCC(2) that the DCC code gives when it runs ? is it a-hat and b-hat ? if not how do i get a-hat and b-hat ?
(ii) how can i get the Contemporaneous standardized residual correlations ?
(iii) the mv=dcc estimates the diagonal variance/covariance matrix, and only gives C1 C2 C3 A1 A2 A3 B1 B2 B3
How can i get the full matrix for C,A and B, C11 C12 .... C33 A11,A12....A33 etc so i can place my restrictions manualy and make it an upper triangular.
I have estimated this model with BEKK and i want to compare with the DCC but with the same specification


Thank you in advance,

Maria
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by TomDoan »

amcqeen wrote:Hi, regarding my question previously and the answer [for the VAR(1) - GARCH(1,1) trivariate model]

(i) what are the DCC(1) and DCC(2) that the DCC code gives when it runs ? is it a-hat and b-hat ? if not how do i get a-hat and b-hat ?
Yes. They're the estimates of a and b.
amcqeen wrote:(ii) how can i get the Contemporaneous standardized residual correlations ?
That's the same for all MV-GARCH models. Use the HMATRICES option (say HMATRICES=HH) and do

SET RHO12 = HH(T)(1,2)/SQRT(HH(T)(1,1)*HH(T)(2,2))

for the 1,2 correlation; similar for all others. See example 12.2.
amcqeen wrote:(iii) the mv=dcc estimates the diagonal variance/covariance matrix, and only gives C1 C2 C3 A1 A2 A3 B1 B2 B3
How can i get the full matrix for C,A and B, C11 C12 .... C33 A11,A12....A33 etc so i can place my restrictions manualy and make it an upper triangular.
I have estimated this model with BEKK and i want to compare with the DCC but with the same specification
BEKK and DCC don't nest, so I'm not sure what you want.
amcqeen wrote:Thank you in advance,

Maria
xyzh
Posts: 14
Joined: Wed Jun 03, 2009 7:52 am

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by xyzh »

thanks a lot:)
xyzh
Posts: 14
Joined: Wed Jun 03, 2009 7:52 am

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by xyzh »

[quote="amcqeen"]Hi, i am trying to estimate a trivariate VAR-GARCH(1,1) with DCC. I am using the rats code mgarchdcc2 i got from the estima website. The problem is that i cannot make my mean equations be a VAR(1) instead of an AR(1). I have tried to define each frml separately but when i run it it does not regognize it. Below is the DCC2 code simply modofied to be tri-variate. How or where can i define my mean equation to be a VAR ?
[ quote]

how do u specify the VAR-GARCH(1,1) model ?
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by moderator »

xyzh wrote:how do u specify the VAR-GARCH(1,1) model ?
See post 2 of this thread.

Regards,
Tom Maycock
Estima
xyzh
Posts: 14
Joined: Wed Jun 03, 2009 7:52 am

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by xyzh »

thanks a lot:)
amcqeen
Posts: 17
Joined: Wed Jan 14, 2009 6:42 am

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by amcqeen »

Hi, regarding my previous question a couple of days i go i would like to ask if it is possible to have the DCC model for a trivariate case where the dynamic variance-covariate matrix will not be diagonal, such that for instance the first volatility equation would be a function of its own lags and cross correlations but also of the volatilities and cross-correlations of the other 2 variables? The same would be true for the other 2 volatility equations but you would be able to add restrictions on the parameters.

No more interseted in comparing BEKK and DCC since you are right, they are not nested. I just want to estimate the DCC but the C, A, and B not be diagonal if this is possible and be an upper triangular

Thank you in advance
Maria
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by TomDoan »

The VARIANCES=VARMA option with DCC generalizes the standard DCC to allow interaction terms in the variances. See page 430 of the User's Guide.
amcqeen
Posts: 17
Joined: Wed Jan 14, 2009 6:42 am

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by amcqeen »

Thank you!

Maria
xyzh
Posts: 14
Joined: Wed Jun 03, 2009 7:52 am

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by xyzh »

TomDoan wrote:The VARIANCES=VARMA option with DCC generalizes the standard DCC to allow interaction terms in the variances. See page 430 of the User's Guide.
This really helps a lot for my dissertation.
I have another question: In some papers, the coefficients of own lags and cross-correlation volatilies and shocks are presented directly rather than the matric, and the standard deviation, probability are also reported.
How can this be done?
By the way, is there any option to contain the threshold effect, i check the users' guide but found nothing?

Thanks in advance.
Zhang
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: trivariate DCC with VAR(1) MEAN EQUATIONS

Unread post by TomDoan »

xyzh wrote:I have another question: In some papers, the coefficients of own lags and cross-correlation volatilies and shocks are presented directly rather than the matric, and the standard deviation, probability are also reported.
How can this be done?
I have no idea what you mean. If you do VARIANCES=VARMA, you get coefficients on the own and cross volatilities as part of the estimation output.
Post Reply