Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: gradient matrix for ml model lf


From   "Rodrigo A. Alfaro" <ralfaro76@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: gradient matrix for ml model lf
Date   Wed, 26 Apr 2006 10:40:24 -0400

Carlos,

Pretend that you have a file (myprobit.do) with this info:

program define myprobit
        args lnf theta
        qui replace `lnf'=ln(norm(`theta')) if $ML_y1==1
        qui replace `lnf'=ln(norm(-`theta')) if $ML_y1==0
end

This example is in the reference manual. Gould's book is an extended version 
of -ml- command and excelent reference to work with MLE in Stata. The 
following command will show you how this works using the internal dataset 
auto.

* load the do-file
do myprobit
* open dataset
sysuse auto
* load the model
ml model lf myprobit ( foreign= price mpg)
* maximize showing grad and hessian
ml maximize, gradient hessian
* check the results
probit foreign price mpg

If you are not getting the results you can 'break' the maximization 
procedure and type -ml query- or -ml report-. Anyway is good to check the 
model -ml check- before to start the maximization.

Best, Rodrigo.




----- Original Message ----- 
From: <csepulve@bu.edu>
To: <statalist@hsphsun2.harvard.edu>
Sent: Wednesday, April 26, 2006 8:34 AM
Subject: st: gradient matrix for ml model lf


Does somebody know how to recover the approx gradient and hessian matrices 
stata
calculates when ml model lf is used?

Thank you,

CARLOS 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index