Joseph Form Covariance Update: Formula, Derivation and Numerical Stability
One of the biggest challenges in implementing Kalman filters is that numerical errors can cause the covariance matrix to lose symmetry and positive definiteness, causing the filter to diverge and no longer provide an estimation result. This happens especially in system models with many states, with very accurate sensors, or in single-precision arithmetic on embedded targets. The remedy for the update step is the Joseph form of the covariance update. It costs more operations but is far less sensitive to numerical errors.
The formula
In the notation of this site, with measurement matrix \( \mathbf{C}(k) \) (often written \( \mathbf{H} \), as in the EKF):
\[ \mathbf{P}(k) = \left(\mathbf{I} - \mathbf{K}(k)\mathbf{C}(k)\right)\mathbf{P}(k\vert k-1)\left(\mathbf{I} - \mathbf{K}(k)\mathbf{C}(k)\right)^T + \mathbf{K}(k)\mathbf{R}(k)\mathbf{K}(k)^T \]
or, in the compact textbook notation, \( \mathbf{P}^+ = (\mathbf{I}-\mathbf{K}\mathbf{H})\mathbf{P}^-(\mathbf{I}-\mathbf{K}\mathbf{H})^T + \mathbf{K}\mathbf{R}\mathbf{K}^T \).
The two common alternatives are mathematically equivalent only for the optimal gain:
\[ \mathbf{P}(k) = \left(\mathbf{I} - \mathbf{K}(k)\mathbf{C}(k)\right)\mathbf{P}(k\vert k-1) \qquad \text{(short form)} \]
\[ \mathbf{P}(k) = \mathbf{P}(k\vert k-1) - \mathbf{K}(k)\mathbf{S}(k)\mathbf{K}(k)^T \qquad \text{(symmetric form)} \]
with the innovation covariance \( \mathbf{S}(k) = \mathbf{C}(k)\mathbf{P}(k\vert k-1)\mathbf{C}(k)^T + \mathbf{R}(k) \).
Derivation
The update is \( \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) \) with \( \mathbf{y}(k) = \mathbf{C}(k)\mathbf{x}_{\text{true}}(k) + \mathbf{v}(k) \). Writing the prior error as \( \mathbf{e}^- = \mathbf{x}_{\text{true}} - \mathbf{x}(k\vert k-1) \), the posterior error becomes
\[ \mathbf{e} = \left(\mathbf{I} - \mathbf{K}\mathbf{C}\right)\mathbf{e}^- - \mathbf{K}\mathbf{v} . \]
The prior error and the measurement noise are uncorrelated, so taking the covariance of both terms gives the Joseph form directly:
\[ \mathbf{P} = E\left[\mathbf{e}\mathbf{e}^T\right] = \left(\mathbf{I} - \mathbf{K}\mathbf{C}\right)\mathbf{P}(k\vert k-1)\left(\mathbf{I} - \mathbf{K}\mathbf{C}\right)^T + \mathbf{K}\mathbf{R}\mathbf{K}^T . \]
No property of the gain was used. The Joseph form is the correct covariance for any gain, optimal or not. Inserting the optimal gain \( \mathbf{K} = \mathbf{P}(k\vert k-1)\mathbf{C}^T\mathbf{S}^{-1} \) makes \( \mathbf{K}\mathbf{S}\mathbf{K}^T = \mathbf{P}(k\vert k-1)\mathbf{C}^T\mathbf{K}^T \), and the expression collapses to the short form \( (\mathbf{I}-\mathbf{K}\mathbf{C})\mathbf{P}(k\vert k-1) \).
Why the Joseph form is numerically stable
1. Symmetric and positive semidefinite by construction. The first term is a congruence transformation of a positive semidefinite matrix, the second term is positive semidefinite because \( \mathbf{R} \) is. A sum of two such matrices cannot have negative eigenvalues (up to rounding in the final additions). The short form is the difference of two large, nearly equal matrices and has no such structure.
2. Insensitive to errors in the gain. In a real implementation the gain is never exactly optimal: rounding, an approximate \( \mathbf{P}(k\vert k-1) \) in an EKF, or a deliberately suboptimal gain. Let \( \mathbf{K} = \mathbf{K}_{\text{opt}} + \delta\mathbf{K} \). Expanding both forms gives
\[ \mathbf{P}_{\text{Joseph}} = \mathbf{P}_{\text{opt}} + \delta\mathbf{K}\,\mathbf{S}\,\delta\mathbf{K}^T \]
\[ \mathbf{P}_{\text{short}} = \mathbf{P}_{\text{opt}} - \delta\mathbf{K}\,\mathbf{C}\,\mathbf{P}(k\vert k-1) . \]
The Joseph form errs only in second order and always toward a larger, i.e. conservative, covariance. The short form errs in first order, the error is not symmetric, and it can push small eigenvalues below zero, which means negative variances.
3. Valid for suboptimal gains. Steady-state (precomputed) gains, Schmidt-Kalman “consider” filters, or gains modified for robustness all require the Joseph form, because the short form is only correct for the optimal gain.
Numerical example
A large prior uncertainty combined with a very accurate sensor is a classic trigger. Take two states with \( \mathbf{P}(k\vert k-1) = \text{diag}(10^4, 10^4) \), a measurement of their sum, \( \mathbf{C} = [1 \;\; 1] \), and \( \mathbf{R} = 10^{-4} \). Now let the gain deviate from the optimum by only 0.1 %, as it may through rounding or an approximate covariance. The smallest eigenvalue of the updated covariance becomes:
| Update | Smallest eigenvalue |
|---|---|
| exact (optimal gain) | 5.0 · 10⁻⁵ |
| Joseph form | 1.0 · 10⁻² |
| short form | −10 |
The short form produces a negative variance, i.e. an invalid covariance, from a tiny gain error. The Joseph form stays positive definite and errs on the conservative side, exactly as predicted by the second-order error term above.
Computational cost and implementation tips
The Joseph form needs roughly twice the matrix multiplications of the short form, which is rarely decisive today. Practical tips:
- Compute \( \mathbf{I} - \mathbf{K}\mathbf{C} \) once and reuse it.
- Process uncorrelated measurements sequentially as scalars. Then \( \mathbf{S} \) is a scalar, no matrix inversion is needed, and the Joseph update reduces to rank-one operations.
- Even with the Joseph form, symmetrize occasionally, \( \mathbf{P} \leftarrow \frac{1}{2}(\mathbf{P} + \mathbf{P}^T) \), to remove rounding asymmetry.
- For very demanding cases (single precision, many states, extreme condition numbers) use a square-root filter (Potter) or the UD factorization (Bierman-Thornton). They propagate a factor of \( \mathbf{P} \) and guarantee positive definiteness, see how to tune a Kalman filter and failure modes.
Joseph form in the EKF
In the Extended Kalman filter the gain is computed from a linearized, approximate covariance, so it is never exactly optimal for the true system. The Joseph form, with \( \mathbf{C} \) replaced by the measurement Jacobian \( \mathbf{H}(k) \), is therefore the recommended default for the EKF and for error-state filters such as the multiplicative EKF.
History
The Joseph form is named after Peter D. Joseph, who formulated it in the 1960s. His work, alongside Richard S. Bucy, is detailed in their book Filtering for Stochastic Processes With Applications to Guidance* (1968).
References
[1] R. S. Bucy and P. D. Joseph (1968). Filtering for Stochastic Processes with Applications to Guidance. Interscience Publishers.
[2] G. J. Bierman (1977). Factorization Methods for Discrete Sequential Estimation. Academic Press.
[3] Y. Bar-Shalom, X. R. Li and T. Kirubarajan (2001). Estimation with Applications to Tracking and Navigation. Wiley.
[4] M. S. Grewal and A. P. Andrews (2015). Kalman Filtering: Theory and Practice Using MATLAB, 4th ed. Wiley.
[5] 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.