Page 1 of 1

Help! Bivariate GARCH-BEKK estimation

Posted: Tue Jul 21, 2009 6:18 pm
by Cassie
I need to estimate covariance between several groups of data which is the monthly price index of stocks.

The model I use is the BEKK version of simple bivariate GARCH(1,1) model. But there is a error warning says “attempt to raise a negative number to a non integer power in "OMEGA(3)=EQ.C(2)^5"”when I try to run the code on series “aa & bb” and “aa &cc”.
However the code does work for series “aa and dd”. I have no idea what’s wrong with the code and how should I modify it.
This result is very important for my dissertation could anybody please take look at the code or give me some suggestions about how to estimate the conditional covariance using another method?
The code and data are attached.
Thank you very much.

Re: Help! Bivariate GARCH-BEKK estimation

Posted: Tue Jul 21, 2009 11:49 pm
by trubador
It seems you are having an initialization problem. Just initialize the parameter vectors of omega, alpha and beta differently. In multivariate estimation, results of univariate counterpart of the model are good candidates for supplying feasible initial values. However, as you have experienced in your case, it may not always be the best way. Try, for instance, assigning 0.5 to each parameter value.

Re: Help! Bivariate GARCH-BEKK estimation

Posted: Wed Jul 22, 2009 4:59 am
by Cassie
Dear Trubador,
I have modified the code according to you as below, although the code seems work well and the covariance estimated seems reasonable I’m not sure whether I have done it right can you please take a look?
And you've been a big help……I’m a very beginner of EViews and have been trying working on the problem for a very long time but can’t solve it. I really appreciate you help, thank you very much.

Code: Select all

'change path to program path %path = @runpath cd %path ' load workfile load data.wf1 ' dependent variables of both series must be continues smpl @all series y1 = dlog(aa) series y2 = dlog(bb) ' set sample ' first observation of s1 need to be one or two periods after ' the first observation of s0 sample s0 01/01/1990 11/01/2008 sample s1 03/01/1990 11/01/2008 ' initialization of parameters and starting values ' change below only to change the specification of model smpl s0 'get starting values from univariate GARCH equation eq1.arch(m=100,c=1e-5) y1 c equation eq2.arch(m=100,c=1e-5) y2 c ' declare coef vectors to use in bi-variate GARCH model ' see above for details coef(2) mu mu(1) = eq1.c(1) mu(2)= eq2.c(1) coef(3) omega omega(1)=0.5 omega(2)=0 omega(3)=0.5 coef(2) alpha alpha(1) = 0.5 alpha(2) = 0.5 coef(2) beta beta(1)= 0.5 beta(2)= 0.5 ' constant adjustment for log likelihood !mlog2pi = 2*log(2*@acos(-1)) ' use var-cov of sample in "s1" as starting value of variance-covariance matrix series cov_y1y2 = @cov(y1-mu(1), y2-mu(2)) series var_y1 = @var(y1) series var_y2 = @var(y2) series sqres1 = (y1-mu(1))^2 series sqres2 = (y2-mu(2))^2 series res1res2 = (y1-mu(1))*(y2-mu(2)) ' ........................................................... ' LOG LIKELIHOOD ' set up the likelihood ' 1) open a new blank likelihood object (L.O.) name bvgarch ' 2) specify the log likelihood model by append ' ........................................................... logl bvgarch bvgarch.append @logl logl bvgarch.append sqres1 = (y1-mu(1))^2 bvgarch.append sqres2 = (y2-mu(2))^2 bvgarch.append res1res2 = (y1-mu(1))*(y2-mu(2)) ' calculate the variance and covariance series bvgarch.append var_y1 = omega(1)^2 + beta(1)^2*var_y1(-1) + alpha(1)^2*sqres1(-1) bvgarch.append var_y2 = omega(3)^2+omega(2)^2 + beta(2)^2*var_y2(-1) + alpha(2)^2*sqres2(-1) bvgarch.append cov_y1y2 = omega(1)*omega(2) + beta(2)*beta(1)*cov_y1y2(-1) + alpha(2)*alpha(1)*res1res2(-1) ' determinant of the variance-covariance matrix bvgarch.append deth = var_y1*var_y2 - cov_y1y2^2 ' inverse elements of the variance-covariance matrix bvgarch.append invh1 = var_y2/deth bvgarch.append invh3 = var_y1/deth bvgarch.append invh2 = -cov_y1y2/deth ' log-likelihood series bvgarch.append logl =-0.5*(!mlog2pi + (invh1*sqres1+2*invh2*res1res2+invh3*sqres2) + log(deth)) ' remove some of the intermediary series ' bvgarch.append @temp invh1 invh2 invh3 sqres1 sqres2 res1res2 deth ' estimate the model smpl s1 bvgarch.ml(showopts, m=100, c=1e-5) ' change below to display different output show bvgarch.output graph varcov.line var_y1 var_y2 cov_y1y2 show varcov ' LR statistic for univariate versus bivariate model scalar lr = -2*( eq1.@logl + eq2.@logl - bvgarch.@logl ) scalar lr_pval = 1 - @cchisq(lr,1)

Re: Help! Bivariate GARCH-BEKK estimation

Posted: Wed Jul 22, 2009 6:22 am
by trubador
The code seems fine. This post might also be helpful.

Re: Help! Bivariate GARCH-BEKK estimation

Posted: Wed Jul 22, 2009 11:59 am
by Cassie
The code seems fine. This post might also be helpful.
:D once again, thank you!

Re: Help! Bivariate GARCH-BEKK estimation

Posted: Mon Jul 27, 2009 6:14 am
by espana09
Hello everyone,

I am also facing a problem with Garch Bekk est. ; I have estimated parameters of (also bivariate) BEKK model, but as I have noticed matrices with alpha and beta parameters are diagonal and therefore I can estimate only if the there is some volatility spillover but I can not indentify the source of volatility and how "significant" the spillover between two series is ...
I would really appreciate if someone could help me with indentification of off-diagonal parameters (of unrestricted model), which would enable me to indentify the direction of spillover.

Thank you very much for your help

E.

Re: Help! Bivariate GARCH-BEKK estimation

Posted: Mon Jul 27, 2009 7:42 am
by trubador
You may need to build a logl object. Searching the forum might be helpful in that respect.

Re: Help! Bivariate GARCH-BEKK estimation

Posted: Thu Aug 06, 2009 3:07 pm
by Jessie
Hi there

I am using an ECM-MGARCH model to analyse volatility spillovers in my dissertation. I run into a problem as I don't know how to do the BEKK specification in EViews. All I can see in the estimation options is the diagonal BEKK. I think my problem is the same as espana09's although I am doing a trivariate one. Does anyone has any idea to do this? Please hep!!!

Thank you very much,

Jessie

Re: Help! Bivariate GARCH-BEKK estimation

Posted: Thu Jun 03, 2010 8:14 am
by flash
Hi there,

On a relevant but probably trivial issue, when estimating a series of bivariate BEKK models (including an asymmetry effect) with a rolling window of approximately 450 data points every time, I get a message saying "not enough observations to run Garch". I get the same even when I lower the convergence criteria. The result is that for a big chunk of the output I get is NA.

Any views of why this happens and solutions?

Thanks