3.5.22 · D5Guidance, Navigation & Control (GNC)

Question bank — Kalman gain — minimizes trace of covariance

1,966 words9 min readBack to topic

Reminders of the symbols, so nothing is used before it is meant:

  • — the (unknown) true state. — our estimate of it.
  • — the estimation error, the vector pointing from our guess to the truth. Its "before-measurement" version is and its "after" version is .
  • — the prediction (prior estimate) and its uncertainty (covariance) before seeing the sensor. Here .
  • — the corrected estimate and its uncertainty after folding in the measurement, .
  • — the measurement; maps state → measurement space; is sensor noise with covariance .
  • — the Kalman gain, the "trust dial."
  • — the innovation covariance (spread of the surprise).
  • — the trace, sum of diagonal entries of a matrix.
  • — the cost function we minimize over : the total mean-squared error we want as small as possible.
Figure — Kalman gain — minimizes trace of covariance

True or false — justify

More trust in the measurement always shrinks the final uncertainty.
False. Uncertainty is a U-shaped (parabolic) function of ; past the optimum, extra gain lets in more sensor noise than prediction error it removes, so uncertainty grows again (see the figure).
The fused estimate can be more certain than both the prediction and the measurement individually.
True. Combining two independent noisy sources yields smaller than either or — e.g. gives , below both. That gain is the entire reason to fuse.
The simplified update is valid for any gain you choose.
False. That short form only holds at the optimal , where the noise term collapses. For an arbitrary you must use the Joseph form .
If the sensor is perfect () and it observes the state fully (square, invertible ), the filter ignores its own prediction entirely.
True. With and invertible, (scalar : ), so up to noise — the estimate becomes the measurement and the prior is overridden. If is not invertible, the sensor only pins down the observed part of the state (see Edge cases).
A useless sensor () makes the estimate diverge.
False. As , and , so — the filter simply keeps its prediction, calmly, with no harm done.
The Kalman gain minimizes the largest error component of the state.
False. It minimizes the trace — the sum of all diagonal variances (total mean-squared error), not the maximum entry. It optimizes the whole bundle, not the worst axis alone.
The trace of equals the expected squared distance between estimate and truth.
True (given the estimate is unbiased). , since summing the diagonal variances is summing — exactly the total mean-squared error when .
A larger prior uncertainty pushes the gain higher.
True. With less confidence in the prediction, the filter leans on the measurement more; grows with (up to the ceiling set by ).
The Joseph form can accidentally produce a covariance with negative variances.
False. The Joseph form is a sum of two positive-semidefinite pieces, so it stays symmetric and PSD — that's why implementers keep it for numerical safety.
The innovation being zero means the estimate is exactly correct.
False. Zero innovation only means the sensor agrees with the prediction; both could still be wrong together. It signals "no surprise," not "no error."

Spot the error

"Since is the sensor noise, the gain is ."
The denominator must be , not alone. It also includes the prior uncertainty mapped into measurement space — both sources' confidence set the gain.
"The optimum is where , so it could be a maximum of the trace."
It cannot. In the scalar case the second derivative is literally with , so it's a genuine minimum. In the matrix case is matrix-valued, so there is no single "" number — instead the Hessian (the quadratic form ) is positive-definite because , which is exactly what guarantees the stationary point is a minimum.
"We can drop the term when deriving because sensor noise is small."
Never drop it for a general — it's what makes the trade-off a parabola. Only at the optimal does it collapse: there , so cancels the extra pieces, leaving .
"Cross terms like should appear in ."
They vanish because the prior error and the sensor noise are assumed uncorrelated (and both zero-mean), so . That is exactly what lets the covariance split into the two clean terms.
"The update is nonlinear in the measurement, so it's optimal only by luck."
It's linear in — the simplest unbiased blend — and for Gaussian noise this linear form is provably optimal, not lucky.
" and are different terms, so no factor of 2 appears."
They're equal, because the trace of a matrix equals the trace of its transpose; adding two equal terms gives the factor of 2 in the derivative.

Why questions

Why minimize the trace rather than, say, the determinant of ?
Because is the total mean-squared error — the natural "how wrong am I" number — and it yields a clean linear-algebra minimization giving the standard Kalman gain.
Why does equal the sum of the state components' variances?
The diagonal entry is the variance of the -th error component (using ); the trace sums the diagonal, so it sums those variances into one total-error scalar.
Why is the linear update form chosen instead of a general nonlinear correction?
Linear is the simplest unbiased blend, and under Gaussian noise it is exactly optimal, so there's no accuracy left to gain from complicating it.
Why does the trace behave like a parabola (U-shape) in ?
The term is quadratic and positive-definite in , while the prediction term shrinks smoothly — their sum is a positive quadratic with one minimum, as the figure's green curve shows.
Why does the term collapse exactly at the optimal gain?
At the optimum , so substituting back makes the noise term cancel the extra prediction pieces, leaving the tidy — a coincidence only at the minimizing .
Why keep the Joseph form in real code if is simpler?
The Joseph form stays symmetric and positive-semidefinite even with rounding error and slightly non-optimal gains, guarding against numerically "impossible" covariances.
Why does the innovation covariance combine both and ?
The surprise carries uncertainty from the prediction (mapped through ) and from the sensor; you must weight the innovation by the total spread of what could cause it.
Why does raising (noisier sensor) lower the gain?
A noisier sensor is less trustworthy, so grows and shrinks, pulling the estimate back toward the prediction.
Why must the estimate be unbiased for the trace to mean "total error"?
If , the covariance measures only the spread around the (wrong) average, not the average miss itself; minimizing would then leave a systematic bias untouched. Zero-mean error makes exactly.

Edge cases

What is and when the prediction is perfectly certain, ?
, so — a flawless prior overrides the sensor entirely, mirror-image of the perfect-sensor case.
If prediction and measurement are equally uncertain (scalar , ), where does the gain land?
— the filter splits the difference exactly halfway, as symmetry demands.
What if is non-square (fewer measurements than states, so it cannot be inverted)?
The gain still exists via , since only (a smaller matrix) is inverted, never . The sensor sharpens only the observed directions of the state; unobserved directions keep their prior uncertainty.
Why does the formula use instead of , given may not be invertible?
Because we never need to invert — the derivation minimizes over and inverts only the always-square, positive-definite . The "" statement is a special case that requires a square invertible ; the general formula sidesteps it entirely.
What happens to when is set to zero deliberately?
The Joseph form gives : no measurement is used, so uncertainty is unchanged — the filter coasts on prediction alone.
Can ever exceed for the optimal gain?
No — at the optimum can only equal or shrink ; measurement information never increases uncertainty when weighted correctly.
What does zero measurement noise and zero prediction uncertainty () imply?
Both sources claim perfect certainty; makes ill-defined (), signalling a degenerate, over-confident setup that must be regularized in practice.

Connections