Log Likelihood Ratio test with 'MAXIMIZE' ?

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.

Log Likelihood Ratio test with 'MAXIMIZE' ?

Postby mjchang68 » Tue Jan 29, 2008 8:21 pm

I like to do a log likelihood ratio test in my study, but my nonlinear form was done by 'MAXIMIZE', i.e. a general form of GARCH. I have already tried many alternative methods via Rats users manual and contacted support of Estima, but my problems remain as well. Please let me know if you have a simple example for it.

Thank you
mjchang68
 
Posts: 3
Joined: Sun Jan 20, 2008 8:21 am

Postby moderator » Fri Feb 01, 2008 3:11 pm

Rather than trying to do the test using RSS statistics or computed residuals, which is what I recall you were trying to do, you can do the LR test by simply comparing the estimated function values of the nested models.

If you have Version 6 or older, the function value should be saved in the variable %FUNCVAL.
moderator
Site Admin
 
Posts: 306
Joined: Thu Oct 19, 2006 4:33 pm

Postby TomDoan » Fri Feb 01, 2008 3:20 pm

This is grnp490.prg from the Greene textbook examples. In order to do the LR test using MAXIMIZE, you need to

(a) be able to estimate both the restricted and unrestricted models
(b) have the maximize function compute either the actual log likelihood (including all constants) or at least compute that up to a common additive constant.

Then 2 x the difference between the %funcval's is the test statistic.


Code: Select all
*
* Example of testing procedures on page 490
* ?? Restricted estimate is off (doesn't match one from earlier in chapter)
* ?? VB on p 491 is computed at the unrestricted model; the calculation on
* 492 uses the correct VB at the restricted estimates
*
open data tablefd-1[1].txt
data(format=prn,org=columns) 1 20 id y e
*
nonlin b r
compute b=0,r=1
*
frml logl = bi=1/(b+e),r*log(bi)-%lngamma(r)+(r-1)*log(y)-y*bi
*
maximize(method=bfgs) logl
test(title="Wald Test for rho=1")
# 2
# 1.0
compute funcunr=%funcval
*
nonlin b r=1
maximize(method=bfgs) logl
compute funcres=%funcval
cdf(title="Likelihood Ratio Test") chisqr -2*(funcres-funcunr) 1
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm


Return to Help With Programming

Who is online

Users browsing this forum: No registered users and 1 guest