Analytics & ML · Study deck
Kalman Filters for Sensor Fusion
Imagine a cart using a wheel count and a motion sensor to estimate speed.
Data Dora is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Explain: If an innovation gate rejects several readings in a row, the output record should show whether the system is holding the model prediction, using a fallback sensor, or stopping an action because observability is weak.
- Explain: Persistent positive residuals can reveal bias; residuals that spike after firmware or enclosure changes can reveal a timing or calibration problem; residuals that are always smaller than expected can indicate overestimated noise.
- Explain: Process noise says how much the model can be wrong between updates; measurement noise says how much the sensor can be wrong when it reports.
Major section
Start With the Story
A simple filter depends on its model and error beliefs.
- Practitioner works through tuning and a small update.
- Under the Hood explains gates, model limits, and failure modes that can make a calm line unsafe.
- A device has produced messy evidence, an analytic step is about to change an alert or control decision, and someone has to explain why the result should be trusted.
Major section
Kalman Filters Maintain Belief
A Kalman filter is a state estimator for systems that can be described with a model, measurements, and uncertainty.
- It predicts the next state from the model, then corrects that prediction when a measurement arrives.
- For IoT sensor fusion, the important idea is not that the output is smooth.
- Noise terms make the estimate reviewable instead of magical.
Major section
Kalman Filters Maintain Belief (continued)
The important idea is that every fused estimate carries its uncertainty and update evidence.
- A temperature estimate, location estimate, or velocity estimate should record the state vector, time step, process noise, measurement noise, innovation, Kalman gain, accepted/rejected measurements, and degraded-mode status.
- If the model is linear and the noise assumptions are reasonable, a Kalman filter gives a principled way to balance prediction and measurement.
- The transition model says how that state should move between samples.
Major section
Kalman Filters Maintain Belief (continued)
Prediction The model-based step that advances the state and usually increases uncertainty.
- If those assumptions are weak, the filter still needs validation gates and review evidence.
- The state vector is the contract between the physics and the software.
- Correction The measurement update that uses innovation and gain to adjust the state and reduce uncertainty.
Major section
Kalman Filters Maintain Belief (continued)
A simple tracking filter might estimate position and velocity; a building filter might estimate temperature plus a slowly changing sensor bias.
- Those two models are separate on purpose: a sensor may measure only one part of the state, and the filter still uses the model to carry the unmeasured parts forward.
- Process noise says how much the model can be wrong between updates; measurement noise says how much the sensor can be wrong when it reports.
- The innovation covariance determines the Kalman gain, which controls the correction and the updated uncertainty carried into the next cycle.
Major section
Tune Prediction vs Measurement
In the scalar case, the Kalman gain shows the trust balance directly.
- A high gain means the measurement pulls the estimate strongly.
- A low gain means the model prediction dominates.
- Process noise Q controls how much uncertainty is added during prediction; measurement noise R controls how much the filter trusts the sensor.
Major section
Tune Prediction vs Measurement (continued)
Process noise: uncertainty added because the model is imperfect.
- Both should be based on observed behavior and retested after sensor, firmware, sampling, or deployment changes.
- Rule deciding whether an innovation is plausible enough to update.
- Valid measurements may be rejected during real changes.
- Faulty measurements may corrupt the fused state.
Major section
Innovation Gating Protects Estimates
The innovation is the difference between what the sensor reports and what the filter predicted the sensor should report.
- Large innovations can be real changes, bad tuning, stale timestamps, miscalibration, sensor faults, or a model that no longer fits the operating mode.
- Production filters should treat the innovation as evidence, not just a number inside the update equation.
- This connects Kalman filtering to the broader fusion contract: accepted and rejected inputs must be visible.
Major section
Innovation Gating Protects Estimates (continued)
Retune Q, segment by operating mode, and validate against step changes.
- If the normalized innovation is too large, the system can reject the measurement, downweight it, publish a degraded mode, or trigger a sensor-health review.
- Covariance is also a design surface, not just a matrix in the code.
- Published uncertainty is small while errors are large.
Major section
Innovation Gating Protects Estimates (continued)
Retest Required after tuning changes, sensor replacement, firmware updates, or changed operating modes.
- If two measurements share a calibration source, the filter should not treat them as fully independent evidence.
- Engineers can plot innovations over time and compare them with the assumed noise model.
- Re-estimate R, add gates, and compare against raw sensor noise tests.
Major section
Innovation Gating Protects Estimates (continued)
If an innovation gate rejects several readings in a row, the output record should show whether the system is holding the model prediction, using a fallback sensor, or stopping an action because observability is weak.
- Persistent positive residuals can reveal bias; residuals that spike after firmware or enclosure changes can reveal a timing or calibration problem; residuals that are always smaller than expected can indicate overestimated noise.
- That review evidence is what keeps Q, R, gates, and covariance from becoming untested constants.
- decision example: If the configured one-dimensional gate is 3.84, this measurement is outside the gate.
Deck summary
Key takeaways
A simple filter depends on its model and error beliefs.
- A Kalman filter is a state estimator for systems that can be described with a model, measurements, and uncertainty.
- The important idea is that every fused estimate carries its uncertainty and update evidence.
- Prediction The model-based step that advances the state and usually increases uncertainty.
- A simple tracking filter might estimate position and velocity; a building filter might estimate temperature plus a slowly changing sensor bias.
Retrieval practice
Recall check 1 of 3

Data Dora says: answer from memory, then check your reasoning.
Q1What should a Kalman-filter output preserve besides the fused state value?
Show answer
Answer: B Kalman filtering is a state-and-uncertainty update, not just a smoothing operation.
Retrieval practice
Recall check 2 of 3

Data Dora says: answer from memory, then check your reasoning.
Q2In the worked scalar update, why does the final estimate become 20.72 deg C instead of copying the 21.2 deg C measurement?
Show answer
Answer: A The Kalman gain controls how much of the innovation is applied to the prediction.
Retrieval practice
Recall check 3 of 3

Data Dora says: answer from memory, then check your reasoning.
Q3Repeat the worked scalar update with the same predicted estimate 20.0 deg C, predicted variance 0.60, and innovation 1.2 deg C, but increase measurement variance R from 0.40 to 2.40. What happens?
Show answer
Answer: A Increasing measurement variance lowers Kalman gain, moves the estimate less toward the measurement, and leaves greater posterior uncertainty.
Print reference
Answers
Answer key.
- B · Kalman filtering is a state-and-uncertainty update, not just a smoothing operation.
- A · The Kalman gain controls how much of the innovation is applied to the prediction.
- A · Increasing measurement variance lowers Kalman gain, moves the estimate less toward the measurement, and leaves greater posterior uncertainty.