Fit Values and Parameter Errors

Consider a straight line fit to:

y = A0 + A1x

where A0 is the intercept and A1 the slope. By default LinearFit will return values and errors for both of these parameters: A0 ± delta(A0) and A1 ± delta( A1). The solid line in the Fit Results plot is just the graph of:

A0 + A1 * x

where x is the independent variable.

The two dashed lines on the plot are graphs of:

[A0 + delta(A0) ] + [A1 - delta(A0) ] * x

and

[A0 - delta(A0) ] + [A1 + delta(A0) ] * x

Thus the ranges show the (maximum intercept, minimum slope) line, and the (minimum intercept, maximum slope) one.

At first glance, you might think we should show the (maximum intercept, maximum slope) line, and the (minimum intercept, minimum slope) line. This is too extreme. Implicit in the least-squares minimisation procedure used by LinearFit is the assumption that each term in the model is independent of every other term. So if one parameter value is too high, another parameter value is equally likely to be too low as too high. This leads to the idea that we should alternate the signs of the errors as above.

If there are three or more terms in the fit, the situation becomes more complicated. We now have three or more parameters with associated errors, such as:

A0 ± delta(A0)
A1 ± delta( A1)
A2 ± delta( A2)

To calculate one of the dashed line equations, we could add the errors of two of the terms and subtract the error of the other term, but deciding which to add and which to subtract is not obvious.

The covariance matrix determines the signs of the linear correlation coefficients. Thus if the matrix is available, the routines that produce the Fit Results plot look at the signs of the terms in the first row of the covariance matrix to determine whether the error in a particular fit parameter is added or subtracted to the value of the parameter.

If there is no covariance matrix available, a heuristic is used. The terms of the fit are evaluated for the independent variable equal to 10. The terms are sorted by their numeric value, and the program alternates whether to add or subtract the error based on their position in the sorted list. Often this heuristic gives the same result as that computed from the covariance matrix.


This document is Copyright © 1999 David M. Harrison