Theodore Papageorgiou <[email protected]> asks:
> I need to constraint 3 variables in my MLE:
> ml model lf theo (theta: r = r2 r3 r4, noconst) /sigma /sigmae /p0 /p1 /p2
> such that p0+p1+p2=1, and that p0,p1 and p2 are all probabilities between 0
> and 1.
Reparametrize your likelihood evaluator so that instead of evaluating in
terms of p0, p1, and p2, it evaluates in terms of
q0 = logit(p0)
q1 = logit(p1)
and plug-in the expression 1-invlogit(q0)-invlogit(q1) in place of p2. This
reduces the dimensionality of the problem, getting rid of the "sum up to one"
constraint, and by using logit's you remap [0,1] variables to the whole real
line.
After estimating, you can remap q0 and q1 back to p0, p1, and p2 either within
in your program using -_diparm- (see Gould, Pitblado, and Sribney (2003) or
post-estimation using -nlcom- (see [R] nlcom).
--Bobby
[email protected]
*
* 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/