Quoto

Courses / Time series

Kalman filters

10 cards3 min readStatistics

Card 1 of 10
  1. Idea: A number nobody can read

    Latency drifts through the day, and you only see pings: the truth plus jitter.

    • A single ping is too noisy
    • A long average lags behind every shift
    • A Kalman filter gives the best estimate now
  2. Formula: State and reading

    Process noise Q says how fast the state moves; measurement noise R how bad a reading is.

  3. Formula: Predict

    Roll the estimate forward; its uncertainty grows by Q.

  4. Formula: Correct

    Believe the share K of the surprise y − x̂⁻, then P = (1 − K) P⁻.

  5. Example: The first ping

    Start at with , and take , . A ping reads . What is the new estimate?

    1. Predict:
    2. Gain
    3. returns to ; estimate
  6. Quick check: The second ping

    Continue from that estimate. The next ping reads . What is the estimate now?

    Show the answer

    Answer:

    again, gain : .

  7. Idea: The gain is a precision share

    Correcting is Bayes’ rule: precisions add, , so .

    • Mean:
    • Exact for linear models with Gaussian noise
    • Otherwise still the best linear estimator
  8. Common mistake: Mixing up the noises

    A larger means bad readings, so the gain falls. A larger means a fast state, so it rises.

    Instead And use , not : skipping predict gives , not .

  9. Idea: The steady state

    Variances ignore the readings and settle at a fixed point: .

    • Check:
    • At a fixed gain it is an exponential moving average
    • Choosing a decay secretly chooses
  10. Idea: Say it in the room

    Recite predict and correct, and name what each noise controls.

    • The gain is a precision share
    • Several dimensions:
    • At steady state the filter is an exponential average