Skip to content

SensingNoise and Estimation

A Kalman Filter in One Dimension

Gain K = P / (P + R); new estimate = old + K (measurement − old); new P = (1 − K) P.

Not started Jump to practice

A Kalman filter sounds hard, but its main idea fits in one line: blend what you predicted with what you measured, trusting each by how good it is.

Key idea

Keep an estimate $x$ and its uncertainty (variance) $P$. A measurement $z$ has variance $R$. The gain is $K = \dfrac{P}{P + R}$. Update: $x \leftarrow x + K(z - x)$ and $P \leftarrow (1 - K)P$. Between measurements, predict the motion and let $P$ grow a little.
The filter tracks a moving cart from noisy readings. Make the sensor noisier and watch the gain drop.

Why it works

If the prediction is shaky ($P$ big), $K$ is near 1 and the estimate jumps to the measurement. If the sensor is noisy ($R$ big), $K$ is near 0 and the estimate barely moves. The new $P$ is smaller than either: two pieces of evidence beat one. This is Bayes' rule for bell-shaped uncertainty.

Worked example: One update

Predict $x = 100$, $P = 4$. Measure $z = 106$, $R = 12$.
  1. $K = 4/16 = 0.25$.
  2. $x = 100 + 0.25 \times 6 = 101.5$.
  3. $P = 0.75 \times 4 = 3$.

Answer: Estimate 101.5, variance 3.

Common mistake

Thinking a Kalman filter just averages. It weighs each source by how much it is trusted, and the weights change as it runs.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Sebastian Thrun, Wolfram Burgard and Dieter Fox, Probabilistic Robotics (MIT Press, 2005)