Statalist


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

st: mata optimize with d2debug


From   Stas Kolenikov <skolenik@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: mata optimize with d2debug
Date   Thu, 24 Sep 2009 16:17:26 -0500

I am programming a fairly large model and rather poorly identified
model with a couple dozen parameters in Mata. Documentation on
-mf_optimize- says: "When you have done things right, gradient vectors
will differ by approximately 1e–12 or less and Hessians will differ by
1e–7 or less." I never get there; even a restricted version of the
model that is known to converge well produces mreldifs of about 1e-7
and 1e-4, respectively. The mreldifs for the Hessian might start kinda
high between 1 and 10, but they would eventually go down near the
maximum. For the interesting (and poorly identified) models that I
eventually want to fit, I get mreldifs around 1e-3 to 1e-5 in
gradients for most iterations, while my mreldifs for the Hessian
fluctuate between 1e-3 and 1. In the early steps far from the maximum,
the mreldifs for the Hessian can be as large as 100 or so (that's for
20x20 matrix, remember), but they go down as I converge to the
maximum. Since I am walking along a ridge, I would actually tend to
trust my analytical derivatives more than I do the numeric
derivatives. Is that reasonable? Any advice on this? I tried tighter
convergence criteria, but the results did not change much.

-- 
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I use this email account for mailing lists only.

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



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index