Minimum Mean Square Error (MMSE) Estimation
The Kalman filter is often introduced as “the optimal filter”. The precise statement is: it is the minimum mean square error (MMSE) estimator among all linear estimators, and, if all random variables are jointly Gaussian, among all estimators. This page explains what that means and shows how the Kalman gain falls out of the linear MMSE estimator in a few lines.
The MMSE criterion
Let \( \mathbf{x} \) be an unknown random vector (the state) and \( \mathbf{y} \) an observed random vector (the measurement). An estimator is any function \( \hat{\mathbf{x}} = g(\mathbf{y}) \). The MMSE estimator minimizes the expected squared estimation error
\[ \hat{\mathbf{x}}_{\text{MMSE}} = \arg\min_{g} \; E\left[ \left(\mathbf{x} - g(\mathbf{y})\right)^T \left(\mathbf{x} - g(\mathbf{y})\right) \right] . \]
The cost is the trace of the error covariance matrix, so minimizing it minimizes the sum of the error variances of all state components. The empirical counterpart of this cost is the root mean square error (RMSE).
The conditional mean is optimal
Without any restriction on \( g \), the solution is the conditional mean
\[ \hat{\mathbf{x}}_{\text{MMSE}} = E\left[ \mathbf{x} \mid \mathbf{y} \right] . \]
This holds for any distribution. The catch is that \( E[\mathbf{x} \mid \mathbf{y}] \) is generally a nonlinear function of \( \mathbf{y} \) that requires the full joint density, which is rarely available in closed form.
The linear MMSE estimator
If the estimator is restricted to be affine, \( \hat{\mathbf{x}} = \mathbf{K}\mathbf{y} + \mathbf{b} \), only the first two moments are needed:
\[ \bar{\mathbf{x}} = E[\mathbf{x}], \quad \bar{\mathbf{y}} = E[\mathbf{y}], \quad \mathbf{P}_{xy} = \text{cov}(\mathbf{x},\mathbf{y}), \quad \mathbf{P}_{yy} = \text{cov}(\mathbf{y},\mathbf{y}) . \]
Setting the derivative of the cost to zero gives the linear MMSE (LMMSE) estimator and its error covariance
\[ \hat{\mathbf{x}} = \bar{\mathbf{x}} + \mathbf{P}_{xy}\mathbf{P}_{yy}^{-1} \left( \mathbf{y} - \bar{\mathbf{y}} \right) \]
\[ \mathbf{P} = \mathbf{P}_{xx} - \mathbf{P}_{xy}\mathbf{P}_{yy}^{-1}\mathbf{P}_{xy}^T . \]
An equivalent characterization is the orthogonality principle: the estimation error \( \mathbf{x} - \hat{\mathbf{x}} \) is uncorrelated with the data \( \mathbf{y} \). This is the route R. E. Kalman used in his 1960 paper.
From LMMSE to the Kalman filter
Apply the LMMSE estimator to one Kalman filter step. Before the measurement, the state has mean \( \mathbf{x}(k\vert k-1) \) and covariance \( \mathbf{P}(k\vert k-1) \). The measurement is \( \mathbf{y}(k) = \mathbf{C}(k)\mathbf{x}(k) + \mathbf{v}(k) \) with noise covariance \( \mathbf{R}(k) \), uncorrelated with the state. Then
\[ \bar{\mathbf{y}} = \mathbf{C}(k)\mathbf{x}(k\vert k-1), \quad \mathbf{P}_{xy} = \mathbf{P}(k\vert k-1)\mathbf{C}(k)^T, \quad \mathbf{P}_{yy} = \mathbf{S}(k) = \mathbf{C}(k)\mathbf{P}(k\vert k-1)\mathbf{C}(k)^T + \mathbf{R}(k) . \]
Inserting these moments into the LMMSE equations gives exactly the Kalman filter update:
\[ \mathbf{K}(k) = \mathbf{P}(k\vert k-1)\mathbf{C}(k)^T \mathbf{S}(k)^{-1} \]
\[ \mathbf{x}(k) = \mathbf{x}(k\vert k-1) + \mathbf{K}(k) \left( \mathbf{y}(k) - \mathbf{C}(k)\mathbf{x}(k\vert k-1) \right) \]
\[ \mathbf{P}(k) = \mathbf{P}(k\vert k-1) - \mathbf{K}(k)\mathbf{S}(k)\mathbf{K}(k)^T . \]
The term in brackets is the innovation and \( \mathbf{S}(k) \) is its covariance. The Kalman filter is therefore nothing but the LMMSE estimator applied recursively, with the prediction step providing the prior moments for the next update.
Where Gaussianity comes in
- Without Gaussian assumptions, the Kalman filter is the best linear estimator in the MMSE sense. A nonlinear estimator can do better if the noise is, for example, heavy-tailed or multimodal.
- With jointly Gaussian initial state, process noise and measurement noise, the conditional mean is itself linear in the data. The Kalman filter then coincides with \( E[\mathbf{x} \mid \mathbf{y}] \) and is optimal among all estimators.
This distinction is frequently blurred because the Bayesian derivation of the Kalman filter starts from Gaussian densities [1, 3].
Nonlinear filters as approximate LMMSE
The Extended, Unscented and Cubature Kalman Filter all keep the LMMSE update structure. They differ only in how they approximate the moments \( \bar{\mathbf{y}} \), \( \mathbf{P}_{xy} \) and \( \mathbf{P}_{yy} \) when the models are nonlinear: the EKF by Taylor linearization, the UKF and CKF by deterministic sampling (statistical linearization). See KF vs. EKF vs. UKF for a comparison.
References
[1] Y. Bar-Shalom, X. R. Li and T. Kirubarajan (2001). Estimation with Applications to Tracking and Navigation. Wiley.
[2] R. E. Kalman (1960). “A New Approach to Linear Filtering and Prediction Problems”. Journal of Basic Engineering, 82(1), 35–45. doi:10.1115/1.3662552
[3] J. Uhlmann and S. Julier (2022). “Gaussianity and the Kalman Filter: A Simple Yet Complicated Relationship”. Journal de Ciencia e Ingeniería, 14(1), 21–26. doi:10.46571/JCI.2022.1.2
[4] D. Simon (2006). Optimal State Estimation: Kalman, H∞, and Nonlinear Approaches*. Wiley.
Disclosure Statement: In order to offer kalman-filter.com free of charge, I use affiliate links, which are marked with *. If you purchase one of the featured products through these links, I receive a commission. The price you pay does not change because of this. As an Amazon Associate, I earn from qualifying purchases.