Levenberg-Marquardt Method


Eugenie
04-02-2002, 08:51 AM
I'm trying to use the function mrqmin (nonlinear least-squares fit) for fitting a function to an exponential function and to a spherical function.

Attached, a file containing the x&y values for the fitting.

The exponential function has the form:

y = a0 + a1 * (1 - exp(-3*x/A3) )

The Spherical function has the form:

y = a0 + a1 * ( 1.5 * (x/a2) - 0.5 * (x/a2)^3) )

where a0,a1 & a2 are the coefficients to be found.


I've found that only if I give a very close guess in the coefficients, then the solution converges.

Does anyone has used this fitting function?

Thanks!

bono
09-24-2002, 08:01 PM
Hi,

I tried to use the mrqmin() function too, and have had the same problem.

It simply does not converge unless you give very close values. I managed to get it "somewhat" fit by fixing some of the parameters iterating, fixing other parameters and iterating again, and so forth, but it is still pretty far from TableCurve 2D which also uses the 1 Attachment(s)Levenberg-Marquardt method.

One strange thing is that the program POLYMATH 5.1 (from www.polymath-software.com) has two methods for performing nonlinear regression - L-M and mrqmin. And both methods converge pretty well - I wonder if their mrqmin() method actually uses the mrqmin() function from NR.

Are you using the machine-readable code provided separately from the book.

I was copy-pasting the code from the book and was wondering if the code that is for sale would be different i.e. working.