ABSTRACT:Routines for linear fitting:
Given a set of nVar arrays of independent variables and one array of dependent variables, this set of tools does the linear fit and displays the result.
C ROUTINE CALLED: atVLinEqn in atLinearFits.c
DESCRIPTION: Solve a set of linear equations: A X = B, where A is a matrix composed of one vector (column) for the coeffients of each independent variable, X is the vector of unknowns which are solved for, and B is a vector containing the values of the dependent variable.
Each vector for an independent variable contains the constans for one of the unknowns, e.g., to solve the set of equations
2x - 3y = -13 3x + 2y = -13pass in two vectors: a1 = (2, 3) and a2 = (-3, 2), as well as the vector B = (-13, -13). The answer can be extracted from the FUNC structure which is returned. (See ..astrotools/test/testLinearFits.tcl or the SDSSMATH home page for how to do this.)
TCL SYNTAX: vLinEqn "<dep vector>" "<ind vectors>" TCL HELP STRING: Solve a set of linear equations TCL ARGUMENTS: : "<dep vector>" : Vector with coefficients for dependent vector "<ind vectors>" : List of vectors with coefficients for each independent variable
BCES (Bivariate Correlated Errors and intrinsic Scatter) is a linear regression algorithm that allows for:
The algorithm and the base fortran code are from Akritas and Bershady, ApJ 470, ? 1996.
Also returned are the results of a bootstrap ananlysis.
The "slopeErr" and "slopeErrBoot" lists have two extra elements on them. These are variences for the bisector and orthogonal slopes calculated using a technique of wider applicability than the usual one which assumes that the residuals in Y about a line are independant of the value of X; see Isobe, Feigelson, Akritas, and Babu, ApJ 364, 104 1990)
The covarience vector may be all zeros.
James Annis, June 14, 1996
C ROUTINE CALLED: atBcesFit in atLinearFits.c
TCL SYNTAX: vLinFitBces "<X>" "<XErr>" "<Y>" "<YErr>" "<XYErr>" "-nsim" "-seed" TCL HELP STRING: Perform BCES linear regression of Y onto X using YErr, XErr, and covaraience XYErr. Return fits for Y on X, X on Y, bisector, and orthogonal. TCL ARGUMENTS: : "<X>" : vector containing x values "<XErr>" : vector containing x error values "<Y>" : vector containing y values "<YErr>" : vector containing y error values "<XYErr>" : vector containing xy covariance error values "-nsim" : number of bootstrap simulations [100] "-seed" : integer seed for random number generator [1]