Variance of Linear Combinations and Covariance
Statement
For random variables X1, …, Xn with finite variances and fixed real constants a1, …, an, the variance of the linear combination S = ∑i ai Xi is the double sum Var(S) = ∑i ∑j ai aj Cov(Xi, Xj), which collapses to the weighted sum of variances ∑i ai2 Var(Xi) when the variables are pairwise uncorrelated.
Why it matters
Almost every measured quantity in physics is a combination of several noisy inputs: a resistance inferred from voltage and current, a rate averaged over many counts, a fitted slope built from many data points. This identity is the master formula of error propagation for linear functions — it tells you exactly how the uncertainties of the parts assemble into the uncertainty of the whole, and crucially, whether the pieces reinforce or cancel.
It also underpins the single most important result in all of statistical inference: that averaging n independent measurements shrinks the variance by a factor of n, so the standard error falls as 1/√n. The full covariance version warns you when that scaling silently breaks — correlated noise does not average away.
Assumptions
Derivation
Result
Reading. The spread of a weighted sum is a weighted sum of all pairwise spreads — each variable with itself (variance) and each pair with the other (covariance). Weights enter squared on the diagonal, so scaling a variable by a scales its variance contribution by a2. Off-diagonal covariance terms can be positive (uncertainties reinforce) or negative (they partially cancel). When inputs are uncorrelated, only the diagonal survives and variances simply add.
Units check. If Xi carries physical units [xi] then ai carries [S]/[xi], so each ai is dimensionless times a ratio and every product ai aj Cov(Xi, Xj) has units [S]2/[xi][xj] × [xi][xj] = [S]2. A variance must have the squared units of S — consistent.
Limiting cases
- Single variable (n = 1): Var(aX) = a2 Var(X) — the familiar scaling rule.
- Difference of two uncorrelated variables: Var(X − Y) = Var(X) + Var(Y); variances add even for a difference, because the weight −1 squares to +1.
- Perfectly correlated pair (Cov = σXσY): Var(X + Y) = (σX + σY)2, i.e. standard deviations add directly.
- Sample mean of iid (ai = 1/n, Var(Xi) = σ2): Var(X̄) = σ2/n, the origin of the 1/√n standard error.
- Zero net weight with anticorrelation: a suitably weighted difference of positively correlated variables can have vanishing variance, the principle behind differential measurement.
Breaks when
- Infinite or undefined variance. If any input has heavy tails with E[Xi2] = ∞ (Cauchy, some power-law noise), the covariances and hence Var(S) do not exist; the formula returns a finite number only by illegally assuming convergence.
- Random or data-dependent weights. If the ai are estimated from the same data (as in a fitted regression, or portfolio weights chosen after seeing returns), they correlate with the Xi and the treated-as-constant derivation omits genuine variance, systematically underestimating the true spread.
- Nonlinear combination. For g(X1, …, Xn) that is not linear, this is only the first-order (delta-method) approximation with ai = ∂g/∂Xi evaluated at the mean; it breaks down when curvature or fluctuations are large.
- Non-stationary / drifting means. If the μi shift during data collection, the empirical spread mixes true variance with mean drift and no fixed covariance matrix describes it.
Failure modes
- Adding standard deviations instead of variances. Writing σS = |a1|σ1 + |a2|σ2 for uncorrelated inputs. Correct is σS2 = a12σ12 + a22σ22; linear addition of σ only holds for perfect correlation.
- Forgetting the factor of 2 on cross terms — counting the (i,j) pair but not (j,i), halving the covariance contribution.
- Sign error on Var(X − Y). Assuming subtraction subtracts variances; the weight is squared, so uncorrelated variances still add.
- Dropping covariances by reflex. Assuming inputs are independent when they share a common systematic (same instrument, same calibration), which can dominate the total.
- Confusing uncorrelated with independent. Using Cov = 0 to claim independence — the derivation needs only the former; the converse does not hold.
Discussion
The double sum is best read as a quadratic form. Collect the deviations into a vector and the coefficients into a vector a; then Var(S) = aT Σ a, where Σij = Cov(Xi, Xj) is the covariance matrix. Every derived identity — scaling, additivity, error propagation — is one geometric statement about how this quadratic form responds to the direction a. Because variance is non-negative for every choice of weights, Σ is positive semi-definite; that is not an extra assumption but a consequence of the formula.
Physically, the diagonal encodes each source's own noise while the off-diagonal encodes shared fluctuation. Two thermometers on the same bench drift together with room temperature: their readings are positively correlated, and a naive sum of their variances understates the uncertainty of their total while a difference (which cancels the common drift) can be far more precise than either alone. This is exactly why lock-in and differential techniques win — they choose weights a that place the measurement in a low-variance direction of the quadratic form.
The result requires strictly less than independence. Nothing in steps 6–9 assumes the joint distribution factorises; only the numerical value Cov(Xi, Xj) = 0 is needed to reach additivity, and uncorrelatedness is weaker than independence (independent ⇒ uncorrelated, but not conversely — e.g. X and X2 for symmetric X are uncorrelated yet dependent). Thus additivity of variances is a second-moment statement, blind to any higher-order structure in the dependence. The Central Limit Theorem inherits this: it is the σ2/n scaling, not full independence of every moment, that fixes the width of the limiting Gaussian.
Common misconceptions. "Variances always add" — only for uncorrelated inputs; correlation adds cross terms that can dominate. "Independent is the requirement" — only Cov = 0 is used. "A difference reduces uncertainty" — for uncorrelated inputs a difference has the same variance as the sum; reduction requires positive correlation to cancel.
Worked examples
Reading. The blended portfolio (7.2%) is less volatile than either asset alone (20% and 10%) because the negative correlation lets one asset's swings partly offset the other's.
Units check. Returns are dimensionless fractions; variance is a pure number, σR a fraction — consistent.
Reading. Averaging 25 readings cuts the uncertainty fivefold (√25 = 5), from 0.30 mm to 0.060 mm — the classic 1/√n improvement.
Units check. Var in mm2, standard error in mm — correct dimensions for a length uncertainty.
Problems
- Two uncorrelated timers each have σ = 0.5 s. Find the standard deviation of their difference T1 − T2.
Solution
Var(T1 − T2) = (1)2(0.5)2 + (−1)2(0.5)2 = 0.25 + 0.25 = 0.50 s2. So σ = √0.50 = 0.71 s. The variances add despite the subtraction, because both weights square to 1. - A resistance is computed as R = V/I near V0 = 10 V, I0 = 2 A, with independent σV = 0.1 V, σI = 0.02 A. Using the linear (delta-method) approximation, find σR.
Solution
Partials: ∂R/∂V = 1/I0 = 0.5 Ω/V, ∂R/∂I = −V0/I02 = −10/4 = −2.5 Ω/A. Var(R) = (0.5)2(0.1)2 + (2.5)2(0.02)2 = 0.0025 + 0.0025 = 0.0050 Ω2. So σR = 0.071 Ω about R0 = 5 Ω (a 1.4% relative error, matching √(0.012 + 0.012)). - Show that for constants a, b and any two variables, Var(aX + bY) = a2Var(X) + b2Var(Y) + 2ab Cov(X,Y), then find the value of b/a that minimises the variance for fixed a.
Solution
Expanding the n = 2 double sum gives the stated form directly. Treat as a function of b: d/db [b2Var(Y) + 2ab Cov] = 2b Var(Y) + 2a Cov = 0 ⇒ b/a = −Cov(X,Y)/Var(Y). This is the optimal hedge ratio; substituting back gives the minimum variance a2Var(X)(1 − ρ2). - Ten counts of a radioactive source are summed, each Poisson with mean and variance λ = 100, mutually independent. Find the variance and the fractional uncertainty of the total N = ∑i=110 Xi.
Solution
All weights ai = 1, independent so covariances vanish: Var(N) = ∑ 12 · 100 = 1000. Mean total = 1000, so σN = √1000 ≈ 31.6, fractional uncertainty 31.6/1000 = 3.2% — consistent with Poisson 1/√(∑λ) = 1/√1000. - Two sensors reading the same quantity have σ1 = σ2 = 2 units but share a systematic drift giving Cov = +3 units2. Compare the variance of the average (X1 + X2)/2 against the naive "independent" prediction.
Solution
With ai = 1/2: Var = (1/4)(4) + (1/4)(4) + 2(1/2)(1/2)(3) = 1 + 1 + 1.5 = 3.5 units2. The naive independent estimate would give only 1 + 1 = 2 units2. The positive covariance means averaging does not beat the common systematic down — the true spread (σ = 1.87) is larger than the σ = 1.41 one would wrongly predict.