Ticket #1044 (closed: fixed)

Opened 11 years ago

Last modified 5 years ago

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:

  1. Compare sample case with Matlab
  2. Increase logging to see if we can understand why
  3. If Possible reduce problem to 2D and plot parameter space
  4. Look at other open source curve fitting programs (octave - leasqr?, scilab - lsqrsolve?)

Change History

comment:1 Changed 11 years ago by Anders Markvardsen

(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.

comment:2 Changed 11 years ago by Roman Tolchenov

(In [3553]) Fixing the tests. re #1044

comment:3 Changed 11 years ago by Anders Markvardsen

(In [3558]) Increased tolerance on gaussian test using simplex to allow for different processors to fit to slightly different, but still acceptable, values for this test. Refs #1044.

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:5 Changed 11 years ago by Martyn Gigg

(In [3582]) DISABLED BackToBackExponentialTest until we understand what is going on with the differences between Windows and Linux. Note that the test is NOT fixed! Also fixed a compilation problem with MantidQt on Linux. Re #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:7 Changed 11 years ago by Anders Markvardsen

(In [3594]) Added new parameter to Fit named 'Minimizer'. For now set it either to "Simplex" or "Levenberg-Marquardt". It defaults to "Levenberg-Marquardt".

Refs #1044.

comment:8 Changed 11 years ago by Anders Markvardsen

(In [3595]) Use ListValidator to new Fit property 'Minimizer'. Refs #1044.

comment:9 Changed 11 years ago by Anders Markvardsen

(In [3598]) Start on interface to allow not only LM and Simplex to be used with Fit but also other minimizers. Refs #1044.

comment:10 Changed 11 years ago by Anders Markvardsen

  • Status changed from new to accepted

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:12 Changed 11 years ago by Martyn Gigg

  • Status changed from testing to closed

comment:13 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 1892

Note: See TracTickets for help on using tickets.