For the linear-Gaussian model xt=Axt−1+wt with wt∼N(0,Q), and yt=Hxt+vt with vt∼N(0,R), how do you derive the Kalman filter predict and update equations from the conditioning rule for Gaussians?

Probabilistic models, Kalman filter
Level L3 Intermediate. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can derive the Kalman gain from the joint Gaussian of state and observation.

Key idea

After the predict step, xt∼N(m−,P−). The pair (xt,yt) is jointly Gaussian, so conditioning on yt gives K=P−H⊤S−1 with S=HP−H⊤+R.

Steps

  1. Predict. If xt−1∼N(m,P), then xt=Axt−1+wt is Gaussian with m−=Am and P−=APA⊤+Q.
  2. Joint of the state and the observation: the mean is (m−,Hm−). Covariances: Var(x)=P−, Cov(x,y)=P−H⊤, Var(y)=HP−H⊤+R=S.
  3. Use the Gaussian conditioning rule: μx∣y=μx+ΣxyΣyy−1(y−μy) and Σx∣y=Σxx−ΣxyΣyy−1Σyx.
  4. Define the Kalman gain K=P−H⊤S−1. Then mt=m−+K (yt−Hm−) and Pt=P−−KSK⊤=(I−KH)P−.
  5. The term yt−Hm− is the innovation: the difference between the observation and its prediction.
  6. Scalar check with H=1: K=P−/(P−+R). If R→0 then K→1 and we trust the data. If R→∞ then K→0 and we trust the prediction.
  7. The posterior covariance does not depend on the observed yt, so it can be computed offline.

Common mistakes

How long your answer should be

A page. About 6 minutes.

Last checked on 4 December 2026.

Read this

Previous in Probabilistic models: How does the Baum–Welch algorithm (EM for an HMM) derive its updates for the transition probabilities aij and emission probabilities bj(k)?
Next in Probabilistic models: For a mixture of Bernoulli distributions on binary vectors x∈{0,1}D, with p(x)=∑kπk∏dμkdxd(1−μkd)1−xd, how do you derive the E-step and M-step updates of EM?