Major Topics

Calling Sequence

Description

LINFITEX is a model function to be used with MPFIT in order to
fit a line to data with errors in both "X" and "Y" directions.
LINFITEX follows the methodology of Numerical Recipes, in the
section entitled, "Straight-Line Data with Errors in Both
Coordinates."
The user is not meant to call LINFITEX directly. Rather, the
should pass LINFITEX as a user function to MPFIT, and MPFIT will in
turn call LINFITEX.
Each data point will have an X and Y position, as well as an error
in X and Y, denoted SIGMA_X and SIGMA_Y. The user should pass
these values using the FUNCTARGS convention, as shown above. I.e.
the FUNCTARGS keyword should be set to a single structure
containing the fields "X", "Y", "SIGMA_X" and "SIGMA_Y". Each
field should have a vector of the same length.
Upon return from MPFIT, the best fit parameters will be,
P[0] - Y-intercept of line on the X=0 axis.
P[1] - slope of the line
NOTE that LINFITEX requires that AUTODERIVATIVE=1, i.e. MPFIT
should compute the derivatives associated with each parameter
numerically.

Inputs

P - parameters of the linear model, as described above.

Keyword Inputs

(as described above, these quantities should be placed in
a FUNCTARGS structure)
X - vector, X position of each data point
Y - vector, Y position of each data point
SIGMA_X - vector, X uncertainty of each data point
SIGMA_Y - vector, Y uncertainty of each data point