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   Steven Archambault <[email protected]>
To   [email protected]
Subject   Re: st: MLE Non-linear Program
Date   Wed, 24 Nov 2010 17:10:44 -0700

Thanks for your suggestions.

1) The reason why I am not doing a linear program with regress is
because of the multicolinearity impact of the variables (forestsaa and
forest_vdc5a) and (distkill and totkill). We are testing a declining
relationship on the dependent variable, so this program suits us well.

2) Yes, I mistyped, that gamma*ltotkill should be lambda2*ltotkill

5) I did a little search on lnnormalden, and I am not sure how I would
implement this. Could you elaborate a little bit?

6) yes, good point on sigma being positive. I believe it always will
be given my estimation of eta, where sigma=exp(eta). No matter the
value of eta, sigma is positive.

Thanks!

-Steve

On Fri, Nov 19, 2010 at 7:31 PM, Partha Deb <[email protected]> wrote:
> Steven,
>
> I have a number of thoughts.
>
> 1. I'm not sure why you need to estimate your model using ML.  A simple
> transformation of your model parameters renders the model linear in
> parameters, i.e., you can write
>
> `xb'=`a0'+ `a1'*lnwaterdist +`a2'*totindexa  ///
> + `b1'*(forestsaa+`lambda'*forest_vdc5a)+
> `b2'*(ldistkillnov+`gamma'*ltotkill)
>
> can easily be written as
>
> `xb'=`a0'+ `a1'*lnwaterdist +`a2'*totindexa  ///
> + `b11'*forestsaa + `b12'*forest_vdc5a + `b21'*ldistkillnov + `b22'*ltotkill
>
> and this can be estimated using -regress- .  Following regress, you can use
> -nlcom- to recover b1, lambda, b2 and gamma.
>
> 2. It does seem a bit odd that lambda is a logit type transformation of
> kappa, but after creating lambda2 as a logit transformation of gamma, it
> does not enter the specification.
>
> 3. An argument against what I have suggested is that your specification
> constrains lambda and lambda2 to be in (0,1) while OLS will not respect
> that.  Perhaps this is an important constraint, but if it is true, OLS
> should recover that.  Else, it might be evidence that your model is
> misspecified.
>
> 5. Why not use -lnnormalden- to specify the normal density?  You would be
> sure then, that there are no coding errors there.
>
> 6. sigma should be constrained to be positive.  The Stata-ish solution is to
> think of lnsigma as the parameter and specify sigma = exp(lnsigma).
>
> Hope this helps.
>
> Partha
>
>
>
> On 11/19/2010 2:03 PM, Steven Archambault 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/
>
> --
> Partha Deb
> Professor of Economics
> Director of Graduate Studies
> Hunter College
> ph:  (212) 772-5435
> fax: (212) 772-5398
> http://urban.hunter.cuny.edu/~deb/
>
> Emancipate yourselves from mental slavery
> None but ourselves can free our minds.
>        - Bob Marley
>
> *
> *   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