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: Reversed coefficient sign for exponential MLE vs. ereg
From
Gordon Burtch <[email protected]>
To
[email protected]
Subject
st: Reversed coefficient sign for exponential MLE vs. ereg
Date
Fri, 27 Jan 2012 18:13:40 -0500
Hello,
I am trying to implement the ereg (exponential regression) estimator using ML, and am encountering something odd. I have written a .do file as follows...
program define myexponential
version 10.0
args lnf x
local lambda = exp(`x')
quietly replace `lnf' = ln(`lambda') - `lambda'*$ML_y1
end
Maximizing a constant only model with this likelihood function produces a coefficient estimate that matches with that obtained using the ereg command. However, the sign on the coefficient is reversed for some reason. I noticed as well that the log-likelihood is much different (-765.96 versus -1607.53). Does anyone have an idea as to what might be causing this? If I invert `x' when defining lambda (i.e., lambda = exp(-`x')), then the correct coefficient is obtained (though the difference in LL between ereg and my implementation is still quite different).
Any help is appreciated! Regards,
Gord Burtch
*
* 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/