[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LMFIT




"Alberto Verga" <verga@marius.univ-mrs.fr> writes:
> I tried the following example on the use of LMFIT given in the IDL 5.2
> help:
> 
> ...example removed...
> 
> I obtained
> % LMFIT: Warning: Failed to Converge.
> 
> and in consequence a bad fit!
> Does anyone known if this LMFIT is correctly implemented?

"Correct" is a matter of debate.  Designing an algorithm for curve
fitting appears to be as much art as it is science.  The procedures
supplied by IDL are somewhat of a mixed bag:

CURVEFIT - quick and dirty.  Quick because it runs fast.  Dirty,
           perhaps, because it doesn't always converge.  The best if
           judged in EASY and SPEED categories.

LMFIT - slow and dirty.  Slow because function calls are done in FOR
        loops (astounding!).  If there are convergence problems, it's
        probably because LMFIT is based on Numerical Recipes.

I recommend you try MPFIT and related functions (web page below).  I
have translated these from the original MINPACK-1 package, which was
designed by a real numerical analyst!  I value reliability more than
absolute speed and was willing to make a compromise.

I have found the results to be very reliable in my own work, and I
have gotten similar comments from other researchers.  For your
application I clearly recommend MPFIT and the driver function
MPFITFUN.

Craig
http://cow.physics.wisc.edu/~craigm/idl/idl.html


-- 
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------