advanced29 min studyLesson 962 in Physics

Weighted fitting and correlated errors

Fit a common physical parameter with a declared covariance matrix and identify uncertainty that averaging cannot reduce.

On this page

What you’ll understand

  • Derive an inverse-variance weighted estimate under fixed known errors.
  • Use covariance rather than diagonal errors for correlated measurements.
  • Separate common calibration shifts from independent fluctuations.

Two measurements can be precise for different reasons and can share the same hidden weakness. Combining their central values requires weights, but combining their information requires their covariance. This lesson studies a constant physical signal measured several times with Gaussian errors and a specified, parameter-independent covariance matrix. The numerical examples use invented energies rather than real detector results. We will see why a common calibration error survives averaging and why positive correlation can help a difference while hurting an average.

Weights come from the sampling model

For independent measurements of one common mean mu with known variances, minimizing the sum of squared residuals divided by variance gives inverse-variance weights. Normalize the weights so they sum to one. This ensures the linear combination has expectation mu when the model is correct. The variance is the reciprocal of the total inverse variance. These conclusions require the quoted uncertainties to represent the sampling variances, rather than arbitrary plotting errors or weights chosen because a result looks plausible.

The equivalence to maximum likelihood uses Gaussian observations and fixed variances. Linear least squares can still define useful estimators without Gaussianity, but its exact normal-distribution interval and chi-square reference distribution no longer follow automatically. If the variance depends on the parameter, the Gaussian log determinant also depends on that parameter and must be included in likelihood fitting. Replacing every Poisson variance by its noisy observed count can similarly bias a naive weighted fit, especially when some bins are empty.

μ^=∑iyi/σi2∑i1/σi2,Var⁡(μ^)=(∑i1σi2)−1\widehat\mu=\frac{\sum_i y_i/\sigma_i^2}{\sum_i1/\sigma_i^2},\qquad \operatorname{Var}(\widehat\mu)=\left(\sum_i\frac1{\sigma_i^2}\right)^{-1}
These exact estimator moments assume independent observations of a common mean and known variances. Gaussianity gives the additional exact Gaussian sampling distribution.↔ Scroll wide equations horizontally.

Carry correlations through the fit

For a measurement vector y, let C be its known positive-definite covariance matrix and H the design matrix of a linear mean model. The generalized least-squares estimator follows by differentiating the covariance-weighted quadratic residual. Its covariance is obtained by propagating C through the resulting linear estimator. In practice solve linear systems or factor C; do not infer numerical stability merely from writing an inverse. Identifiability requires the relevant weighted design matrix to have full column rank.

A shared additive calibration uncertainty of variance tau squared contributes tau squared to every element of a covariance block when its sensitivity is one for each measurement. For repeated measurements of the same mean, this component does not average down. If the independent-error covariance is diagonal, adding this common component leaves the optimal normalized weights unchanged, but increases the variance of their average by tau squared. This special result should not be generalized to arbitrary correlation patterns or multiplicative uncertainties.

θ^=(HTC−1H)−1HTC−1y,Cθ^=(HTC−1H)−1,Cij=δijσi2+τ2\widehat{\boldsymbol\theta}=(H^TC^{-1}H)^{-1}H^TC^{-1}y,\qquad C_{\widehat\theta}=(H^TC^{-1}H)^{-1},\qquad C_{ij}=\delta_{ij}\sigma_i^2+\tau^2
The last covariance is one particular common-offset model. C and the estimator covariance carry squared measurement units when the fitted parameter is a common mean.↔ Scroll wide equations horizontally.

Diagnose the combination, not only its error bar

For two equal-variance readings, a positive covariance enlarges the variance of their mean but reduces that of their difference. A calibration offset can therefore cancel in a contrast even when it remains the dominant uncertainty of an absolute measurement. Negative correlation has the opposite effect. Reporting only individual standard deviations discards this distinction and can prevent a later user from reconstructing either quantity correctly. Correlation coefficients alone are also insufficient unless their associated standard deviations and ordering are supplied.

A weighted average assumes all inputs measure the same defined quantity. Measurements at different temperatures, energies or selection thresholds may require a response model before combination. An unusually large residual can indicate a statistical fluctuation, an underestimated covariance, or model mismatch; deleting it because it is inconvenient changes the procedure. Examine residual directions, calibration evidence and sensitivity to defensible covariance alternatives. A small quoted combination error is useful only when the common-quantity and uncertainty models remain credible.

Independent precision plus a shared calibration

Two readings are 10 and 14 keV. Their independent standard deviations are 1 and 2 keV. A common additive calibration shift has zero mean and standard deviation 2 keV, independent of those errors. Compute the weighted mean and its total variance.

  1. The independent inverse-variance weights are 1 and one quarter in reciprocal keV squared. Normalizing gives 0.8 and 0.2, so the estimate is 0.8(10)+0.2(14)=10.8 keV0.8(10)+0.2(14)=10.8\,\mathrm{keV}.

  2. The independent contribution to its variance is 1/(1+1/4)=0.8 keV21/(1+1/4)=0.8\,\mathrm{keV^2}. The common shift enters with the sum of weights, which is one.

  3. Add its variance 22=4 keV22^2=4\,\mathrm{keV^2} once. The total variance is 4.8 keV24.8\,\mathrm{keV^2} and standard deviation approximately 2.19 keV; the shared term is not divided by the number of readings.

The result

The combined value is 10.8 keV with variance 4.8 keV² under this common-offset covariance model.

Explore the model

Interactive lab

Interactive lab · function

A quadratic coefficient changes curvature

Reset and set BOTH Coefficient a = 0.5 and Position x = 1; predict y = 0.5 and slope 1. For a fresh comparison, Reset and set a = 2 and x = 1; predict y = 2 and slope 4.

A quadratic coefficient changes curvatureThis lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Current readings: y at chosen x: 0.608; Tangent slope · 2ax: 1.35; Signed area · ax³/3: 0.182. All parameters are adjustable with the labeled controls below.−2.4−1.201.22.4−9−4.504.59xy(x, ax²)
y = ax²TangentSigned integral
y at chosen x
0.608
Tangent slope · 2ax
1.35
Signed area · ax³/3
0.182
t = 0 s

This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA quadratic can illustrate a residual penalty and its curvature. This lab does not load observations, invert a covariance matrix, fit parameters or compute a confidence interval.

Check your understanding

Which uncertainty survives averaging many readings affected by the same additive calibration offset?

Try it yourself

Readings 2 and 6 keV each have known variance 4 keV24\,\mathrm{keV^2} and covariance 2 keV22\,\mathrm{keV^2}. Find their optimal common-mean estimate and variance, then the variance of their difference.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Equal marginal variances and symmetric covariance give equal weights. Keep the covariance cross terms in both calculations.

Compare with the solution

The estimate is 4 keV. Its variance is (4+4+2×2)/4=3 keV2(4+4+2\times2)/4=3\,\mathrm{keV^2}. The difference is minus four keV and has variance 4+4−2×2=4 keV24+4-2\times2=4\,\mathrm{keV^2}. Thus the positive correlation increases uncertainty of the average compared with independence, while reducing that of the contrast. Both results use the same positive-definite covariance matrix and do not require treating the readings as independent.

Take it with you

  • Weights are consequences of an uncertainty and mean model.
  • A shared offset creates off-diagonal covariance and a variance floor.
  • Averages and contrasts respond differently to correlations.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.