<>
Laszlo asks:
My example: I want to code up the estimation of a truncated lognormal
model. The point of truncation should be a simple scalar my evaluator
uses. But how do I need to define that in my -ml model-, and how can
use it in the evaluator ado?
No need to pass anything, as currently defined scalars are visible to all programs:
program drop _all
program mynormal_lf_scalar
version 11
args lnf mu sigma
quietly replace `lnf' = ///
myscalar * ln(normalden($ML_y1, `mu', `sigma' ))
end
sysuse auto, clear
scalar myscalar = 1
ml model lf mynormal_lf_scalar ///
(mpg = weight displacement) /sigma
ml maximize
scalar myscalar = 2
ml model lf mynormal_lf_scalar ///
(mpg = weight displacement) /sigma
ml maximize
Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html
*
* 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/