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]

Re: st: MLE Non-linear Program


From   Jorge Eduardo Pérez Pérez <perez.jorge@ur.edu.co>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: MLE Non-linear Program
Date   Fri, 19 Nov 2010 17:18:06 -0500

Have you tried -ml search- to look for better initial values?
_______________________
Jorge Eduardo Pérez Pérez



On Fri, Nov 19, 2010 at 2:03 PM, Steven Archambault
<archstevej@gmail.com> wrote:
>
> Hi all,
> I am running this MLE nonlinear program below. It has trouble
> converging , I guess because of the complexity of having to estimate
> kappa and gamma. Does anybody have any suggestions for improving the
> code, while still getting estimates for gamma and kappa?
> It works fine for estimating kappa only and gamma only. Thanks!
>
> capture program drop simplemle
> program simplemle
> args lnL a0 a1 a2 eta b1 b2 kappa gamma
> tempvar xb sigma lambda lambda2
> quietly gen double `lambda'=exp(`kappa')/(1+exp(`kappa'))
> quietly gen double `lambda2'=exp(`gamma')/(1+exp(`gamma'))
> quietly gen double `xb'=`a0'+ `a1'*lnwaterdist +`a2'*totindexa  ///
> + `b1'*(forestsaa+`lambda'*forest_vdc5a)+ `b2'*(ldistkillnov+`gamma'*ltotkill)
>
> quietly gen double `sigma'=exp(`eta')
> quietly replace
> `lnL'=-.5*ln(2*_pi)-.5*ln((`sigma')^2)-.5*(foodindx10-`xb')^2/(`sigma')^2
> end
> ml model lf simplemle (a0:) (a1:) (a2:) (eta:) (b1:) (kappa:) (b2:) (gamma:)
> ml init  1 1 .1 .1 .1 1 1 1 , copy
> ml maximize
>
> I get messages like: (Iteration 70:  log likelihood = -3354.8283  (not concave)
> numerical derivatives are approximate
>
> *
> *   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/

*
*   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