Statalist


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

st: Maximum likelihood simulation


From   "Katia Bobulova" <[email protected]>
To   [email protected]
Subject   st: Maximum likelihood simulation
Date   Fri, 5 Dec 2008 12:41:55 +0000

Dear All,

I am still trying to perform my maximum likelihood. The point is that
I receive this error message:"could not calculate numerical
derivatives discontinuous region with missing values encountered". I
don't have any value that is equal to zero in my data. So maybe this
is a problem of inconsistency,there could be some values that go to
zero or infinity.

At this point I would like to simulate my maximum likelihood in order
to have initial feasible values.

Following my program for the maximum likelihood:

program define myprogr
version 10.0
args lnf a d b mo mq eo eq n g

tempvar ma md mb mmo mmq meo meq mn mg

quietly gen double `ma'=1-`a'
quietly gen double `md'=1-`d'
quietly gen double `mb'=1-`b'
quietly gen double `mmo'=1-`mo'
quietly gen double `mmq'=1-`mq'
quietly gen double `meo'=1-`eo'
quietly gen double `meq'=1-`eq'
quietly gen double `mn'=1-`n'
quietly gen double `mg'=1-`g'

quietly replace
`lnf'=ln((`a')*(`d')*((((`b')*(`mq')*(`g')+(`b')*(`mmq')*(`eq')*(`n'))^bq)*(((`mb')*(`mo')*(`g')+(`mb')*(`mmo')*(`eo')*(`n'))^bo)*(((`b')*(`mmq')*(`eq')*(`mn'))^sq)*(((`mb')*(`mmo')*(`eo')*(`mn'))^so)*(((`b')*(`mmq')*(`meq')+(`mb')*(`mmo')*(`meo'))^nt))+(`a')*(`md')*((((`b')*(`mmq')*(`eq')*(`n'))^bq)*(((`mb')*(`mmo')*(`eo')*(`n'))^bo)*(((`b')*(`mq')*(`mg')+(`b')*(`mmq')*(`eq')*(`mn'))^sq)*(((`mb')*(`mo')*(`mg')+(`mb')*(`mmo')*(`eo')*(`mn'))^so)*(((`b')*(`mmq')*(`meq')+(`mb')*(`mmo')*(`meo'))^nt))+(`ma')*((((`b')*(`eq')*(`n'))^bq)*(((`mb')*(`eo')*(`n'))^bo)*(((`b')*(`eq')*(`mn'))^sq)*(((`mb')*(`eo')*(`mn'))^so)*(((`b')*(`meq')+(`mb')*(`meo'))^nt))+2.71^(-745))

end


ml model lf myprogr (a:) (d:) (b:)(mo:)(mq:)(eo:)(eq:)(n:)(g:)
ml search
ml maximize, difficult


I would like to have simulated values for a,d,b,mo,mq,eo,eq,n,g

After end would should I write?
simulate....

Could you please help me? I am encountering many difficulties that i
don't know how to overcome.

Thanks a lot

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