Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: ML numerical problems

 From Maarten buis To statalist@hsphsun2.harvard.edu Subject Re: st: ML numerical problems Date Thu, 6 May 2010 09:13:52 +0000 (GMT)

--- On Thu, 6/5/10, Valerie Orozco wrote:
> Very often in ML estimation, numerical problems occur.

In fact numerical problems are pretty rare, they only
occasionally show up in very hard problem, in which case
you should worry about whether there is enough information
in your data present to estimate such a model in first
place.

> One way to deal with this in Stata, is to rescale some
> variables (with large values in comparison to others
> variables). Sometimes it enables to achieve convergence.
> But it can also remains numerical problems, partly due to
> numbers' precision.
>
> One researcher I work with, decided to try with Matlab. A
> ML estimation with numerical problems in Stata, converges in
> Matlab. Do you have some ideas explaining this? Are there
> some parameters or format precision to specify in Stata? I
> really want to succeed in estimating our model with Stata!

Scaling is not the only way numerical precision can occur,
badly chosen functions can do so as well, e.g. don't
code:

1-invlogit(`xb')

invlogit(-`xb')

There is a list of such tricks in William Gould (2006) "Mata
matters: precision". The Stata Journal, 6(4):550-560.
<http://www.stata-journal.com/article.html?article=pr0025>

Bringing in good starting values can sometimes also help.

If that does not solve your problem you could consider coding
your ml evaluator as d2, i.e. code in analytical first and
second derivatives of your likelihood function.

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------

*
*   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/