Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Abhimanyu Arora" <abhimanyu.arora@student.kuleuven.be> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | st: RE: RE: ML numerical problems |
Date | Thu, 6 May 2010 12:01:39 +0200 |
Hi As a follow up to my post http://www.stata.com/statalist/archive/2010-04/msg00817.html, 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. Abhimanyu -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Valerie Orozco Sent: donderdag 6 mei 2010 11:43 To: statalist@hsphsun2.harvard.edu 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 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/ * * 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/