comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: HELP: Levenberg-Marquardt method

Re: HELP: Levenberg-Marquardt method
type: item
description: I believe that the CURVEFIT routine implements Barington's version of the Levenberg-Marquardt method. This is often not, however, the most stable of curve fitting techniques. If your data is not sufficiently regular, this method can get lost and find only a local best fit while missing other much better fits. Craig Kletzing University of New Hampshire
creator: kletzing
date: 1995-03-03T19:34:11-00:00

Re: HELP: Levenberg-Marquardt method
type: item
description: kletzing@unhedi2.unh.edu (Craig Kletzing) writes: > I believe that the CURVEFIT routine implements Barington's version of ^^^^^^^^^^^^ I believe you mean Bevington (from _Data Reduction and Error Analysis for the Physical Sciences_, 1969 edition). > the Levenberg-Marquardt method. This is often not, however, the most > stable of curve fitting techniques. If your data is not sufficiently > regular, this method can get lost and find only a local best fit while > missing other much better fits. > Craig Kletzing > University of New Hampshire Would you care to elaborate? I've used my own version of IDL's CURVEFIT (I added the capability to output covariance matrices and fixed what I think is a bug in the final pass of the algorithm) for close to 10 years now on a wide range of different astronomical/atmospheric data sets, and my results are usually very good. I would be very interested in knowing about different/better curvefitting techniques. Amara -- ************************************************************ ************* Amara Graps email: agraps@netcom.com Computational Physicist vita: finger agraps@sunshine.arc.nasa.gov Intergalactic Reality bio: finger -lm agraps@netcom.com ************************************************************ ************* "The play's the thing." --Shakespeare
creator: agraps
date: 1995-03-04T17:17:12-00:00

Re: HELP: Levenberg-Marquardt method
type: item
description: In article 758@mozz.unh.edu, kletzing@unhedi2.unh.edu (Craig Kletzing) writes: > > I believe that the CURVEFIT routine implements Barington's version of > the Levenberg-Marquardt method. This is often not, however, the most > stable of curve fitting techniques. If your data is not sufficiently > regular, this method can get lost and find only a local best fit while > missing other much better fits. > > Craig Kletzing > University of New Hampshire Does there exist a replacement for CURVEFIT that finds a better fit? I would be interested in getting hold of it. Thanks Matthew ____________________________________________________________ ______________ Matthew Larkum Physiologisches Institut Buehlplatz 5, CH-3012 Bern Switzerland Ph. 41 31 631 8726 Fax. 41 31 631 4611 Internet: larkum@optolab.unibe.ch matthewl@cortex.physiol.su.OZ.AU
creator: larkum
date: 1995-03-06T13:48:55-00:00

Re: HELP: Levenberg-Marquardt method
type: item
description: I have done fitting with various types of plasma data, quite often measured distribution functions that I wish to fit with idealized functions. This does not usually work very well with the CURVEFIT routine because the fit phase space, so to speak, has many local minima. Thus if curvefit starts near a local minima it often just finds that minima without finding other better minima. On the other hand I have worked with time series data that have an extraneous noise signal at one frequency that I have removed very successfully with curvefit. For the first type of problem, I have had more success by backing up to less sophisticated methods such as gradient search or grid search techniques. They take longer (often much longer) to converge, but tend to do better when the data is not as nice. Both these techniques are described in Bevington's book. Could you elaborate on the error in CURVEFIT? I've never looked over RSI's implementation very carefully. Craig Kletzing University of New Hampshire
creator: kletzing
date: 1995-03-06T15:05:19-00:00

Re: HELP: Levenberg-Marquardt method
type: item
description: kletzing@unhedi2.unh.edu (Craig Kletzing) writes: > Could you elaborate on the error in CURVEFIT? I've never looked over > RSI's implementation very carefully. > Craig Kletzing > University of New Hampshire Way back in '87, I dug into the guts of Bevington's math, then looked at Bevington's implementation and compared it to Numerical Recipes' implementation (called MRQMIN). I got different results for the test case I cooked up (see the test case below). After some inspection, I learned that IDL's CURVEFIT didn't make a final pass of calling the function when it had satisfied the chi-squared criteria, and MRQMIN did. So I added that into my version of CURVEFIT, and I got the same results that MRQMIN gave. In addition, I occasionally need to use the output covariance matrix (instead of just the sigma's, which is the diagonal of the covariance matrix), in order to verify that a fit is good, so I added that capability to my CURVEFIT as well. I sent Dave Stern at RSI a 9-track tape of my new CURVEFIT when I discovered this error (in '87), but it never appeared in any new release of the function, so I think I fell through the cracks there somehow. This CURVEFIT topic came up last Fall when Mathew Larkum asked for a simple set of instructions on how to use CURVEFIT. I posted this exact same example and my version of CURVEFIT. He took my code and generalized it to work to call any function. Now with Mark Rivers' version, we can somehow combine the three??? DIGRESSING... As you are probably aware, the Marquardt-Levenberg method is sort of a black art. I've done a bit more work with CURVEFIT, fitting very complicated second-harmonic Voigt functions that are particularly sensitive to initial guesses. One of the tricks that I learned is that you can tweak the direction the algorithm goes in chi-square space with different "flambda's" for each parameter being fit. I played around with this flambda (not very rigorously), and sometimes it worked at giving me better fits, sometimes…
creator: agraps
date: 1995-03-08T01:04:40-00:00