Feel it with sliders and hand calculations
Go back and forth between what the simulator shows and the numbers you get from one or two hand-calculated steps to connect behavior to the formulas.
Here you play with the simulator while also following one or two steps by hand calculation. Going back and forth between "watching the motion" and "tracing the formula" locks the understanding in place. The chapter follows this flow: (1) check the simulator controls → (2) move the sliders to feel the behavior → (3) follow the first one or two steps by hand calculation → (4) describe the behavior you felt in words.
Interactive simulator
Truth, observation, estimate, and the uncertainty band are shown at the same time. After moving a slider, click Reset so you can compare against the same series again.
Four things to watch
- How scattered the gray observation dots are.
- How closely the blue estimate line tracks the observations.
- How wide the light-blue band (±σ) is.
- Whether
Kis close to 0 or close to 1.
Things to try
- Raise
Qto distrust the model. - Raise
Rto distrust the observations. - Raise
P₀and watch the first few steps. - Fix the seed, change only one setting at a time, and compare the differences in behavior.
Check 1 — Follow the first step by hand
With initial values x̂₀ = 10, P₀ = 1, Q = 1, R = 4, and first observation z₁ = 12, work through the first step in order.
Q1. What is the predicted variance P₁⁻ = P₀ + Q?
P₁⁻ = 1 + 1 = 2.
Q2. What is the Kalman gain K₁ = P₁⁻ / (P₁⁻ + R)?
K₁ = 2 / (2 + 4) = 1/3 ≈ 0.333.
Q3. What is the updated estimate x̂₁?
The innovation is 12 − 10 = 2, so x̂₁ = 10 + (1/3) × 2 ≈ 10.667.
Q4. What is the updated variance P₁ = (1 − K₁)P₁⁻?
P₁ = (1 − 1/3) × 2 ≈ 1.333. Taking in the observation makes the uncertainty of the estimate a little smaller.
Tie the simulator to your hand calculations
The simulator's readout panel shows the current x̂⁻, P⁻, K, innovation, and the post-update x̂ and P. Advance one step at a time and confirm that the formulas match what is on the screen.
Check 2 — Carry over to the second step
Starting from the first-step results x̂₁ ≈ 10.667 and P₁ ≈ 1.333, process the second observation z₂ = 11.
Q1. What is the predicted variance P₂⁻ = P₁ + Q?
P₂⁻ ≈ 1.333 + 1 = 2.333.
Q2. What is the Kalman gain K₂?
K₂ ≈ 2.333 / (2.333 + 4) ≈ 0.3684.
Q3. What is the updated estimate x̂₂?
The innovation is 11 − 10.667 ≈ 0.333, so x̂₂ ≈ 10.667 + 0.3684 × 0.333 ≈ 10.790.
Q4. What is the updated variance P₂?
P₂ ≈ (1 − 0.3684) × 2.333 ≈ 1.474.
Check 3 — Describe the behavior in words
Describe in words what happens when you move the sliders in the simulator.
Q1. When you drop R sharply in the simulator, what is the most likely change?
Lowering R makes us trust the observation more, so the estimate line tracks it strongly and the updated variance drops.
Q2. If you want the blue estimate line to be in a "smooth but slightly delayed" state, which setting is closest?
Small Q and large R make us trust the model strongly, which smooths the line but delays the response to change.