line2a.txt

This linear data set has uniform error bars in the Y axis. The data is arranged as:
x, dx, y, dy
(with all dx=0)


Using a uniform uncertainty of dy=0.1, the resulting fit using Bevington or Numerical Recipes weighted
fitting programs is:
y = a0 + a1*x

a0 = 0.06071 +/- 0.06814
a1 = 0.9829 +/- 0.0189
Reduced Chi-Squared = 2.21

Changing the uniform uncertainty of dy=1.0, the resulting fit is

y = a0 + a1*x

a0 = 0.0607 +/- 0.6814
a1 = 0.9829 +/- 0.1889
Reduced Chi-Squared = 0.0221

Monte Carlo analysis of this data set (10000 trials, varying both X and Y within Gaussian distributions for the error bars) is in very good agreement with the fit parameters and uncertainties listed above.  For dy=0.1, the Monte Carlo gives

a0 = 0.05922  +/-  0.06982
a1 = 0.9899 +/- 0.0197


Programs that multiply the fit uncertainties by square-root of chi-squared (Such as earlier versions of Sigmaplot,
Psiplot, etc.) the resulting fit is

y = a0 + a1*x

a0 = 0.0607 +/- 0.1013
a1 = 0.9829 +/- 0.0281

Regardless of whether dy=0.1, dy=1.0 (or any other uniform uncertainty) is used.  In fact, since the error bars
are uniform, the resulting fit uncertainties are identical with the result from an unweighted fit.


More details of the incorrect uncertainty calculation in weighted least squares fitting programs can be found at

http://physics.gac.edu/~huber/fitting/

Thomas M. Huber; 20-July-2001