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: Using maximum likelihood estimation (ml) for a nonlinear function


From   Emile Locque <[email protected]>
To   Statalist <[email protected]>
Subject   st: Using maximum likelihood estimation (ml) for a nonlinear function
Date   Sat, 12 Mar 2011 07:31:34 +0000 (GMT)

Hello,

I want to use maximum likelihood to estimate a nonlinear equation and I do not 
come close as to how it should be programmed.

My nonlinear equation is the following:
y = [(1+x1*(1-B))/(1+x2*(1-B))]*x3 + e
The parameter I want to estimate is B, which is present in both numerator and 
denominator and should have a value between 0 and 1.
I assume that e (the error term) is normally distributed N(0,sigma^2).
Both variable y and x1 are independent for each observation whereas values of 
x2 
and x3 are the same for groups of observations. (This is why I doubt whether I 
should use the lf method or one of the d methods).
I have been thinking about splitting the equation in multiple equations to be 
estimated, but I fail to see how I can be certain that the estimated B (beta) 
is 
the same for denominator and numerator.

The stata command I have tried is this one:

capture program drop jprog
program define jprog
args lnf sigma beta
replace 
`lnf'=-0.5*(ln(2*_pi)+ln(exp(`sigma')^2)+(y-[(1+(x1*(1-`beta’)))/(1+(x2*(1-`beta’)))]*x3)^2/exp(`sigma')^2)



end
ml model lf jprog (beta: ) (sigma: )
ml check
ml search
ml maximize

It returns estimation results (see below) but, not what I want to see. I do not 
know how I can program that this B (beta) is between 0 and 1.
Nor do I know whether I am using the appropriate program. Any help is certainly 
appreciated.

Iteration 5:  log likelihood =  20861.204  

                                                  Number of obs  =      39094
                                                  Wald chi2(0)    =          .
Log likelihood =  20861.204                      Prob > chi2    =          .

------------------------------------------------------------------------------
            |      Coef.  Std. Err.      z    P>|z|    [95% Conf. Interval]
-------------+----------------------------------------------------------------
delta        |
      _cons |  -1.952555  .0035763  -545.98  0.000    -1.959564  -1.945546
-------------+----------------------------------------------------------------
sigma        |
      _cons |  .2865287  .0238149    12.03  0.000    .2398524    .333205
------------------------------------------------------------------------------


Thanks for your consideration!

E. Locque


      

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