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.
mjchang68
Posts: 3
Joined: Sun Jan 20, 2008 7:21 am

Log Likelihood Ratio test with 'MAXIMIZE' ?

Unread post by mjchang68 »

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
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Unread post by moderator »

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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Unread post by TomDoan »

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
Post Reply