Ticket #1044 (closed: fixed)
Improve Solver Robustness
Reported by: | Nick Draper | Owned by: | Anders Markvardsen |
---|---|---|---|
Priority: | major | Milestone: | Iteration 21 |
Component: | Keywords: | ||
Cc: | Blocked By: | ||
Blocking: | Tester: |
Description
Target Date:09/12/2009
The Levenberg-Marquadt solver seems to be making poor decisions. Given a simple peak and good initial guesses for height, centre and background it does an abyssmal fit unless you provide a good sigma for a gaussian fit.
I don't quite understand how a solver with the benefit of derivatives can be this poor. We need to understand what our solver is doing and if other programs available are doing a better job. Suggestions:
- Compare sample case with Matlab
- Increase logging to see if we can understand why
- If Possible reduce problem to 2D and plot parameter space
- Look at other open source curve fitting programs (octave - leasqr?, scilab - lsqrsolve?)
Change History
comment:4 Changed 11 years ago by Anders Markvardsen
(In [3579]) Run same test using Matlab's default solver (which does not use derivative) on Gaussian tests and this solver does not do any better than the GSL solvers.
The verdict at the moment is that the GSL simplex is more robust than the GSL Levenberg-Marquardt, and constraints appear to have the most beneficial effect when used together with the simplex.
When bad initial values are used with the GSL Levenberg-Marquardt it may refuse to do anything. For this scenario code has been put in place which then tried to use the simplex method. Refs #1044.
comment:6 Changed 11 years ago by Anders Markvardsen
(In [3588]) We have investigated the Linux failure of the BackToBackExponential test. It turns out that on Linux Levenberg-Marquardt throws an error status even after a fairly good fit is achieved. Fix around this is to accept LM fit if more than two iterations have been successful.
As a side effect of fixing this bug, it was found that this particular test makes the Simplex fail (throw error). To make the Simplex more stable the step size is reduced by a factor of 10 if the simplex fails on the first hurdle.
Refs #1044.
comment:11 Changed 11 years ago by Anders Markvardsen
- Status changed from accepted to testing
- Resolution set to fixed
With reference to 3582 above all BackToBackExponential tests now pass see ticket 1080 which describes the addition of new minimizer interface.
comment:13 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 1892
(In [3552]) Added additional Gaussian tests where the same fitting problem is run both with least-squares and simplex on a problem where the initial value of Sigma is way off. Both perform purely although levenberg-marquendt arguably worse. However applying a constraint at least for this problem makes both these minimizers perform well. Refs #1044.