Bookmark and Share

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, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: ML numerical problems

From   "Abhimanyu Arora" <>
To   <>
Subject   st: RE: RE: ML numerical problems
Date   Thu, 6 May 2010 12:01:39 +0200

As a follow up to my post, while stata
output showed  "could not calculate numerical derivatives; missing values
encountered" or no convergence, even I had to resort to MATLAB (which did
solve it), without knowing the underlying reasons. 

-----Original Message-----
[] On Behalf Of Valerie Orozco
Sent: donderdag 6 mei 2010 11:43
Subject: st: RE: ML numerical problems 

Thank you Maarten, 

I'm going to read the Mata Matters and think about all your wrote.
But yours ideas din't really explain why the same function specification
converges in Matlab, and doesn't in Stata...

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

> 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


instead use: 


There is a list of such tricks in William Gould (2006) "Mata
matters: precision". The Stata Journal, 6(4):550-560.

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 L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index