Covariance Intersection

Two robots each say a wall is 10 m away, give or take 2 m. Robot B copied its number from A. A fuser that assumes they are independent claims ±1.4 m, and 16% of its real errors land outside a band that should miss only 5%. Covariance intersection never claims more than the worst case allows.

Choose a fuser. Drag the hidden correlation, then let the fused answer echo back. Watch the red dots that escape the claimed band. Then we build, piece by piece, consistency, the CI update, its geometry and how to choose its one weight.

You need inverse-variance fusion and the idea of a variance. We build the rest from zero.

Lesson 11 of the series Sensor Fusion: Classical to Modern. Covariance intersection comes from Julier and Uhlmann (1997). The devices and toy numbers are our own.

Fuse two robots that share a past

1.00
1

An illustrative toy. Each robot's estimate has variance 4 m². The dots are 240 simulated fused errors. An echo round fuses the last answer with a copy of itself. Both fusers give the same fused number here; only the claimed variance differs.

Chapter 0

The Echo That Looks Like Evidence

Fuse a copy as if it were a new witness, and watch the variance fall for no reason

Two robots roll down a corridor. Robot A says the far wall is 10.0 m away. Robot B says 9.0 m. Each has a variance of 4 m², a spread of about 2 m. They radio each other and fuse.

The rule from Lesson 3 adds precisions. Precision is one over the variance: how much an estimate knows. Call the variances σA² and σB², and the fused variance σf².

Say it aloud

One over sigma-f squared equals one over sigma-A squared, plus one over sigma-B squared.

1/σf²
one over sigma-f squared the fused precision, in 1/m².
1/σA²
one over sigma-A squared robot A's precision.
1/σB²
one over sigma-B squared robot B's precision.
In plain words

Turn each variance into a precision. Add the two precisions. One over the sum is the fused variance σf².

With numbers

With σA² = σB² = 4 m²: 1/4 + 1/4 = 0.5, so σf² = 2 m². The rule halves the variance.

The rule is right only if A and B are independent: their errors share nothing. But B got its last fix from A. If B is a copy of A, two copies hold the same knowledge as one. The honest variance stays 4 m², and the rule reports 2 m².

Echo one estimate around a loop

Round 1 fuses A with B. Each later round fuses the answer with its own echo. Set how much A and B share, then run.

1.00

Illustrative. Both inputs have variance 4 m². The honest variance of round 1 is 2(1 + correlation) m², derived in Chapter 2. An echo adds nothing, so it stays.

This loop is data incest: information that comes back to its source and counts again. Lesson 2 fixed it by subtracting a shared part it knew. In a real network you cannot see the paths, so you cannot subtract.

Symptom: the reported variance keeps falling while no new sensor reading arrives.

Measure: plot the reported variance per fusion and mark when fresh readings came in.

Fix: a fusion rule that stays honest for any correlation. That is covariance intersection (CI), from Julier and Uhlmann, 1997.

The road

  1. Consistency: what "honest" means for a variance.
  2. What correlation does: the real variance of a blend. The hero's slider.
  3. The CI update: weights that sum to one. The hero's second button.
  4. The geometry: why CI is safe for every correlation.
  5. Choosing ω: the tightest honest answer.
  6. CI against naive over time: the echo rounds, measured.
  7. The sandbox: two ellipses, every knob.
  8. Split CI and where CI ships: use what you do know.
  9. Debugging with NEES: which mistake you made.
  10. The field guide: numbers, code, links and sources.
Robot B copied its wall estimate from A. Both say variance 4 m². What is the honest fused variance?

Chapter 1

Consistency: Never Claim More Than You Know

Turn "honest" into a test a variance can pass or fail

An estimate is two things. The mean x̂ is the best guess of the true value x. The covariance P is the claimed uncertainty. P is a promise: the truth is probably this close to the guess.

The error is x̂ − x, how far the guess is from the truth. Over many runs the errors have a real spread. An estimate is consistent if its claimed P is at least that real spread.

Say it aloud

P is at least the expected value of x-hat minus x, times x-hat minus x transposed.

P
P the covariance the estimator claims.
≥
is at least for matrices: the claimed ellipse covers the real one in every direction.
E[ ]
the expected value of the average over many runs.
x̂ − x
x-hat minus x the error: the guess minus the truth.
(·)T
transposed the error times itself as a matrix. In one dimension it is the error squared.
In plain words

Square the error x̂ − x on each run. Average the squares. The claimed P must be at least that average.

With numbers

With made-up numbers: a filter claims P = 2 m². Five errors are −1.8, 2.4, 0.6, −2.9 and 1.7 m. Their squares average to 20.66 / 5 = 4.13 m². Since 2 < 4.13, the filter is inconsistent.

Shrink the claim until it lies

The dashed ellipse is the real error spread. The solid one is the claim. Drag the claim smaller and find where it stops covering the truth.

1.60

Illustrative 2-D errors with a tilted true covariance. The margin is the smallest eigenvalue of the claim minus the truth. Below zero, the claim is inside the truth in some direction.

A claim that is too big wastes accuracy but never misleads. Too small is the one failure. A controller or a gate that trusts a too-small P acts on a lie. A gate rejects readings that look unlikely under P, so a falsely tight filter throws away the corrections it needs.

Symptom: errors land outside the claimed bounds far more often than the bounds promise.

Measure: on runs with known truth, average the squared error and compare it with P (Chapter 9).

Fix: find what the filter counts twice, or what noise it leaves out.

A filter claims P = 1 m². Its average squared error is 3 m². What is it?

Chapter 2

What Correlation Does to a Blend

Compute the real variance of a fused guess, and find its worst case

Both robots report 4 m². The fused guess is a blend of the two: a weight w on A and 1 − w on B. How spread out is the blend? It depends on how the two errors move together.

The correlation ρ measures that. At ρ = 0 the errors are independent. At ρ = 1 they rise and fall together, as with a copy. At ρ = −1 they cancel. Call the two variances σA² and σB², and the real variance of the blend V.

Say it aloud

V equals w squared sigma-A squared, plus one minus w, squared, times sigma-B squared, plus two w times one minus w, times rho, sigma-A, sigma-B.

V
V the real variance of the blended guess, in m².
w²
w squared the weight on A, from 0 to 1, squared.
σA²
sigma-A squared robot A's variance.
σB²
sigma-B squared robot B's variance; its weight is 1 − w.
2w(1 − w)
two w times one minus w how much the two weights overlap.
ρ
rho the correlation of the two errors, from −1 to 1.
σAσB
sigma-A sigma-B the two spreads multiplied; times ρ, it is the shared part.
In plain words

Add each source's variance, scaled by its weight squared. Then add the shared part: ρ times both spreads, times 2w(1 − w). The total is V.

With numbers

With σA² = σB² = 4, w = 0.5 and ρ = 0.5: V = 1 + 1 + 2 × 0.25 × 0.5 × 2 × 2 = 3 m². The naive rule claimed 2.

Slide the hidden correlation

The dashed line is the real variance V for every correlation. The flat lines are what each fuser claims. Drag ρ and see who covers the truth.

0.50

Both variances are 4 m² and w = 0.5. The CI line is the result of Chapter 3.

V rises with ρ. Its largest value, 4 m², is at ρ = 1, a perfect copy. A claim of 4 m² covers every possible ρ. That is the whole strategy: claim the worst case, so the hidden ρ never matters.

Symptom: a fused filter is honest in a lab test and overconfident in the field.

Measure: in the lab the sources had fresh, separate noise (ρ near 0). In the field they share a map or a prior.

Fix: test with sources that share history, and use a rule that covers ρ = 1.

Two estimates of 4 m² are blended half and half. Which correlation gives the largest real variance, and what is it?

Chapter 3

The Covariance Intersection Update

Replace a sum of precisions with a blend whose weights add to one

The naive rule adds both precisions with weight 1 each. It takes all of A plus all of B. CI keeps the same form and changes the weights to ω and 1 − ω, which add to one. ω (omega) is a trust dial from 0 to 1.

In more than one dimension, precision is a matrix: the inverse covariance P−1, called the information matrix. Call the two input covariances P1 and P2, and the fused one PCI.

Say it aloud

P-C-I inverse equals omega times P-one inverse, plus one minus omega, times P-two inverse.

PCI−1
P-C-I inverse the fused information. Invert it to get PCI.
ω
omega the weight on source 1, from 0 to 1.
P1−1
P-one inverse source 1's information. In 1-D, 1/σ1².
1 − ω
one minus omega the weight left for source 2.
P2−1
P-two inverse source 2's information.
In plain words

Scale source 1's information by ω and source 2's by 1 − ω. Add them. Invert the sum to get PCI.

With numbers

With σ1² = σ2² = 4 m² and ω = 0.5: 0.5 × 0.25 + 0.5 × 0.25 = 0.25, so PCI = 4 m². CI keeps the worst-case 4 m² from Chapter 2.

The fused mean uses the same weights. Call the input means x̂1 and x̂2, and the fused mean x̂CI.

Say it aloud

P-C-I inverse times x-hat-C-I equals omega P-one inverse x-hat-one, plus one minus omega, P-two inverse x-hat-two.

PCI−1
P-C-I inverse the fused information from the line above.
x̂CI
x-hat-C-I the fused mean, the unknown here.
ω
omega the same weight as above.
x̂1
x-hat-one source 1's mean.
x̂2
x-hat-two source 2's mean.
In plain words

Weight each mean by its scaled information. Add the two. Multiply by PCI to get x̂CI.

With numbers

With x̂1 = 10.0 m, x̂2 = 9.0 m and the numbers above: 0.5 × 0.25 × 10 + 0.5 × 0.25 × 9 = 2.375. Then x̂CI = 4 × 2.375 = 9.5 m.

Turn the trust dial

Blue is robot A, warm is robot B. Teal is the CI answer for your ω; yellow is the naive one. Pick a pair, then turn ω.

Inputs:
0.50

Illustrative 1-D estimates: A says 10.0 m and B says 9.0 m.

At ω = 1, CI returns A exactly. At ω = 0, it returns B. Between them it slides. Try the sharp and vague pair: no ω gives a variance below A's 1 m². In one dimension CI never beats the better source. Chapter 5 shows where it does gain.

Symptom: the CI variance comes out smaller than both inputs in a 1-D test.

Measure: check that the two weights add to exactly one.

Fix: a weight of 1 on both terms is the naive sum, not CI.

What is the one change that turns naive information fusion into CI?

Chapter 4

Why It Is Safe: The Intersection

Draw each estimate as an ellipse, and see CI wrap the region both allow

In two dimensions a covariance draws as an ellipse: the offsets from the mean that the estimate calls likely. A thin ellipse is sure in one direction and vague in the other. The overlap of two ellipses is a lens. Every point in the lens is plausible to both sources.

Measure how far an offset x lies from the mean, in units of each source's spread. Call that d1(x) for source 1 and d2(x) for source 2. A point is inside an ellipse when its d is 1 or less.

Say it aloud

d-C-I of x equals omega times d-one of x, plus one minus omega, times d-two of x.

dCI(x)
d-C-I of x the distance of offset x measured by the CI ellipse, xTPCI−1x.
ω
omega the CI weight.
d1(x)
d-one of x the distance by source 1's ellipse, xTP1−1x.
d2(x)
d-two of x the distance by source 2's ellipse.
In plain words

The CI distance is a weighted average of the two source distances, because PCI−1 is that average. If d1 and d2 are both 1 or less, so is dCI. So every lens point is inside the CI ellipse.

With numbers

With made-up numbers: a lens point has d1 = 0.8 and d2 = 1.0. At ω = 0.5, dCI = 0.4 + 0.5 = 0.9. That is under 1, so the point is inside.

Sweep ω around the lens

The shaded lens is where both sources allow the truth. Sweep ω and watch the teal CI ellipse. Then show the naive ellipse.

0.50

Illustrative covariances, both with determinant 4: source 1 is long and turned 20 degrees, source 2 turned 110 degrees. Both share one centre so the lens is the pure covariance overlap.

The CI ellipse passes through the four corners of the lens for every ω. The naive ellipse is the opposite. Its distance is d1 + d2, so it lies inside the lens and cuts off points both sources still allow. That cut is the overconfidence.

Julier and Uhlmann prove more. For every correlation between the two errors, the real covariance of the CI estimate is at most PCI. The 1-D check is Chapter 2's device. The real variance tops out at 4 m², exactly CI's claim.

Symptom: a "CI" ellipse sits inside the lens.

Measure: test the four lens corners: each should have dCI = 1.

Fix: the code adds information with weights 1 and 1. Use ω and 1 − ω.

Why must an honest fused ellipse contain the whole lens?

Chapter 5

Choosing ω: The Tightest Honest Answer

Search one number for the smallest ellipse that is still safe

Every ω is honest. They differ in size, and we want the smallest honest ellipse. The size of an ellipse is its area. The determinant of a covariance, det P, grows with the square of that area, so a smaller det means a tighter estimate.

Call the best weight ω* (omega-star). It is the one that makes det PCI smallest.

Say it aloud

Omega-star is the omega between zero and one that makes the determinant of P-C-I of omega smallest.

ω*
omega-star the chosen weight.
argminω ∈ [0,1]
the omega in zero to one that makes it smallest a search over one number.
det
the determinant of the size of the ellipse; in 1-D, the variance itself.
PCI(ω)
P-C-I of omega the CI covariance at that weight, from Chapter 3.
In plain words

For each ω from 0 to 1, build PCI(ω) and take its determinant. Keep the ω with the smallest determinant. That is ω*.

With numbers

In 1-D with variances 1 and 9 m²: ω = 0 gives 9, ω = 0.5 gives 1.8, ω = 0.9 gives 1.10, ω = 1 gives 1.0. So ω* = 1: trust the sharp source alone.

That 1-D answer is honest and humbling. The naive rule would claim 0.9 m². CI refuses to beat the sharp source, because the vague one might be its copy. The gain comes in two dimensions, when each source is sharp in a different direction.

Find the bottom of the curve

Source 1 has variances (a, 4); source 2 has (16, 1). The curve is det PCI for every ω. Change a and watch ω* slide.

1.0

Illustrative diagonal covariances in m², the same ones as the Code Lab below. A dense search finds the minimum.

At a = 1, ω* = 0.63 and det PCI = 2.90 m⁴. Source 1 alone has det 4, source 2 alone 16. The fused ellipse beats both. The curve has one bottom, because log det PCI is convex in ω. A golden-section search finds it in about 20 tries.

Symptom: CI estimates are much wider than either input in 2-D.

Measure: print ω and det PCI on each fusion. A fixed ω = 0.5 is often far from ω*.

Fix: search ω per fusion. Minimize the trace (sum of variances) instead if one cost is cheaper.

Why search for ω* instead of always using ω = 0.5?

Chapter 6

CI Against Naive Fusion Over Time

Run both fusers on one correlated stream and measure the real error

One fusion that overclaims by 2 times is bad. A loop makes it worse. A node fuses with a neighbour every step, and the neighbour's estimate shares most of the node's own error. No fresh information arrives, yet the naive rule adds precision every step.

The device runs 300 trials at once. In each, the node starts with an error of variance 4 m². The neighbour's error is that same error times the share, plus a fresh part. Each step, both fusers update. The MSE (mean squared error) is the real error, averaged over the 300 trials.

Run 40 fusions

Solid lines are what each fuser claims. Dashed lines are its real MSE. Set the share and run.

0.90

Illustrative simulation, the same model as the Code Lab: neighbour variance 4 m², CI with ω = 0.5, 300 seeded trials.

At share 0.9, the naive claim falls from 4 to about 0.1 m² in 40 steps. Its real MSE stays near 3 m². That is about 30 times overconfident. CI's claim stays at 4 m², above its real MSE, every step.

Set the share to 0. Now the neighbour is a fresh, independent reading. The naive rule is right, its MSE falls with its claim, and CI is only cautious. The disaster needs shared information.

Symptom: after many fusions the filter rejects good readings as outliers and drifts.

Measure: the claimed variance against the real MSE on logged runs with truth.

Fix: fuse estimates of shared origin with CI, so the claim cannot fall below the worst case.

A naive fuser runs in a loop with a highly correlated neighbour. What does the log show?

Chapter 7

The CI Sandbox

Shape two estimates and predict the fused ellipse before it moves

Here is every piece at once. Two ellipses you can stretch and turn. The CI ellipse at its own ω*. The naive ellipse for contrast. Under them, the det curve with its minimum. Predict each move before you make it.

Fuse two ellipses honestly

Stretch and turn each source. Each keeps a determinant of 4, so only its shape changes. Try the three presets first.

Try:
6.0
0°
6.0
90°

Illustrative. Stretch is the ratio of the long axis to the short axis. ω* comes from a golden-section search on det PCI.

PresetWhat CI doesWhy
Round and equalreturns the same circle, ω* anywhereneither source knows anything the other lacks
Crossed sliversa compact ellipse, ω* = 0.5each source is sharp where the other is blind
Parallel sliversno gain over either sourceboth are sharp in the same direction

The gap between the teal and yellow ellipses is the price of honesty. If the sources were independent, yellow would be right. CI pays that price because it cannot rule out a copy.

Chapter 8

Split CI and Where CI Ships

Spend caution only on the part you cannot vouch for

Plain CI treats the whole variance as possibly shared. Often part of it is not. Each radar's own sensor jitter is independent of the other radar's. Only the part that came from a shared source, such as one target's random turns, can share errors.

Split covariance intersection uses that. It runs four steps:

  1. Split each variance into a shared part and an own part.
  2. Inflate source 1's shared part by dividing it by ω, and source 2's by dividing it by 1 − ω.
  3. Add each source's own part back.
  4. Fuse the two inflated variances with the naive rule, then search ω as before.

With numbers: both sources are 4 m², half shared. At ω = 0.5 each becomes 2 / 0.5 + 2 = 6 m². Fused naively: 1 / (1/6 + 1/6) = 3 m². Plain CI says 4, naive says 2, and the real worst case is 3.

Name the independent part

Drag how much of each 4 m² is the sensor's own noise. The dashed line is the real variance if the shared parts are perfect copies.

50%

Illustrative 1-D sources of 4 m² each, fused half and half. Split CI uses its best ω, found by search.

Split CI lands on the worst case exactly, so it gives up nothing it cannot prove. Newer rules such as inverse covariance intersection (Noack and others, 2017) bound the shared part in other ways and are often tighter than plain CI.

Where it shipsShared partOwn part
Track-to-track radar fusionone target's random manoeuvreseach radar's jitter
Multi-robot map merginga hallway both robots mappedeach robot's odometry noise
Cars sharing detections (V2X)a detection relayed through another careach car's own camera
Gossiping sensor networksan estimate that loops backeach node's fresh reading

Symptom: Split CI is overconfident.

Measure: check the split. Noise called "own" must be fresh, never filtered through a shared prior.

Fix: move any doubtful part into the shared part.

Both sources are 4 m², three quarters of it their own noise. What does Split CI report at ω = 0.5?

Chapter 9

Debugging with NEES

Measure which way the fuser is wrong instead of guessing

There are two ways to get correlation wrong. Ignore a real correlation, and the filter is overconfident. Assume one that is not there, and CI throws accuracy away. One number tells them apart.

Run the filter where you know the truth, in simulation or with a survey-grade reference. Call the error on one run e = x̂ − x. The NEES (normalized estimation error squared) ε is that error measured in units of the claimed P.

Say it aloud

Epsilon equals e-transpose, times P-inverse, times e.

ε
epsilon the NEES of one run, with no unit.
eT
e-transpose the error laid on its side, so the product is one number.
P−1
P-inverse the claimed information. In 1-D, 1/P.
e
e the error, x̂ − x.
In plain words

Square the error e and divide by the claimed P. Average ε over many runs. A consistent filter averages about the state dimension: 1 in 1-D.

With numbers

With made-up numbers: e = 3 m and P = 2 m² give ε = 9 / 2 = 4.5. One run proves little. An average of 2.0 over 100 runs says the claim is half the real spread.

Run the NEES test

Pick a fuser and a world. The line is the average NEES as runs come in. The band is where a consistent filter lands 95% of the time.

Illustrative 1-D toy: two estimates of 4 m², fused half and half. "Shared" means perfect copies. The band is the 95% range of the average of 100 chi-square values, 0.74 to 1.30.

Average NEESDiagnosisFix
about the dimensionconsistentnothing
far aboveoverconfident: the fuser ignores a correlationCI or Split CI for that fusion
far belowtoo cautious: CI on independent sourcesthe naive rule, or split out the own part

Symptom: estimates look mushy, and a new sensor barely shrinks the variance.

Measure: average NEES well below the dimension, such as 0.5.

Fix: if you can prove that sensor is independent, fuse it with the naive rule.

A decentralized filter has a tight, shrinking P and an average NEES of 6 in 2-D. What now?

Chapter 10

The Field Guide

Keep the terms, the numbers, the checks and the code in one place

Naive fusion adds information and is right only for independent sources. CI blends information with weights that add to one, so it is honest for any correlation. You pay with a wider answer.

TermMeaningNumber to remember
Naive fusionadd the precisions4 and 4 m² give 2 m²
Data incestinformation counted again after it loops backeach echo halves the naive claim
Consistencyclaimed P at least the real error spreadP = 2 against errors of 4.13: fails
Blend variancereal variance of a weighted guessρ = 0.5 gives 3 m²; ρ = 1 gives 4
CI updateωP1−1 + (1 − ω)P2−1(10, 4) and (9, 4) give (9.5, 4)
ω*the weight with the smallest det PCI(1, 4) and (16, 1): ω* = 0.63, det 2.90
1-D factCI never beats the better source1 and 9 m² give 1, not 0.9
Split CICI on the shared part onlyhalf shared: 3 m²
NEESerror squared in units of Paverage near the dimension

Before you fuse

  1. Ask where each estimate came from. One filter with a fresh reading: use the Kalman update.
  2. If the two estimates ever shared a reading, a map, a prior or a target, use CI.
  3. If you can name an independent part, use Split CI.
  4. Search ω on every fusion. Do not fix it at 0.5.
  5. Run a NEES test with truth before you trust any reported P.
pythonimport numpy as np

def ci_at(x1, P1, x2, P2, w):                # the CI update at one weight
    I1, I2 = np.linalg.inv(P1), np.linalg.inv(P2)
    P = np.linalg.inv(w * I1 + (1 - w) * I2)         # weights add to one
    x = P @ (w * I1 @ x1 + (1 - w) * I2 @ x2)
    return x, P

def best_omega(P1, P2, tol=1e-4):          # golden-section search on det
    cost = lambda w: np.linalg.det(np.linalg.inv(w * np.linalg.inv(P1) + (1 - w) * np.linalg.inv(P2)))
    g, a, b = (np.sqrt(5) - 1) / 2, 0.0, 1.0
    while b - a > tol:
        c, d = b - g * (b - a), a + g * (b - a)
        if cost(c) < cost(d): b = d
        else: a = c
    return (a + b) / 2

def covariance_intersection(x1, P1, x2, P2):
    return ci_at(x1, P1, x2, P2, best_omega(P1, P2))

P1, P2 = np.diag([1.0, 4.0]), np.diag([16.0, 1.0])
best_omega(P1, P2)                                   # about 0.633

Keep going

Sources

  1. Julier, S. J., and Uhlmann, J. K. "A Non-divergent Estimation Algorithm in the Presence of Unknown Correlations." Proceedings of the American Control Conference, 1997. The paper that introduces CI.
  2. Julier, S. J., and Uhlmann, J. K. "General Decentralized Data Fusion with Covariance Intersection." In Handbook of Multisensor Data Fusion, 2001. Decentralized fusion and Split CI.
  3. Noack, B., Sijs, J., Reinhardt, M., and Hanebeck, U. D. "Decentralized Data Fusion with Inverse Covariance Intersection." Automatica, 2017.
  4. Reinhardt, M., Noack, B., Arambel, P. O., and Hanebeck, U. D. "Minimum Covariance Bounds for the Fusion under Unknown Correlations." IEEE Signal Processing Letters, 2015.
The takeaway. When you cannot see what two estimates share, claim only what the worst case allows. CI does that with one weight that you choose for the tightest answer.
You fuse a fresh GPS reading into one onboard Kalman filter. Should you use CI?

Now press Present or Teach and explain from memory: the echo, consistency, the worst-case blend, the CI update, the lens and ω*. Then go back to the hero, set the correlation to 1 and say why only CI keeps its dots inside the band.

Sensor Fusion: Classical to Modern · Lesson 11: Covariance Intersection
Lesson 10 · Lesson 12 · Back to Gleams