Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Constraints in the MLE and delta method


From   Beatrice Crozza <[email protected]>
To   statalist <[email protected]>
Subject   st: Constraints in the MLE and delta method
Date   Sun, 26 Jun 2011 18:40:52 +0100

Dear All,

thanks to Maarten now I know how to insert a constraint in a MLE.

However, if I use the delta method for my parameters, I don't know how to do.

This is the MLE:

program define myprog

args lnf a d m e g p

tempvar ma md mm  me mg mp am dm omm em

quietly gen double `am'=exp(`a')/(1+exp(`a'))
quietly gen double `dm'=exp(`d')/(1+exp(`d'))
quietly gen double `omm'=exp(`m')
quietly gen double `em'=exp(`e')
quietly gen double `ma'=1-`am'
quietly gen double `md'=1-`dm'
quietly gen double `mm'=1-`omm'
quietly gen double `me'=1-`em'
quietly gen double `mg'=1-`g'
quietly gen double `mp'=1-`p'

quietly replace
`lnf'=ln((`am')*(`dm')*((((`mm')+(`omm')*(`em')*(`g'))^x1)*(((`omm')+(`mm')*(`em')*(`p'))^x2)*(((`mm')*(`em')*(`me'))^x3)*(((`mmo')*(`em')*(`mg'))^x4)*(((`mm')*(`mp'))^x5)*(((`mmo')*(`eo'))^x6)))

end

ml model lf myprog (a:) (d:) (m:) (e:) (g:) (p:),  technique(bfgs)
constraint(1-2)

ml check
ml search
ml maximize, difficult

nlcom (a: exp([am]_b[_cons])/(1+exp([am]_b[_cons])))
nlcom (d: exp([dm]_b[_cons])/(1+exp([dm]_b[_cons])))




If I do:
constraint 1 [a]_cons=[d]_cons is not correct because these are not
the correct values coming from the delta method.

Could you please help me?

Thanks,
Bea
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index