Stas Kolenikov wrote:
> A trick you can do, but you would need to write your own likelihood
> code for that, is to set the likelihood to missing value when the
> parameters are out of range.
<snip>
> In that case, however, -ml-'s optimizer breaks down as it cannot
> compute derivatives near the boundary. If say 0 is in fact the MLE,
> then during optimization -ml- will come around zero, and find itself
> stepping around it, hence getting some missing values, and you'll see
> warning and error messages like "missing values encountered", or
> "cannot compute derivatives", etc. It may stop, or at best set the
> standard error for a to a missing.
>
> If that situation were to happen quite often in user-written
> likelihoods, I would suggest a -boundary- option for -ml maximize-,
> may be showing which parameters may be at a boundary, so that those
> missing values would not take -ml- by surprise, and it could switch to
> a one-sided approximations for derivaties, rather than centered
> derivatives. How does that sound for Stata Corp.?
I am not StataCorp, but I do have a question about this trick. If I remember
correctly from my MLE class, than inference from MLE estimates are based on
the result that the sampling distributions of MLE estimates are, at least
in the wonderful Kingdom of Asymptotia, normal distributions. If your
estimate is at the boundary, than my intuition says that that result would
break down. Maybe the sampling distribution would become a truncated normal
or something more exotic. That would at least justify setting the standard
error to missing. Any thoughts about that?
Maarten
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Stas Kolenikov
Sent: donderdag 19 januari 2006 17:39
To: [email protected]
Subject: Re: st: RE: Inequaltity constraints
Say you want to have a parameter a>=0.
Then your code in the program that computes likelihood for method -lf-
may read something like
program define mycrazyll
version 9.1
args lnf theta a
if `a'<0 {
qui replace `lnf' = .
exit
}
else {
* substantial code
}
end
On 1/17/06, Maarten Buis <[email protected]> wrote:
> Mindaugas Baltutis wrote:
> Is it possible to define inequality constraints for parameters when
> performing maximum likelihood estimation in STATA?
--
Stas Kolenikov
http://stas.kolenikov.name
*
* 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/
*
* 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/