Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: ML numerical problems
From
Valerie Orozco <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: RE: ML numerical problems
Date
Thu, 6 May 2010 09:43:01 +0000
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
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')
instead use:
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/