physics2u
Tier
⌕ Search ⌘K
physics2u.com/vault/error-propagation-covariance-matrix.html
Derivation

Propagation with the Covariance Matrix

Statement

Given a random input vector x ∈ ℝn with mean μ and covariance matrix Σx, and a differentiable vector-valued map y = f(x) with f: ℝn → ℝm, the covariance of the output to first order is Σy = J Σx JT, where J is the m×n Jacobian Jij = ∂fi/∂xj evaluated at μ.

Why it matters

Every measured quantity carries uncertainty, and real experiments almost never measure the final quantity of interest directly — they measure several correlated inputs and combine them. The covariance matrix is the complete second-order description of that joint uncertainty, and the Jacobian law tells you exactly how it transforms when you push the inputs through any smooth function. It is the workhorse of least-squares fitting, Kalman filtering, GPS trilateration, particle-physics track reconstruction, and any calibration chain.

Crucially, it handles correlations. Naive scalar error propagation, applied component-by-component, silently assumes the inputs are independent and the outputs are uncorrelated. Both assumptions are usually false, and both can move an error bar by a large factor. The matrix form is the honest bookkeeping that keeps off-diagonal terms where they belong.

Assumptions
The map f is differentiable at the operating point μ.Without a well-defined Jacobian there is no linear model to propagate; at a kink or cusp the local slope is undefined and the formula returns a meaningless number.
Fluctuations are small compared with the scale over which f curves.The derivation truncates the Taylor series at first order; if the input spread probes appreciable curvature, the linear term no longer captures the transformation and a bias plus higher moments appear.
The input covariance Σx exists and is finite.Distributions with undefined or infinite second moments (e.g. Cauchy) have no covariance to propagate, and the entire construction is vacuous.
The mean of x coincides with the expansion point.If you linearise about a point other than E[x], the first-order term contributes a spurious mean shift into the variance bookkeeping, and cross terms no longer vanish under the expectation.
Second moments alone are the object of interest (a Gaussian-adequate description).If the downstream use needs the full distribution shape, note that even a linear map only preserves Gaussianity exactly; for non-Gaussian inputs the propagated Σy is correct as a covariance but does not determine higher moments.
Derivation
1
y = f(x) = f(μ) + J(xμ) + O(‖xμ2)
First-order multivariate Taylor expansion of each component fi about the mean; Jij = ∂fi/∂xj|μ collects the partials into one matrix. A
2
δxxμ,   δyy − E[y] ≈ J δx
Take the expectation of step 1: E[δx] = 0 by definition, so E[y] ≈ f(μ), and subtracting leaves the fluctuation linear in δx. A
3
Σy = E[δy δyT]
Definition of the covariance matrix of y as the expected outer product of its mean-centred fluctuations. A
4
Σy = E[(Jδx)(Jδx)T]
Substitute the linearised fluctuation from step 2. Legal because the truncation error is second order and dropped consistently. B
5
Σy = E[J δx δxT JT]
Reverse-order transpose law (AB)T = BTAT applied to (Jδx)T = δxTJT. B
6
Σy = J E[δx δxT] JT
Expectation is linear and J is a constant matrix (evaluated at the fixed point μ), so it pulls outside the expectation on both sides. This is the step that fails if J itself is random, i.e. if it must be evaluated at the fluctuating x. C
7
Σy = J Σx JT
Recognise E[δx δxT] = Σx by the definition used in step 3, closing the derivation. A
Result
Σy = J Σx JT,   Jij = ∂fi/∂xjμ

Reading. The output covariance is a two-sided congruence of the input covariance by the Jacobian: J maps the “shape” of the input uncertainty ellipsoid into output space, and the transpose on the right guarantees the result is again a symmetric, positive-semidefinite matrix. Diagonal entries of Σy are the variances of each yi; off-diagonal entries are the induced covariances — even if the inputs were uncorrelated, sharing input variables through J makes the outputs correlated.

Units check. Each Jacobian entry Jij has units [yi]/[xj]. A Σx entry has units [xj][xk]. The product (xJT)il = ∑jk Jij (Σx)jk Jlk carries units ([yi]/[xj])·[xj][xk]·([yl]/[xk]) = [yi][yl], exactly a covariance of outputs.

Limiting cases
  • Scalar output (m = 1): J is a row vector gT = (∂f/∂x1, …) and the formula collapses to σy2 = gTΣxg = ∑jk (∂f/∂xj)(∂f/∂xk)(Σx)jk, the standard scalar propagation law with covariance terms.
  • Uncorrelated inputs: Σx = diag(σ12, …, σn2) and the scalar case reduces further to σy2 = ∑j (∂f/∂xj)2σj2, the familiar “add in quadrature” rule.
  • Linear map f(x) = A x + b: the Jacobian is exactly A everywhere, so Σy = A Σx AT holds without any approximation and for any input distribution.
  • Change of coordinates / rotation: if J = R is orthogonal (RTR = I), the transformation is a similarity that rotates the uncertainty ellipsoid; its eigenvalues (variances along principal axes) are preserved.
  • Single input, single output: J = f′(μ) and σy = |f′(μ)| σx, the elementary one-variable rule.
Breaks when
  • Strong nonlinearity over the input spread. If f curves appreciably across ±σ, the neglected second-order term is not small: the mean picks up a bias ½∑jk (∂2fi/∂xjxk)(Σx)jk, and the propagated variance can be wrong by tens of percent. Example: y = 1/x when σxx is not « 1.
  • Singular or ill-conditioned Jacobian. Near a stationary point (∂f/∂xj → 0) the leading term vanishes and the variance is dominated by the discarded quadratic term; the linear estimate underpredicts — often catastrophically — the true spread. Classic case: an extremum, where y is quadratic in the deviation.
  • Heavy-tailed or undefined-moment inputs. If Σx does not exist (Cauchy, some power-law tails), there is nothing to propagate; sample estimates of variance will not converge and the output error bar is meaningless.
  • Discontinuous or non-smooth f. Thresholds, absolute values, rounding, or clamping have no Jacobian at the break point; the local linearisation is undefined and the formula cannot be applied there.
Failure modes
  • Dropping the off-diagonal terms of Σx. Treating correlated inputs as independent and adding in quadrature; for strongly anti-correlated inputs this can overestimate the true error by a large factor (a difference of two positively correlated quantities is less uncertain than quadrature suggests).
  • Forgetting the induced output correlations. Reporting only the diagonal of Σy and then feeding those “independent” variances into a further calculation, discarding the off-diagonal information that the shared inputs created.
  • Evaluating J at the wrong point. Using the measured sample value instead of the best estimate of the mean, or (worse) leaving J symbolic and never numerically evaluating it at μ.
  • Transpose slip. Writing JTΣxJ (which has the wrong dimensions n×n when mn) instead of xJT.
  • Mixing standard deviations and variances. Placing σ rather than σ2 on the diagonal of Σx, or reporting √(diag Σy) as a variance.
  • Unit inconsistency in J. Building the Jacobian from a formula written in one unit system while Σx is expressed in another (degrees vs radians is the perennial offender in angle derivatives).
Discussion

The formula is a statement about how quadratic forms transform under linear maps. The input uncertainty is geometrically an ellipsoid δxTΣx−1δx = const in input space; the Jacobian maps that ellipsoid, to first order, onto a new ellipsoid in output space, and xJT is precisely the covariance whose inverse defines the image. That is why the construction always returns a symmetric positive-semidefinite matrix: for any vector v, vT(xJT)v = (JTv)TΣx(JTv) ≥ 0 because Σx is itself positive-semidefinite. Positive-semidefiniteness (not strict positivity) is important: if J has a nontrivial null space — fewer effective outputs than inputs — some directions in output space carry zero variance, and Σy is genuinely singular.

The result generalises two prior results into one object. The scalar first-order error-propagation formula and the variance-of-linear-combinations rule are both special cases: the former is the single-output projection, the latter is the exact statement for the linear map f = A x. Seeing them as diagonal-and-scalar shadows of the matrix law is the conceptual payoff — you stop memorising three formulas and carry one.

Connections run deep in applied statistics. In linear least squares, the fitted parameters are θ̂ = (ATW A)−1ATW y, a linear map of the data, so their covariance Σθ = (ATW A)−1 (with W = Σy−1) is exactly this law applied to the design matrix. In the Kalman filter, the predict step is P = F P FT + Q — the same congruence by the state-transition Jacobian, with process noise added. The extended Kalman filter is nothing more than this formula with F the Jacobian of a nonlinear dynamics evaluated at the current estimate, which is also where its well-known divergence under strong nonlinearity comes from.

A subtle and important point is that xJT propagates only the second moment, and for a nonlinear f the output mean is not simply f(μ). The next term in the expansion contributes a deterministic bias E[yi] ≈ fi(μ) + ½ tr(Hi Σx), where Hi is the Hessian of the i-th component. Practitioners who need the mean to matching order, or who face appreciable curvature, abandon the linearisation for the unscented transform (propagate a deterministic set of sigma points and reconstruct mean and covariance) or Monte Carlo. These methods reproduce xJT in the small-fluctuation limit but remain correct when it fails, which is exactly why they exist.

Common misconceptions. The formula does not require the inputs to be Gaussian — it is a statement about second moments alone and holds for any distribution with a finite covariance. What Gaussianity buys you is that, for a linear map, the output is again exactly Gaussian and so Σy is the complete description; for a nonlinear map even Gaussian inputs give non-Gaussian outputs. A second misconception is that uncorrelated inputs give uncorrelated outputs: sharing input variables through the rows of J generically produces off-diagonal terms in Σy.

Worked examples

Example 1 — Polar to Cartesian with correlated-looking output. A radar returns range r and bearing θ. Convert to Cartesian (x, y) = (r cosθ, r sinθ) and propagate the covariance. Take r = 100 m with σr = 2 m, θ = 30° with σθ = 0.02 rad, uncorrelated inputs.

1
J = ( cosθ   −r sinθ ;   sinθ   r cosθ )
Partial derivatives of (x, y) with respect to (r, θ); rows index outputs, columns index inputs. A
2
J = ( 0.8660   −50.0 ;   0.5000   86.60 )
Numbers: cos30° = 0.8660, sin30° = 0.5000, r sinθ = 50.0 m, r cosθ = 86.60 m. Units of column 2 are metres per radian. A
3
Σx = diag(σr2, σθ2) = diag(4.00 m2, 4.00×10−4 rad2)
Diagonal because inputs are uncorrelated; σθ2 = (0.02)2. A
4
Σy = J Σx JT;   (Σy)11 = cos2θ σr2 + r2sin2θ σθ2
Carry out the two-sided product; the (1,1) entry is the sum over the two input contributions to Var(x). B
5
Var(x) = (0.75)(4.00) + (2500)(4.00×10−4) = 3.00 + 1.00 = 4.00 m2
cos230° = 0.75, r2sin2θ = (100)2(0.25) = 2500 m2. A
6
Var(y) = sin2θ σr2 + r2cos2θ σθ2 = (0.25)(4.00) + (7500)(4.00×10−4) = 1.00 + 3.00 = 4.00 m2
The (2,2) entry; r2cos2θ = 7500 m2. A
7
Cov(x,y) = cosθ sinθ σr2r2sinθ cosθ σθ2 = (0.4330)(4.00) − (4330)(4.00×10−4) = 1.732 − 1.732 = 0
Off-diagonal (1,2) entry; here the two contributions happen to cancel at θ = 30° with these numbers. B
Σy = ( 4.00   0.00 ;   0.00   4.00 ) m2,   σx = σy = 2.0 m

Reading. The Cartesian position uncertainty is 2.0 m in each axis and, for this particular geometry, uncorrelated. The output correlation is a coincidence of these numbers, not a general feature — at other bearings Cov(x,y) ≠ 0 even though the inputs stay independent.

Example 2 — Sum and difference of two correlated measurements. Two voltmeters read V1 = 5.00 V and V2 = 3.00 V, each with σ = 0.10 V, but they share a common reference so their readings are positively correlated with correlation coefficient ρ = 0.6. Compute the covariance of the sum s = V1 + V2 and difference d = V1V2.

1
J = ( 1   1 ;   1   −1 )
The map (s, d) = (V1+V2, V1V2) is linear, so J is constant and the propagation is exact. A
2
(Σx)12 = ρ σ1 σ2 = (0.6)(0.10)(0.10) = 6.0×10−3 V2
Off-diagonal entry from the correlation coefficient definition ρ = Cov/(σ1σ2). A
3
Σx = ( 0.0100   0.0060 ;   0.0060   0.0100 ) V2
Diagonal entries σ2 = 0.0100 V2; symmetric off-diagonals from step 2. A
4
Var(s) = σ12 + σ22 + 2Cov = 0.0100 + 0.0100 + 2(0.0060) = 0.0320 V2
Row 1 of xJT; positive correlation inflates the sum's variance. B
5
Var(d) = σ12 + σ22 − 2Cov = 0.0100 + 0.0100 − 2(0.0060) = 0.0080 V2
Row 2; positive correlation shrinks the difference's variance — the shared error cancels. B
6
Cov(s,d) = σ12 − σ22 = 0.0100 − 0.0100 = 0
Cross term (1,2) of the output; equal input variances make sum and difference uncorrelated. B
Σy = ( 0.0320   0 ;   0   0.0080 ) V2;   σs = 0.179 V, σd = 0.089 V

Reading. Ignoring the correlation (setting Cov = 0) would give σs = σd = 0.141 V for both. The shared reference makes the sum more uncertain (0.179 V) and the difference less uncertain (0.089 V). Ratios and differences of correlated quantities routinely beat the quadrature estimate — this is the whole reason to keep off-diagonal terms.

Problems
  1. (Warm-up) For y = x1x2 with x1 = 4.0 ± 0.2, x2 = 5.0 ± 0.3 (uncorrelated), find σy using the Jacobian law.
    Solution J = (∂y/∂x1, ∂y/∂x2) = (x2, x1) = (5.0, 4.0). With Σx = diag(0.04, 0.09): σy2 = (5.0)2(0.04) + (4.0)2(0.09) = 1.00 + 1.44 = 2.44, so σy = 1.56. Since y = 20.0, the relative error 1.56/20.0 = 7.8% equals √((0.2/4)2 + (0.3/5)2) = √(0.0025+0.0036) as expected for a product.
  2. (Correlation matters) Repeat problem 1 but now with correlation ρ = −0.5 between x1 and x2. Does σy rise or fall?
    Solution Cov = ρσ1σ2 = (−0.5)(0.2)(0.3) = −0.030. The scalar law gains a cross term 2J1J2Cov = 2(5.0)(4.0)(−0.030) = −1.20. So σy2 = 2.44 − 1.20 = 1.24, σy = 1.11. Negative correlation reduces the product's uncertainty from 1.56 to 1.11.
  3. (Two outputs) Let (u, v) = (x + y, x2) with x = 2.0, y = 1.0, σx = 0.1, σy = 0.2, uncorrelated. Find the full 2×2 output covariance, including Cov(u,v).
    Solution J = ( 1   1 ; 2x   0 ) = ( 1   1 ; 4   0 ). Σx = diag(0.01, 0.04). Var(u) = 1·0.01 + 1·0.04 = 0.05. Var(v) = 42·0.01 + 0 = 0.16. Cov(u,v) = (1)(4)(0.01) + (1)(0)(0.04) = 0.04. So Σy = ( 0.05   0.04 ; 0.04   0.16 ). Note the outputs are correlated (through the shared variable x) despite independent inputs; correlation coefficient = 0.04/√(0.05·0.16) = 0.45.
  4. (Rotation preserves area) An uncertainty ellipse has Σx = diag(9, 1) (units cm2). Apply a 45° rotation R = (1/√2)( 1   −1 ; 1   1 ). Find Σy and verify its determinant (and hence the ellipse area) is unchanged.
    Solution Σy = xRT. Compute x = (1/√2)( 9   −1 ; 9   1 ); then times RT = (1/√2)( 1   1 ; −1   1 ): Σy = ½( 9+1   9−1 ; 9−1   9+1 ) = ( 5   4 ; 4   5 ). det Σy = 25 − 16 = 9 = det Σx (9·1). Rotation preserves the determinant because det R = 1, so det(xRT) = det Σx; the ellipse area π√det is invariant.
  5. (Where it breaks) For y = x2 with x = 0.0 ± 0.5, the Jacobian law predicts σy = 0. Explain why, and compute the true standard deviation of y assuming x is Gaussian.
    Solution J = 2x = 0 at x = 0, so the first-order estimate gives σy = |2xx = 0 — a singular Jacobian (stationary point), a documented failure regime. The true spread lives entirely in the discarded quadratic term. For x ~ N(0, σ2) with σ = 0.5: E[y] = E[x2] = σ2 = 0.25; E[y2] = E[x4] = 3σ4 = 3(0.0625) = 0.1875; Var(y) = 0.1875 − 0.0625 = 0.125, so σy = 0.354 (= √2 σ2), definitely not zero. The lesson: at a stationary point of f, propagate with the second-order term or by direct computation.