Weighted linear model fitting (variable s) tutorial worksheet
This worksheet illustrates weighted least-squares fitting a linear function (y(x) = mx+b) to an ordered dataset [x,y,s] . It includes calculation of the goodness of the model fit (reduced c2 and probability , and confidence level for acceptance of the fit), as well as the uncertainties in the model parameters (sa, sb). Finally, it illustrates using Chauvenet's criterion to identify possible outliers, and recalculates the model and uncertainties after excision of one outlier of the original dataset.

Reference: Bevington & Robinson Chap 6

Version 2.0 RLM (23 August 2003)

1. Enter data (if the dataset is large, make a column-based text file and read data in using READPRN function)
2. Calculate linear model coefficients using a weighted least-squares method (cf. B&R chap 6))
Slope
y-intercept
Linear model (for plotting)
3. Plot the data and model (note how error bars are plotted; double-click to change plot characteristics).
4. Uncertainties in model parameters
Uncertainty in slope
Uncertainty in intercept
5. Is the model an adequate representation of the data?
No! (Model can be rejected at 99.5% confidence.)
5. Now apply Chauvenet's criterion to reject possible outliers (assumes data are normally distributed)
Absolute distance from model to data point yi normalized by uncertainty of that point
Probability that the normalized distance would occur in a group of N normally distributed data points
Chauvenet criterion: If the probability of any point is <0.5, consider rejecting that point as outliers. Since point 3 has P< 0.5, we can reject it as an outlier.
6. Redo model fitting with n = 3 point excised
Original dataset with but with point 3 removed
Calculate linear model coefficients using a weighted least-squares method (cf. B&R chap 6))
Slope
y-intercept
Linear model (for plotting)
Plot the data and model (note how error bars are plotted; double-click to change plot characteristics).
4. Uncertainties in model parameters
Uncertainty in slope
Uncertainty in intercept
5. Is the model an adequate representation of the modified data?
Yes! (Model can be accepted at 35% confidence.) This is not bad (typically reject at 95% or more)