Levenberg-Marquardt Fit in ROOT?


has anyone ever used a Levenberg-Marquardt fit algorithm in the context of ROOT? (http://en.wikipedia.org/wiki/Levenberg-Marquardt_algorithm)
I would like to fit a TGraph using this algorithm. Before implementing something myself, I just want to check here if something’s available somewhere!

Thanks for any information,



in the latest release of ROOT the algorithm is available in MathMore and used the GSL implementation.
The class is GSLNLSMinimizer documented at

project-mathlibs.web.cern.ch/pro … mizer.html

For using it you must create your least square function and pass to the class. The function must implement this interface:

project-mathlibs.web.cern.ch/pro … ction.html

If you have any question, please let me know.
In the next release of ROOT it will be possible to use it directly from a ROOT data object like a TGraph by some planned extensions of the ROOT fitting.

Best Regards


Hi Lorenzo,

wonderful, thank you very much for this valuable information (which is hard to find otherwise!). I knew ROOT wouldn’t let me down on this one :slight_smile:

Best wishes,


Hi Thomas,

A bit puzzled by your request . The Marquardt algorithm is one of the more
basic non-linear optimization procedures . Some of us might remember the
"curfit" routine from The Philip Bevington book.

Anyhow, it seems to be incorporated in TMinuit, see mnline routine and
is part of a more exhaustive algorithm , mnmigra.

I think that using just this linear search along the gradient is not going
to do any better than what Minuit already does