The standard Kalman filter is an exact recursion for the conditional state distribution in a linear Gaussian state-space model. The general Bayesian filter shares the same two steps: predict the state distribution, then update it with the new measurement.
Six modeling assumptions for the exact Kalman recursion
- The transition and measurement models are linear in the state.
- The state is Markov: conditional on the previous state, earlier states are not needed for its transition. The current observation depends on the current state.
- Process and measurement noises are mutually independent, independent across steps, and independent of the initial state.
- The model matrices and noise covariances are known at each step; they may vary with time.
- The noises are zero-mean Gaussian.
- The initial state is Gaussian with a known mean and covariance.
With Gaussian assumptions, the posterior mean minimizes mean-square error over all estimators. With appropriate linear and second-moment assumptions but without Gaussianity, the filter still produces the optimal linear estimate, not generally the full posterior distribution.
1. Predict
Given all measurements through \(k-1\), average the transition model over the previous posterior:
\[p(x_k\mid y_{1:k-1})=\sum_{x_{k-1}}p(x_k\mid x_{k-1})p(x_{k-1}\mid y_{1:k-1})\]For continuous states, use an integral over \(x_{k-1}\) instead of the sum. The current measurement \(y_k\) has not yet been used.
2. Update
\[p(x_k\mid y_{1:k})=\frac{p(y_k\mid x_k)p(x_k\mid y_{1:k-1})}{p(y_k\mid y_{1:k-1})}.\]The denominator is the positive predictive probability or density of the measurement. Compute it by summing or integrating the numerator over \(x_k\). It is not the predictive state distribution.
3. The scalar Gaussian case
For \(x_k=a x_{k-1}+w_{k-1}\) and \(y_k=h x_k+v_k\), if the previous posterior is \(\mathcal N(m,P)\), the predicted mean and variance are \(m^-=am\) and \(P^-=a^2P+Q\). Multiplying this predictive Gaussian by the measurement likelihood gives:
\[K=\frac{P^-h}{h^2P^-+R},\qquad m^+=m^-+K(y_k-hm^-),\qquad P^+=(1-Kh)P^-.\]See the matrix version and derivation.

