Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: simulated maximum likelihood estimation


From   "Jun Xu" <[email protected]>
To   [email protected]
Subject   st: simulated maximum likelihood estimation
Date   Sun, 08 May 2005 18:17:58 -0500

I am not sure if some expert could give me some hint about where to go. Here I am trying to estimate a logit with an added expotential distributed random error (with mean of 5). I am using simualted mle with 100 replications, but cannot get it converged. Not sure if I had a correct setup.


set trace off
set more off
cap program drop my_ll
program my_ll
version 8.2
args lnf xb
tempname b
sca `b' = 5

forval j = 1/100 {
tempname ed`j'
}

qui replace `lnf' = 0
forval i = 1/100 {
qui gen double `ed`i'' = -ln(uniform())*`b'
qui replace `lnf'= `lnf' + invlogit( `xb'+`ed`i'') if $ML_y1 == 1
qui replace `lnf'= `lnf' + invlogit(-(`xb'+`ed`i'')) if $ML_y1 == 0
}

qui replace `lnf' = ln(`lnf')
end

use binlfp2.dta, clear
ml model lf my_ll (lfp = k5 k618 age), technique(nr bhhh dfp bfgs)
ml maximize


initial: log likelihood = 2948.488
alternative: log likelihood = 2952.4599
rescale: log likelihood = 2952.4599
(setting optimization to Newton-Raphson)
numerical derivatives are approximate
flat or discontinuous region encountered
Iteration 0: log likelihood = 2949.0411 (not concave)
numerical derivatives are approximate
flat or discontinuous region encountered
Iteration 1: log likelihood = 2950.7797 (not concave)
numerical derivatives are approximate
flat or discontinuous region encountered
no observations
r(2000);



Jun Xu
Ph.D. Candidate
Department of Sociology
Indiana University at Bloomington
http://mypage.iu.edu/~junxu/home

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar � get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index