Log-likelihood function of SVAR models

Questions and discussions on Vector Autoregressions
condor
Posts: 18
Joined: Fri Apr 10, 2009 4:11 pm

Log-likelihood function of SVAR models

Unread post by condor »

Hi,

I ran the cvmodel.prg and would like to compute the likelihood value myself. In the output, the results for "amodel" indicate that the log likelihood value is estimated as -281.0251
I tried the following formula (from the users guide), but it gives me a quite different answer. Am I missing something or doing something wrong? I would be glad, if anyone could help me...

Code: Select all

dec rect bmat
compute bmat  = ||$
1,0,0,0,0,0|$
0,1,0,0,0,0|$
0,0,1,0,0,0|$
0,0,0,1,0,0|$
0,0,0,0,1,0|$
0,0,0,0,0,1||

compute llog = -%nobs/2*(2*(%log(%det(afrml(t)))-%log(%det(bmat)))-(%trace(%log(inv(bmat)*afrml(t)*%sigma*tr(afrml(t))*inv(tr(bmat))))))
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Log-likelihood function of SVAR models

Unread post by TomDoan »

%nobs/2 (written that way) won't be the correct value if %nobs is odd because it's an integer divide. Use .5*%nobs instead. You don't have the integrating constants in your formula. It looks as if we were missing the adjustment for the concentrating term ourselves. This was left out of both log likelihoods so it doesn't affect any of the tests, and doesn't affect the estimates, since it's a constant. The following will give you the value shown in the CVMODEL output if AFACTOR is the factor matrix created by the instruction:

disp %logdensitycv(afactor*tr(afactor),%sigma,%nobs)+.5*6*%nobs

and the correct log likelihood is either

disp %logdensitycv(afactor*tr(afactor),%sigma,%nobs)

or

disp %logl-.5*6*%nobs
Post Reply