School/✦ Research Engineer/Week 16
Inverse-variance weighting
Two sensors measure the same distance. One is twice as precise. Should you trust it twice as much? Four times? All the way?
About 40 min · 3 goals · Checked by automated tests
1.Why should I care?
This one formula is the foundation of sensor fusion: GPS with odometry, star tracker with gyro, camera with lidar. It says how much to trust each source and promises a result better than the best single sensor, if its assumptions hold.
- ◇ Fuse two independent unbiased measurements by inverse-variance weighting.
- ◇ Derive that these weights minimise the fused variance.
- ◇ State the fused uncertainty and the conditions under which it is valid.
2.Predict
Sensor A has σ = 1 m, sensor B has σ = 2 m. What weight should A get in the optimal blend?
Guess first. Being wrong here is how the surprise works.
3.Discover
Set σ₁ = 1, σ₂ = 2. Drag your weight w from 0 to 1 and watch the lower curve: the blend's σ dips to a minimum. Find it by hand, then press 'snap' to check. Repeat with equal σ's: where is the minimum now, and what is the fused σ?
Loading the interactive…
Can't use the interactive? Read a description instead
The fusion diagram plots both sensor curves, your blend and the optimal fusion, plus a curve of blend σ against weight with its minimum marked. The readout gives the optimal weight, fused value and σ, and how far your chosen weight is from optimal.
4.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1
Sensor σ's are 2 m and 4 m. What weight does the 2 m sensor get?
5.Watch
→ Listen for the reasons to fuse: improving quality, increasing coverage and estimating things no single sensor measures.
Explains why robots and cars combine several imperfect sensors to get a better picture of the world.
12 min 35 s · captions on YouTube · source
Nothing loads from YouTube until you press play.
The video is optional: everything you need is also in the lesson text and the interactive.
6.Understand
The recipe
x̂ = (z₁/σ₁² + z₂/σ₂²)/(1/σ₁² + 1/σ₂²) and σ_f = 1/√(1/σ₁² + 1/σ₂²). The fused value sits between the readings, closer to the more precise one; the fused σ is smaller than the smaller σ. Two equal sensors give σ/√2.
The fine print
It assumes both readings are unbiased, independent and have correctly known σ. A biased sensor drags the fused value with full confidence. Correlated errors (two cameras with the same calibration fault) give less improvement than the formula promises.
A consistency check
If the readings disagree by much more than √(σ₁² + σ₂²), something is wrong: a fault, a bias, a wrong σ. Real systems test the difference before fusing and reject outliers. In Kalman language this is innovation gating.
Explain it another way
A friend with sharp eyes and a friend with blurry eyes both guess the distance to a tree. You lean towards sharp-eyes, but blurry-eyes still adds a little information, so together they beat either one.
This is the minimum-variance unbiased linear estimator, and for Gaussian errors also the maximum-likelihood estimate. It is identical to the conjugate normal update with one reading as prior.
z₁ = 10, σ₁ = 3; z₂ = 13, σ₂ = 2: weights 1/9 and 1/4, w₁ = 4/13 ≈ 0.31. x̂ = (10/9 + 13/4)/(13/36) ≈ 12.08, σ_f = √(36/13) ≈ 1.66.
Deep-space orbit determination fuses radio range, Doppler and optical images of the target body; each pass is weighted by its accuracy, so a few very precise range points can outweigh many noisy ones.
Derivation: Why inverse-variance weights are optimal
Blend two independent unbiased readings: x̂ = w·z₁ + (1 − w)·z₂. It is unbiased for any w.
Its variance is V(w) = w²σ₁² + (1 − w)²σ₂² (no cross term, by independence).
Minimise: dV/dw = 2wσ₁² − 2(1 − w)σ₂² = 0 ⇒ w = σ₂²/(σ₁² + σ₂²) = (1/σ₁²)/(1/σ₁² + 1/σ₂²).
d²V/dw² = 2(σ₁² + σ₂²) > 0, so this is a minimum.
Substitute back: V_min = σ₁²σ₂²/(σ₁² + σ₂²), i.e. 1/σ_f² = 1/σ₁² + 1/σ₂². For n sensors, weights ∝ 1/σᵢ² and precisions add.
Worked example 1
Readings 10 (σ = 3) and 13 (σ = 2). Fuse them.
Weights 1/9 : 1/4 = 4 : 9. x̂ = (4 × 10 + 9 × 13)/13 ≈ 12.08. σ_f = 6/√13 ≈ 1.66.
Common mix-ups
- Fusing with a worse sensor makes the result worse.
✓ With correct σ's and independent, unbiased errors, adding any sensor can only help (its weight shrinks as it gets worse). - Twice as precise means twice the weight.
✓ Weight goes with 1/σ², so twice as precise means four times the weight.
7.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2 · a fresh version every time
A sun sensor puts the rover's heading at z₁ = 10° with σ₁ = 1°, and a gyro-integrated heading reads z₂ = 13° with σ₂ = 1° (independent). What is the inverse-variance fused heading, in degrees?
Practice 3 · a fresh version every time
Radio ranging gives a spacecraft's distance with σ₁ = 2 km and an optical navigation fix gives it with σ₂ = 3 km (independent). What is the σ of the optimally fused distance, in km?
Practice 4
Sensor B has a hidden +5 m bias but claims σ = 0.5 m; sensor A is unbiased with σ = 2 m. The fused estimate will be…
Practice 5
Three independent sensors each have σ = 3 cm. What is the σ of their optimal fusion, in cm?
8.Apply it
Write a 'fuse-or-reject' rule for two range sensors: fuse if |z₁ − z₂| < 3√(σ₁² + σ₂²), otherwise flag a fault. Test it in the diagram with σ's of 1 and 2 m: what readings trigger the flag?
9.Reflect
Concepts: Sensor fusion · Statistical estimation: bias, variance and likelihood