BAIT: linfit command

NAME

linfit

SYNOPSIS

linfit [xc=] [yc=] [zc=] [order=] [fit] [file]

DESCRIPTION

linfit reads data from stdin or the file specified on the command line and performs a linear least square fit using the first column as the x values and the second column as the data to be fitted. The column numbers can be changed by command line switches. The default value is a first order (line) fit, higher orders can be selected from the command line. If xc=0 then a fit to the line count is made.

If the `fit' keyword is not used the program prints out he values of the best fitting line. For example:

a0=0.20000000 a1=2.35000000 rms=0.6363961

Where the first two fields are the intercept and slope of the line, and the last field is the root mean square value of the difference between the data and the fit.

If `fit' is specified the values of the fit, and the residuals are printed to stdout.

If a zc= is specified, a second term combining the data in the third column is fit.

Lines starting with the # character are ignored.