SIXLIN
Name
SIXLIN
Purpose
Compute linear regression coefficients by six different methods.
Explanation
Adapted from the FORTRAN program (Rev. 1.1) supplied by Isobe,
Feigelson, Akritas, and Babu Ap. J. Vol. 364, p. 104 (1990).
Suggested when there is no understanding about the nature of the
scatter about a linear relation, and NOT when the errors in the
variable are calculable.
Calling Sequence
SIXLIN, xx, yy, a, siga, b, sigb, [WEIGHT = ]
Inputs
XX - vector of X values
YY - vector of Y values, same number of elements as XX
Outputs
A - Vector of 6 Y intercept coefficients
SIGA - Vector of standard deviations of 6 Y intercepts
B - Vector of 6 slope coefficients
SIGB - Vector of standard deviations of slope coefficients
The output variables are computed using linear regression for each of
the following 6 cases:
(0) Ordinary Least Squares (OLS) Y vs. X (c.f. linfit.pro)
(1) Ordinary Least Squares X vs. Y
(2) Ordinary Least Squares Bisector
(3) Orthogonal Reduced Major Axis
(4) Reduced Major-Axis
(5) Mean ordinary Least Squares
Optional Input Keyword
WEIGHT - vector of weights, same number of elements as XX and YY
For 1 sigma Gausssian errors, the weights are 1/sigma^2 but
the weight vector can be more general. Default is no
weighting.
Notes
Isobe et al. make the following recommendations
(1) If the different linear regression methods yield similar results
then quoting OLS(Y|X) is probably the most familiar.
(2) If the linear relation is to be used to predict Y vs. X then
OLS(Y|X) should be used.
(3) If the goal is to determine the functional relationship between
X and Y then the OLS bisector is recommended.
Revision History
Written Wayne Landsman February, 1991
Corrected sigma calculations February, 1992
Converted to IDL V5.0 W. Landsman September 1997
Added WEIGHT keyword J. Moustakas Februrary 2007