Brief
GPS on a phone jumps around by several metres. The phone also knows its speed and heading, and a person cannot teleport. A Kalman filter combines all of that. It keeps a best guess of where you are and how fast you are moving, along with how unsure it is, and updates both every time a reading comes in.
The model has a hidden state, here . Each step has two parts. Predict: move the state forward with and grow the uncertainty with . Update: compare the measurement with what you expected, , and move part of the way toward it. The share is the Kalman gain , giving and .
Everything is Gaussian, so a mean vector and a covariance matrix carry the whole belief. You set two things by hand: , how much the true motion can wander from constant velocity, and , how noisy the sensors are. Most of the craft is choosing them. To measure error you need the truth, so start with a simulated walk. For a real check, walk a route you know exactly, such as a running track, or use a public dataset with ground truth such as Google's Smartphone Decimeter Challenge.
DATA · your phone's sensors or a public trace
Objectives
Read-only. Log in to update progress.
VICTORY CONDITIONS
- RMS position error at least 30% lower than raw GPS against ground truth. Record the reduction with `python tools/mlarena.py record BM-28 "<percent lower>"`.
- Your filtered states match filterpy.kalman.KalmanFilter within 1e-9 on the same inputs.
- The real trace is plotted raw and filtered on the same axes, with a short note on the Q and R you chose and why.
Side quests
Terms in plain words
- State-space model
- A model with a hidden state (here position and velocity) that evolves by a known rule, plus noisy measurements of part of that state.
- Covariance matrix
- Holds the variance of each state variable on its diagonal and how pairs of them vary together off the diagonal. It describes the filter's uncertainty.
- Process noise (Q)
- How much the true motion can drift from the model in one step, for example because the walker speeds up or turns.
- Measurement noise (R)
- How noisy each sensor reading is. A GPS fix might be off by 5 metres, so its variance is around 25 m².
- Kalman gain
- The weight that decides how far to move the prediction toward a new measurement. It is large when the prediction is uncertain and the sensor is good.