MGARCH estimation

Discussions of ARCH, GARCH, and related models

MGARCH estimation

Postby John_Val » Sun Apr 18, 2010 8:42 am

I am trying to estimate a MGARCH(1,1) model but the variance-covariance matrix is coming up as non invertible. How can I correct this?


lin(noprint) baa / resids1
# constant
com AO = %beta(1)
com a11 = %seesq
lin(noprint) tbill3 / resids2
# constant
com BO = %beta(1)
com b11 = %seesq
com c11 = (a11*b11)**2

set R1 = resids1
set R2 = resids2

vcv(noprint,mat=cov)
# R1 R2

set U11 = cov(1,1)
set U22 = cov(2,2)
set U12 = cov(1,2)

nonlin AO BO a11 a12 a21 b11 b12 b21 c11 c12 c21

frml H11 = a11 + a12*U11{1} + a21*R1{1}
frml H22 = b11 + b12*U22{1} + b21*R2{1}
frml H12 = c11 + c12*U12{1} + c21*(R1{1}*R2{1})
frml res1 = baa-Ao
frml res2 = tbill3-Bo
com a12 = 0.05 , a21=0.7 , b12=0.05 , b21=0.7 , c12=0.05 , c21 = 0.7

dec symm covm
dec vec Res

frml LogL = (u11(t)=h11(t)),(u22(t)=h22(t)),(u12(t)=h12(t)),(R1(t)=res1(t)),(R2(t)=res2(t)),$
(covm=||u11(t)|u12(t),u22(t)||),$
(Res=||R1(t),R2(t)||),$
-.5*Log(%det(covm))-.5*%qform(inv(covm),Res)

max(method=simplex,iter=100,noprint) LogL 1970:12 2008:12

## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC.
John_Val
 
Posts: 25
Joined: Sun May 17, 2009 2:18 pm

Re: MGARCH estimation

Postby TomDoan » Sun Apr 18, 2010 9:48 am

Shouldn't you be squaring the lagged residuals in the lines:

Code: Select all
frml H11 = a11 + a12*U11{1} + a21*R1{1}
frml H22 = b11 + b12*U22{1} + b21*R2{1}


Also, unless I'm missing something, you could replace the whole thing with

Code: Select all
garch(p=1,q=1) / baa tbill3


There's nothing special about your model which would require doing the MAXIMIZE setup rather than just using GARCH.
TomDoan
 
Posts: 2761
Joined: Wed Nov 01, 2006 5:36 pm

Re: MGARCH estimation

Postby John_Val » Sun Apr 18, 2010 12:00 pm

Hello,
I squared the lagged residuals, but I am still getting the same error message, that covm is not invertible. This is coming up for almost every data point.

I know I can just use the GARCH command, but I am trying to become more familiar and better with rats' coding.
John_Val
 
Posts: 25
Joined: Sun May 17, 2009 2:18 pm

Re: MGARCH estimation

Postby TomDoan » Sun Apr 18, 2010 2:10 pm

Code: Select all
com c11 = (a11*b11)**2


This should be **.5, not **2. You need to be careful about the guess values for your parameters since it clearly isn't even able to compute the likelihood at those.
TomDoan
 
Posts: 2761
Joined: Wed Nov 01, 2006 5:36 pm

Re: MGARCH estimation

Postby John_Val » Sun Apr 18, 2010 3:43 pm

I'm still getting the same error message. I made the correction from above and I changed the parameter values to

com a12 = .9 ; com a21=0.7 ; com b12=.9 ;com b21=0.7 ; com c12=.8 ; com c21 = 0.7,

but nothing changed, covm is still not invertible.

## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC.

comes up about a few hundred times and then it is followed by

## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
John_Val
 
Posts: 25
Joined: Sun May 17, 2009 2:18 pm

Re: MGARCH estimation

Postby TomDoan » Sun Apr 18, 2010 4:41 pm

You need to really think about your guess values for the parameters. In this last try, you have explosive behavior for each of the three terms in the covariance matrix. So first, you'll have to correct that.

Also, since you're having a hard time getting the function to even evaluate at your guess values, the simplest thing to do is to zero out the parameters for the cross term. If the model produces a zero covariance at the guess values, you shouldn't have a problem with a non-invertible matrix. Once you get a set of values at which the function can be evaluated, it can then estimate non-zero values for those parameters, since any set which produces a non-positive definite matrix will be rejected.
TomDoan
 
Posts: 2761
Joined: Wed Nov 01, 2006 5:36 pm

Re: MGARCH estimation

Postby John_Val » Fri Apr 30, 2010 10:25 am

I am using the general command,

garch(p=1,q=1,method=bhhh,mvhseries=HH,iters=500,pmethod=simplex,piters=20,subiter=100,regressors) / dssec dsp

For the two mean equations I am going to leave them as depending only on a constant, but I want the variance and covariance equations to include the regressor TERM.
Does the commend change according to,

garch(p=1,q=1,method=bhhh,mvhseries=HH,iters=500,pmethod=simplex,piters=20,subiter=100,regressors) / dssec dsp
# TERM

Is the above enough to include the regressor TERM in the covariance equations?
John_Val
 
Posts: 25
Joined: Sun May 17, 2009 2:18 pm

Re: MGARCH estimation

Postby TomDoan » Fri Apr 30, 2010 2:47 pm

You want the XREGRESSORS option, which adds regressors to the covariance matrix, not the REGRESSORS option which adds them to the mean equation.
TomDoan
 
Posts: 2761
Joined: Wed Nov 01, 2006 5:36 pm


Return to ARCH and GARCH Models

Who is online

Users browsing this forum: Google [Bot] and 2 guests