Re: [eigen] Levenberg-Marquardt / Numerical differentiation

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi Carlos, I've noticed your second mail, but here are some more thoughs.

On Friday 29 October 2010 23:11:28 Carlos Becker wrote:

> authors mention that the delta used to calculate a numeric approximation to

> the derivative is usually chosen to be max( 1e-6, abs(1e-4 * xi) ), where xi

> means that the delta depends on the variable inside the parameter vector X.

Ok, first, we really need to know at this point whether we are dealing with float, double, or anything else. This has an important impact.

What the current code is doing is to use abs(eps*xi); where eps is, by default, the square root of numeric_limits<float>::epsilon(). If it appears that this multiplication is null (because xi is too small), then 'eps' is used instead. This is similar, though different, than your formula.

So eps is ~ 3.4*10-4 for float and ~1.5*10-8 for double. So if your example was about float, this is really not far away. I did not decide about formulas and values, this comes straight from the old&ancient minpack, and i wouldn't dare changing this for two reasons:

1) (the most important one) I think they do really know what they do, a lot better than I at least

2) we claim to be as compatible as possible with the original minpack code..

This file is worth 78 line of code (excluding comments), so i think it's really easy for someone to copy/paste this and to try all the tricks he wants, and have those in his own project.

But of course, I think it's still worth having people double-checking/proof-reading code.

best regards,

Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/