Re: Help Wanted: IDL Math Expert [message #9818 is a reply to message #9809] |
Tue, 19 August 1997 00:00  |
Marty Ryba
Messages: 16 Registered: May 1996
|
Junior Member |
|
|
David Fanning wrote:
> Suppose I have a set of raw data that is described
> theoretically by two parametric equations. And suppose
> I need to fit these two parametric equations to the data
> since there is no mathematical way to convert the x(t)
> and y(t) equations into a y(x) form. Is there a
> curve fitting routine in IDL that can handle parametric
> equations? Or, failing that, has anyone handled something
> like this in IDL and would be willing to give us a little
> help?
Hmmm. The short answer to this question is "It Depends." (I know,
lotta help). It sounds like the "raw data" has nonzero uncertainties in
both the X and Y direction. Normal least-squares techniques assume a
negligible error in the "independent variable" and are forming a
maximum-likelihood solution given weights and uncertainties in the Y
(dependent variable) direction. If one can generate the T variable for
each X,Y pair (which is kinda implied by your question), then I would
concatenate the X and Y data together, each with its own copy of T, and
use CURVEFIT to fit the combined data set with the concatenated set of
free parameters. The user-supplied function would keep track of which
points are X and Y (first half and second half, or interleaved), and
some of the partial derivatives would be simply zero. The weights for
each X,Y data point would be proportial to the inverse of the error
squared or whatever else you'd like to try.
Good luck; nonlinear least-squares fitting is part science and part art.
If you need a more full-featured fitting routine, try SUPERFIT in I
believe the JHU/APL astrophysics library.
Dr. Marty Ryba
MIT Lincoln Laboratory
ryba@ll.mit.edu
|
|
|