Re: LMFIT -- stay away from it! [message #10941] |
Sun, 01 February 1998 00:00 |
Theo Brauers
Messages: 58 Registered: November 1997
|
Member |
|
|
Thanks for your advice. I am pretty disappointed about the
implementation
of the Numerical Recipes in IDL (I am using version 5.03). I would
expect
all Numerical Recipes routines to come with the IDL package and not a
subset. The Numerical Recipes in C book could be an excellent reference
then.
Theo Brauers
Wayne Landsman wrote:
>
> A while back I posted a complaint about LMFIT, the IDL implemention of
> the Numerical Recipes version of the Levenberg-Marquardt non-linear
> least-squares algorithm. I complained that the form of the
> user-supplied function was different and less flexible than that of
> CURVEFIT. In fact, there is a more fundamental problem with LMFIT.
> Although the documentation says that the user-supplied function should
> accept a vector argument, **only scalar arguments are ever passed to the
> user-supplied function**! Thus, if one is fitting a function of 2000
> points, then there must be 2000 calls to the user-supplied function on
> each iteration. And thus with a computationally intensive function,
> LMFIT will be about 2000 times slower than fitting with CURVEFIT.
>
> The same problem occurs in the IDL implementation of the Numerical
> Recipes routines QSIMP. But the problem is more disatrous in LMFIT,
> which requires more iterations and partial derivative computations.
>
> My advice -- forget about LMFIT, and stick with CURVEFIT (or write your
> own implementation of the Numerical Recipes routine).
>
> --Wayne Landsman landsman@mpb.gsfc.nasa.gov
|
|
|