PreviousTable of ContentsNext


The Reweight Option

When the data has no explicit errors, LinearFit by default performs a standard minimization of the sum of the squares of the residuals. However, if the scatter in the data points can be considered to be random and statistical, then it is often reasonable to assume that the effective error in the dependent variable is

[Graphics:../Images/index_gr_171.gif]

By default LinearFit uses this assumption. In this case LinearFit will return, as part of the fit, the assumed statistical error.

We will use some data taken with a constant volume gas thermometer. The data consists of (temp, vol) pairs, where temp is the temperature in Celsius and press is the pressure in mm of Hg. The data is reported in John R. Taylor, An Introduction to Error Analysis: The Study of Uncertainties in Physical Measurements (University Science Books, Mill Valley California, 1982), pg 160. Later we will wish to know that the student judged that his measurements of press had negligible uncertainty and those of temp were all equally uncertain with an uncertainty of "a few degrees."

Using all default values, making the temp the dependent variable and press the independent one and fitting to a straight line gives:

var.names/data.val

**** Fit Number 1 ****


temp with no error versus press with no error
A0 = -263. ± 18.
A1 = 3.71 ± 0.21.
Sum of Squares = 133.9 for 3 degrees of freedom.
(Assumed statistical error in the dependent variable: 6.68082)
[Graphics:../Images/index_gr_175.gif]

The intercept A0 corresponds to when the volume of the gas has gone to zero, and thus should be the value of absolute zero. The fit gives a value for absolute zero of -263 ± 18 Celsius, well within the accepted value of -273.16 Celsius. Also, the value of the assumed statistical error PseudoErrorY is 6.68082, consistent with the student's estimate of an error of "a few degrees" in the temperature.

The Fit Options screen allows you turn off the reweighting procedure. The relevant part of the screen will look like this when the reweighting is off:

Reweight

True (default)
False

Controls whether or not to re-weight the data if it contains no explicit errors. If set to True, the data is weighted using a statistical assumption, where the error in the dependent variables is the square root of the sum of the squares divided by the number of degrees of freedom; see Taylor, An Introduction to Error Analysis, Eqn 8.14 on pg. 158 for further information. When set to True, all subsequent processing assumes that the generated errors in the dependent variable are real.

Repeating the fit to a straight line gives:

var.names/data.val

**** Fit Number 2 ****


temp with no error versus press with no error
(Reweight False)
A0 = -263.3 ± 2.7
A1 = 3.71 ± 0.032
Sum of Squares = 133.9 for 3 degrees of freedom.
[Graphics:../Images/index_gr_178.gif]

The only effect of setting Reweight to False is in the errors in the fitted parameters. For this fit the effect is to reduce the errors in the parameters, making the experimental result for absolute zero equal to -263.3 ± 2.7 degrees Centigrade; this is significantly different than the accepted value of -273.16 degrees.

Although linear fits do not need to iterate to a solution unless both coordinates have errors, LinearFit actually uses two iterations when Reweight is set to True. The first is required to calculate the PseudoErrorY, which is then used for the second and final iteration.

Note that internally LinearFit treats PseudoErrorY as a "real" experimental error. However, it does not return the ChiSquared, since it is always exactly equal to the DegreesOfFreedom. Instead, it returns the sum of the squares of the residuals.

In general, experience with a wide range of experimental data from a variety of fields of science and engineering has found that the default setting of Reweight to True is almost always the most reasonable one for linear fits.


PreviousTable of ContentsNext


Authors

This help document is Copyright © 1999 David M. Harrison. The sample screens are Copyright © 1999 Solomon R.C. Douglas and David M. Harrison. This is version 1.1 of the help document, date (m/d/y) 11/25/99.