ratt-ru / meqtrees

A library for implementing radio astronomical Measurement Equations
http://meqtrees.net
10 stars 2 forks source link

Solver needs to deal sensibly with (temporarily) small derivatives #833

Open gijzelaerr opened 10 years ago

gijzelaerr commented 10 years ago
at 2011-10-18 21:45:11 Oleg Smirnov reported:

Solver needs to deal sensibly with (temporarily) small derivatives

gijzelaerr commented 10 years ago

Original comment thread migrated from bugzilla

at 2011-10-18 21:45:11 Oleg Smirnov replied:

Our current Solver (by which I mean not just the WNB solver, but the whole Solver node around it) exhibits rather unstable behaviour when the derivative w.r.t. a parameter goes near to zero -- the next parameter update value is some huge number, which knocks the parameter into some random distant corner of chi- square space.

As an example, consider fitting an elliptical Gaussian. If the initial guess for the extents is Emaj==Emin, then at the first iteration the partial derivative w.r.t. position angle is 0 (ends up not quite zero but a very small number due to machine precision). The solver responds by updating P.A. with some value on the order of 10^9.

The sensible thing to do is to set the parameter update to 0 when such a condition is detected (note that in my particular example the problem would have gone away by the second iteration, as soon as Emaj and Emin are nudged away from equality). The question is, what's a good general way to detect it? It's a little late in the evening for me to work this out myself, but I'll cc this bug to Wim, hoping he'll come back with "but of course, you just need to check this value/call this function in LSQSolver".