The Kalman filter (WB95) estimates the inaccessible internal state
of a discrete-time system in the presence of disturbances, assuming complete knowledge of the system model.
In fact, the Kalman filter is the optimal recursive estimator: if the noise is Gaussian, it provides the least-squares estimate of the system's internal state.
For historical reasons, the term Kalman filter properly refers only to filtering a system whose state transition and observation are linear functions of the current state.
According to linear systems theory, the dynamics of a “linear” continuous-time system are represented by a differential equation of the form
| (3.11) |
| (3.12) |
The discrete-time Kalman filter is suitable for real systems, in which the world is sampled at discrete intervals. It transforms the continuous-time linear system into a linear system of the form
The variables and
represent process and observation noise, respectively, with zero mean
and known covariance matrices
and
, respectively (assuming white Gaussian noise).
is a state transition matrix
,
is a matrix
that relates the optional control input
to the state
, and finally
is a matrix
that relates the state to the measurement
.
All these matrices, which represent the system model, must be known precisely; otherwise, systematic errors will be introduced.
The Kalman filter is a recursive estimator that requires, at each iteration, the state estimate from the previous step
and the current observation
, an indirect observation of the system state.
Let
be the prior estimate of the system state, based on the estimate at time
and the problem dynamics, and let
be the posterior state estimate after observing
, based on that observation.
These definitions allow us to define the prior and posterior estimation errors as
| (3.14) |
| (3.15) |
The Kalman filter aims to minimize the posterior error covariance and provide a way to estimate
given the prior estimate
and the observation
.
The Kalman filter provides a posterior state estimate as a linear combination of the previous state estimate and the observation error:
The first stage computes the prior estimate of both
and its covariance
.
The prior estimate
is obtained from knowledge of the system dynamics (3.13):
| (3.18) |
These are the best prior estimates of the state and covariance at time , before observing the system.
In the second stage, the gain is computed:
Using this value for the gain , the posterior covariance matrix becomes
To unify the different variants of Kalman filters, these equations can be rewritten using the variance-covariance matrices
As can readily be seen, neither the covariance matrix nor the Kalman gain depends on the state, the observations, or the residual; they evolve independently.
The Kalman filter nevertheless requires initial values for the state variable and covariance matrix: the initial state should be as close as possible to the true value, and the degree of confidence in this value should be encoded in the initial covariance matrix.