Intuition The one core idea
You have two blurry guesses of where something is — one from a model, one from a sensor — and you want to combine them into a sharper guess. The Kalman gain is just the recipe for how much weight to give the sensor versus the model, chosen so the final guess is as un-blurry as possible.
This page assumes nothing . Before you can read the parent note Kalman gain , you must be able to read every symbol it throws at you: x , x ^ , e , P , E [ ⋅ ] , tr ( ⋅ ) , H , z , v , R , K , and the little superscripts − , + , ⊤ . We build them one at a time, each anchored to a picture.
x
The state x is the list of numbers that fully describes what you're tracking right now . For a moving drone it might be position and velocity: x = [ p v ] .
Picture: a single dot sitting at the true location on a number line (or a point in a plane if there are two numbers).
Why needed: everything else is defined by how far it is from this true dot. But here's the catch — you never actually see x . It's the hidden truth.
x ^ (read "x-hat")
The hat ^ always means "our best guess of." So x ^ is our guessed state — what we think x is.
Picture: a second dot, near the true dot but not on top of it.
Why needed: the whole filter is a machine for producing good hats. The gap between the dot and its hat is the enemy we're fighting.
Figure s01 (below): a horizontal number line with a green dot marking the true state x on the right and a blue dot marking our estimate x ^ to its left; a red arrow runs from the blue dot to the green dot, labelled e = x − x ^ — the error we're about to define.
Hat = guess. Any letter wearing a little hat is "our estimate of," never the truth.
Intuition Why "on average"?
Any single run, e could be big or small by luck. What we can pin down is its typical size across many runs . To talk about "typical," we need the expectation symbol.
Worked example Tiny expectation
If an error is + 2 half the time and − 2 half the time, then E [ e ] = 2 1 ( + 2 ) + 2 1 ( − 2 ) = 0 — average error zero. But the error is clearly not always zero! That's why we look at e 2 , not e : E [ e 2 ] = 2 1 ( 4 ) + 2 1 ( 4 ) = 4 . Squaring stops plus and minus from cancelling.
So far we only have the estimation error e ; the sensor and its noise arrive later in §7. So for now the zero-mean idea is stated for e alone (we'll repeat it for the sensor noise once that noise is defined).
Definition Unbiased (zero-mean) error
A good filter is unbiased : on average its guess lands exactly on the truth, so
E [ e ] = 0.
The error dots scatter around the truth with no consistent lean.
Picture: the centre-of-mass of the error cloud sits right on the true dot — not to its left or right.
Why needed: without this, "spread" and "covariance" (defined next in §4) would be measured around the wrong centre.
Intuition Variance only equals
E [ e 2 ] when the mean is zero
The general definition of variance subtracts the mean first: Var ( e ) = E [ ( e − E [ e ] ) 2 ] . Only when E [ e ] = 0 does this collapse to the tidy E [ e 2 ] we used above. When we build the matrix covariance in §4, this same zero-mean assumption is exactly what makes it a true covariance (spread about the mean) rather than a raw second moment. So keep this assumption in your pocket — every formula in the parent note quietly relies on it.
Definition Variance (one number)
With the zero-mean assumption above, variance = E [ e 2 ] = average squared error = the spread of the error cloud. Big variance = fuzzy guess; small variance = sharp guess.
When the state has several components (position and velocity), one variance per component isn't enough — errors in different components can be linked . We collect all of them into a matrix. (The ⊤ "transpose" symbol used just below is defined fully in §6; for now read e e ⊤ as "the column of errors times the same errors laid out as a row," which builds a square table.)
P is always symmetric and positive semidefinite
Two properties fall straight out of P = E [ e e ⊤ ] and are what make the "ellipse" picture legal:
Symmetric (P = P ⊤ ): because e e ⊤ is symmetric for every e (entry i , j equals entry j , i , both being e i e j ), so its average is too. A symmetric matrix has perpendicular axes — the ellipse's axes are well-defined.
Positive semidefinite (P ⪰ 0 ): for any direction u , the variance of the error along u is u ⊤ P u = E [( u ⊤ e ) 2 ] ≥ 0 — a squared thing can't be negative. This means the ellipse never has a "negative width," which would be nonsense.
A matrix that is symmetric and positive semidefinite is exactly one that draws a sensible ellipse — that's why P can be pictured that way at all.
Figure s02 (below): a wide blue ellipse and a small green ellipse, both centred on a white dot marked x ^ , drawn over axes "state component 1" and "state component 2". The wide ellipse is labelled "big blur = big P (unsure)"; the tight one "small blur (sure)" — showing that the size of the ellipse is the amount of uncertainty P encodes.
Intuition Smaller ellipse = better
The entire Kalman story is: start with a big ellipse, blend in a measurement, end with a smaller ellipse. The gain K is chosen to make the final ellipse as small as possible. See Covariance Matrices and Uncertainty for the full geometry.
Before the trace, one small piece of notation the parent note leans on:
Definition Euclidean norm
∥ ⋅ ∥
For a vector w = w 1 w 2 ⋮ , the Euclidean norm is its ordinary straight-line length:
∥ w ∥ = w 1 2 + w 2 2 + ⋯ , ∥ w ∥ 2 = w ⊤ w = w 1 2 + w 2 2 + ⋯
Picture: Pythagoras — the length of the arrow from the origin to the tip of w .
Why needed: ∥ x − x ^ ∥ 2 is the squared distance between guess and truth , our single "how wrong" number. Summing the squared component-errors is exactly what turns a whole error vector into one honest scalar.
Common mistake "Why not use the determinant?"
Why it feels right: the determinant is the ellipse's area , another size measure.
The fix: the trace equals total mean-squared error — a physically meaningful "expected wrongness." The clean matrix-calculus that yields K also works out only for the trace. So trace is both meaningful and tractable.
A ⊤
A ⊤ flips a matrix over its diagonal — rows become columns. A column vector e becomes a row vector e ⊤ .
Picture: tip the ledger on its side.
Why needed: e e ⊤ (column times row) builds the full P table; e ⊤ e (row times column) collapses to the single number ∥ e ∥ 2 . The order matters, and the transpose is what lets us choose. (This is the symbol we promised to explain back in §4.)
Definition Measurement matrix
H
H translates state-space into sensor-space. The state x might hold position and velocity, but a ruler only reads position. H picks out / mixes the parts of x the sensor actually sees.
Picture: an arrow labelled "convert" pointing from the state world to the measurement world.
Why needed: you can't compare a sensor reading to x directly — different worlds. H x ^ is "what we'd expect the sensor to read given our guess."
Figure s03 (below): a blue box on the left labelled "state-space" containing x = ( p , v ) (position and velocity), a yellow arrow labelled "H (convert)" pointing rightward, and a green box on the right labelled "measurement-space" containing "H x = position only" — illustrating that H drops/mixes state components down into what the sensor can actually read.
z
z = H x + v
The number the sensor actually spits out: the true state seen through H , plus a random smudge v .
Picture: the true reading H x , then a random wobble added on top.
v and its covariance R
v is the random error inside every reading. Exactly like the estimation error in §3, we assume it is zero-mean , E [ v ] = 0 (the sensor wobbles around the true reading with no built-in offset). Its typical size is then the true covariance R = E [ v v ⊤ ] — the sensor's own uncertainty ellipse (symmetric and positive semidefinite, by the same argument that gave those properties to P in §4).
Picture: a fuzzy halo around the true reading; wide halo = noisy sensor (big R ), tight halo = precise sensor (small R ).
Why needed: how much to trust a sensor depends entirely on how noisy it is. R is that noisiness, and it sits right inside the gain formula. See Innovation and Residuals for how z − H x ^ becomes the "surprise" the filter reacts to.
− and posterior +
x ^ − , P − (minus / "prior"): our guess and its blur before looking at the new measurement — straight from the model's prediction. See Kalman Filter — Predict Step .
x ^ + , P + (plus / "posterior"): our guess and its blur after folding the measurement in. See Kalman Filter — Update Step .
Picture: a wide "before" ellipse and a narrower "after" ellipse. The measurement squeezes minus into plus.
Minus = before we measured, Plus = after we measured.
Intuition Does measuring always shrink the ellipse?
Under the linear-Gaussian assumptions this whole topic uses (linear H , zero-mean uncorrelated Gaussian noise, and the optimal gain), the plus-ellipse is never bigger than the minus-ellipse — new information can only help. This is a consequence of those assumptions , not a universal law: with a nonlinear model (see Extended Kalman Filter (EKF) in GNC ), a badly chosen gain, or non-Gaussian noise, the posterior can actually come out worse . Keep the "measuring shrinks the ellipse" picture, but remember it's earned by the assumptions, not free.
Intuition The tug-of-war you're about to meet
Turn K up → you rely on the sensor more (good if the model is bad, bad if the sensor is noisy). Turn K down → you rely on the model more. Somewhere in between is a sweet spot — the bottom of a U-shaped valley. That valley is what the parent note's derivative hunts down. This blending of two sources is exactly Sensor Fusion in Navigation , and mathematically it's a recursive form of Least Squares Estimation .
Zero-mean assumption - E of e and v are 0
Covariance P - the blur ellipse
Expectation - average over luck
Euclidean norm - straight-line length
Trace - total blur as one number
Transpose - flip rows and columns
Noise v inside each reading
Gain K - the trust slider
Kalman gain - minimizes trace of covariance
Test yourself — you're ready for the parent note only if you can answer each without peeking.
What does a hat, as in x ^ , always mean? "Our best estimate / guess of" — never the true value.
Write the estimation error and say what it points to. e = x − x ^ ; the gap/arrow from our guess back to the truth.
What does E [ ⋅ ] compute and why do we need it? The average over infinitely many random repetitions; noise is random so we compare strategies by average behaviour.
Why do we square the error before averaging? So positive and negative errors don't cancel — E [ e ] can be 0 while the guess is still wrong; E [ e 2 ] captures true spread.
What zero-mean assumptions does the filter make, and why? E [ e ] = 0 and E [ v ] = 0 (unbiased); only then are P = E [ e e ⊤ ] and R = E [ v v ⊤ ] true covariances rather than raw second moments.
What does ∥ w ∥ mean? The Euclidean (straight-line) length
w 1 2 + w 2 2 + ⋯ ; and
∥ w ∥ 2 = w ⊤ w .
What is P in words, and what picture goes with it? The error covariance P = E [ e e ⊤ ] ; an uncertainty ellipse around the guess — its size is our blur.
What two properties does P always have, and why do they matter? Symmetric (P = P ⊤ ) and positive semidefinite (u ⊤ P u ≥ 0 ); these are exactly what let P be drawn as a sensible uncertainty ellipse.
Show why tr ( P ) = E [ ∥ x − x ^ ∥ 2 ] . tr ( P ) = tr ( E [ e e ⊤ ]) = E [ tr ( e e ⊤ )] = E [ e ⊤ e ] = E [ ∥ e ∥ 2 ] .
What does the matrix H do? Maps state-space into measurement-space; H x ^ is "what we'd expect the sensor to read."
What are v and R ? v is the random sensor noise inside each reading; R = E [ v v ⊤ ] is its size (the sensor's own uncertainty).
Distinguish the superscripts − and + . − = prior, before using the measurement; + = posterior, after using it.
Under what assumptions is the posterior ellipse never bigger than the prior? The linear-Gaussian setting with the optimal gain; it can fail for nonlinear models, bad gains, or non-Gaussian noise.
In one sentence, what is the Kalman gain K ? The 0-to-1 slider setting how much of the sensor's surprise we fold into our guess, chosen to minimize the after-blur.