Didn't notice before, but any circumlocution, periphrasis or
going-around-the mulberry bush is not the major issue. If this
is a log likelihood, then recall that when you take logarithms
multiplications map to additions and the divisions to subtractions....
Nick
[email protected]
Joseph Coveney
> A fellow list member has chided me off-list for (yet again) posting
> circumlocutory code. In the -mlreg- program posted yesterday in this
> thread, please replace the following block of code
>
> tempvar residual
> quietly {
> generate double `residual' = $ML_y1 -`Bx'
> replace `lnf' = -0.5 * ln(2*_pi) - ///
> ln(`sigma') -0.5 * `residual'^2 / `sigma'^2
> }
>
> with the following single line
>
> quietly replace `lnf' = ln(normalden($ML_y1, `Bx', `sigma'))
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/