The Kalman filter describes the evolution of a state estimate with time. We're concerned with a state described by a probability distribution. The distribution is assumed to be Gaussian, so it's described with a mean x and a variance Σ.
The system evolves according to a model F. So x1=Fx0 and Σ1=FΣ0FT.
Additionally, we have a measurement of the state. This is also assumed to be a Gaussian distribution, with mean z and variance R.
The Kalman trick is to realize that we have, at this point, two distributions describing our state knowledge from different avenues, and we should combine these to get our actual current knowledge distribution x and Σ. For Gaussian distributions this is particularly simple, and the combined distribution is still Gaussian, so can be described with a combined mean and covariance.
x=x1+Σ1(z−x1)Σ1+R
Σ=Σ1−Σ21Σ1+R
There's a common factor here, call it K
K≡Σ1Σ1+R
This is sometimes called the Kalman gain.
x=x1+K(z−x1)Σ=Σ1−KΣ1
From here, let us assume a multi-variate situation, so that x is a vector, and use Σ for the covariance matrix, instead of Σ for variance.
Just one more thing gets us to a description of the Kalman update. The measurement space, with its particular units, etc., might not be the same as our state space. Let's use H to get back and forth between these domains: ˆx=Hx and ˆΣ=HΣHT We can now write the Kalman update:
ˆx=^x1+K(z−^x1)ˆΣ=^Σ1−K^Σ1K≡^Σ1[^Σ1+R]−1
Hx=Hx1+K(z−Hx1)HΣHT=HΣ1HT−KHΣ1HTK≡HΣ1HT[HΣ1HT+R]−1
We can knock an H off the front of the equation for x and off the front and back of the equation for Σ, giving the final update relations.
x=x1+K′(z−Hx1)Σ=Σ1−K′HΣ1K′≡Σ1HT[HΣ1HT+R]−1