Re: power law interpolation [message #36455] |
Wed, 17 September 2003 10:34 |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Steve wrote:
>
> Hi,
> is there any function or routine in IDL to perform a power law
> interpolation (i.e. to find the best power-law exponent) from a set of
> data?
Do you mean a fit (rather than interpolation)?
If so, the simplest is a linear fit. If your relationship is
y = x^a
then
ln(y) = a.ln(x)
so do a linear fit to
Y = a.X
to determine the value of a.
Many other options exist depending on the complexity of your data and/or model. The built
in fitting routines include LINFIT, LADFIT, LMFIT, COMFIT, CURVEFIT, POLY_FIT,
SVDFIT...etc.etc.
The best (i.e. ease of use, robust) IDL fitting code I've used is Craig Markwardt's MPFIT
available from his website.
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|
|
|