Lesson 9 of 21 in this unit
Fuse noisy measurements.
Predict motion, correct with sensors and inspect the uncertainty assumptions of a linear Kalman filter.
By the end: Explain prediction, innovation, gain and covariance using an inspectable two-state sensor-fusion trace.
Prerequisites and path options
Why learn this? Combine sensors according to their uncertainty and recognize when shared errors defeat the benefit.
Start with something concrete.
Position readings say where an object is; velocity readings help predict where it will be next. A filter combines these clues while tracking how uncertain it claims to be.
Try the interactive modelYou tell the filter that a sensor is much more accurate without improving its actual readings. What can happen?
Change one thing. Watch what follows.
Loading this browser experiment…
Understand what changed.
A shorter explanation, with the original worked examples available below. Both explain the same experiment and its limits.
The idea in everyday terms
Sensor fusion combines a predicted state with new measurements according to their uncertainty. Position and velocity are related through a motion model, so a velocity reading can affect the predicted position as well as velocity.
What to watch in the experiment
Follow prediction and correction separately. Compare trusting the model more with trusting the measurements more. Inspect how the uncertainty calculation changes when sensors share an error rather than providing independent evidence.
What this does not establish
Combining correlated errors as if they were independent can produce false confidence. This lab uses current simultaneous readings and a declared model; it does not solve every delayed-sensor or real-world fusion problem.
Open the full worked examples, calculations and limitations
This is the same reference used in Technical mode. Expand it whenever you need the exact numbers, assumptions or further explanation.
Use motion to connect the clues
Suppose a cart is estimated to be at 1 metre, moving at 0.5 metres per second. After 0.05 seconds, a constant-velocity prediction places it at 1.025 metres. A fresh position reading can correct that prediction. A velocity reading can help correct both velocity and the position prediction it influenced.
The lab implements this idea with two state numbers: position and velocity. Unlike the previous lesson’s independent smoothers, this filter connects them through a motion model. All readings are current and arrive together in this experiment. Handling delayed or out-of-order readings would require additional bookkeeping.
Prediction comes before correction
The filter starts with a declared estimate and uncertainty. It does not initialize from true state. At time zero it uses the first measurements without advancing time. Every later step first advances position using estimated velocity and keeps velocity unchanged in the mean prediction.
The uncertainty calculation additionally allows an unknown acceleration during that interval. A larger assumed acceleration standard deviation allows more uncertainty about the prediction. This is a modelling choice, not a measurement of the actual acceleration.
Innovation means a disagreement
The innovation is the reading minus the prediction for that reading. If predicted position is 1 metre and the sensor reports 1.2 metres, the position innovation is 0.2 metres. It describes disagreement between two available quantities; it is not the true position error.
The Kalman gain determines how much of that disagreement changes the estimate. In a one-number example, prediction variance 4 and sensor variance 1 give gain 4/(4+1) = 0.8. The correction moves 80% of the way toward the reading. If the prediction is more trusted, the correction is smaller.
Variance measures squared spread, so position variance uses square metres. Its square root, the standard deviation, returns to metres. A normalized innovation divides the disagreement by its predicted standard deviation, making the ratio unitless. Large ratios can reveal a mismatch, but they do not tell us whether the sensor, model, timing or bias caused it.
Keep the cross-covariance
The covariance matrix has position variance, velocity variance and a shared cross-covariance. The cross term records how errors in the two estimates are related. An uncertain velocity makes future position uncertain; a position measurement can therefore provide information about velocity too.
This experiment corrects position first, then velocity using the already updated estimate and covariance. Under its independent sensor-error assumption, this is equivalent to a joint two-sensor correction. It would be wrong to reuse the original prediction for both updates and then casually average them, or to ignore correlated measurement errors in a real fusion problem.
The small matrix calculation
Let the state vector be . With interval , the constant-velocity transition is . Prediction uses and . For independent acceleration with variance held during the interval, and .
A position measurement uses row ; velocity uses . The innovation is , its variance is , and the gain is . Correct the mean with .
The implementation updates covariance in Joseph form: . This retains the cross terms and avoids relying on a subtraction of nearly equal covariance entries. Matrices are only 2×2 here; the public trace exposes the values so they can be checked independently.
A band is only as credible as its model
The plot shows two standard deviations on either side of estimated position. Do not call this a guaranteed 95% interval. Such probability interpretations need distributional and model assumptions that this teaching trace does not establish.
The sensors here use fixed seeded uniform noise. Their actual variances are amplitude squared divided by three. The trajectory is an authored sinusoid, not a sample from the independent random-acceleration model. A constant camera bias deliberately violates the assumed zero mean. Covariance can remain unchanged while that bias makes the estimate wrong.
The stationary-model fault disconnects velocity from position and leaves process noise only in velocity. Turning up acceleration uncertainty cannot repair a missing relationship. Compare innovations, true errors and band width rather than choosing the smoothest-looking curve.
Make a fusion audit
Capture the baseline, one changed trust assumption and a model or bias failure. Guided learners should explain each stage in everyday words. Implementation learners should reproduce a correction independently, verify covariance symmetry and nonnegative eigenvalues, and explain the units of the gains. Decision learners should identify the noise, bias and motion assumptions that would need validation before deployment.
Truth-based error scores are simulator diagnostics, never estimator inputs. Controls reuse the same underlying readings; these are development comparisons rather than fresh independent trials. Captures are temporary practice. Human review and learner pilots remain pending.
Why can a position reading change the velocity estimate?
Take this idea with you.
A useful estimate combines a motion model with sensor evidence. Its covariance is a conditional claim that depends on the model, noise and bias assumptions.
Explore related topics and the topic map
How this topic connects
Explore this topic on the interactive mapUse these connections to review a foundation or choose where to go next. You can open any topic without completing the others.
What it builds on
- Turn observations into estimates
Separate noisy measurements from estimated motion before using them to control a system.
Predict motion, correct with sensors and inspect the uncertainty assumptions of a linear Kalman filter.
What it enables
- Stop when the controller leaves its limits Explore a related application
Use uncertainty in state estimates to question whether a controller’s operating assumptions still hold.