Kalman Filter Visualizer
The Kalman filter fuses a motion model with noisy measurements to estimate a hidden state — here a target moving across the canvas with state (x, y, vx, vy) under a constant-velocity model. Each step the filter predicts forward, then blends in a gray noisy position measurement weighted by the Kalman gain. The blue line is the true path, the orange line the filtered estimate, and an orange 2σ ellipse shows the current position uncertainty, with a green innovation line to each accepted measurement. Slide the measurement noise R, the process noise Q and the measurement dropout rate — during gaps the ellipse visibly inflates — or switch to drag mode and steer the target yourself. The status line compares RMS error of raw measurements against the filtered estimate.
Runs 100% in your browser — models are trained and computed locally on your device.
Read the full guide to this tool
Notes
- Predict: x ← Fx, P ← FPFᵀ + Q; update: K = PHᵀ(HPHᵀ + R)⁻¹, x ← x + K(z − Hx), P ← (I − KH)P — five small matrix equations run every step.
- For a truly linear system with Gaussian noise the Kalman filter is the provably optimal estimator; the filtered RMS error here should consistently beat the raw measurement RMS.
- The gain balances Q against R: trusting the model (small Q) smooths the track but lags sharp turns, trusting the sensor (small R) follows turns but inherits the noise.
- When measurements drop out the filter simply keeps predicting and P grows without bound — the swelling ellipse is the filter admitting how little it knows.
- Runs 100% in your browser — models are trained and computed locally on your device.