The Kalman filter (WB95) aims to estimate the internal state
, which is not accessible, of a discrete-time system, given that the model knowledge is complete. In fact, the Kalman filter is the optimal recursive estimator: if the noise in the problem is Gaussian, the Kalman filter provides the least squares estimate of the internal state of the system.
For historical reasons, the Kalman filter specifically refers to the filtering of a system where the state transition and the observation are linear functions of the current state.
According to linear systems theory, the dynamics of a continuous-time "linear" system is represented by a differential equation of the form
| (2.93) |
| (2.94) |
The discrete-time Kalman filter assists real systems where the world is sampled at discrete intervals, transforming the continuous-time linear system into a linear system of the form
The variables and
represent the process noise and observation noise, respectively, with a mean value of zero
and known variances
and
(assuming white Gaussian noise).
is a state transition matrix,
is a matrix
that connects the optional control input
with the state
, and finally
is a matrix
that links the state with the measurement
. All these matrices, representing the system model, must be known with absolute precision, otherwise systematic errors will be introduced.
The Kalman filter is a recursive estimation filter that requires at each iteration the knowledge of the estimated state from the previous step
and the current observation
, which serves as an indirect observation of the system's state.
Let
be the a priori estimate of the system state, based on the estimate obtained at time
and the dynamics of the problem, and let
be the a posteriori estimate of the state based on the observation
.
From these definitions, it is possible to define the error of the a priori and a posteriori estimates as
| (2.96) |
| (2.97) |
The objective of the Kalman filter is to minimize the covariance of the a posteriori error and to provide a method for obtaining the estimate of
given the a priori estimate
and the observation
.
The Kalman filter provides a posterior state estimate through a linear combination of the previous state estimate and the observation error:
The Kalman filter is typically presented in two phases: the time update (prediction phase) and the measurement update (observation phase).
In the first phase, the a priori estimate of both
and the covariance
is obtained. The a priori estimate
derives from a good understanding of the system dynamics given by equation (2.95):
| (2.100) |
These are the best estimates of the state and the covariance at the instant that can be obtained a priori from the observation of the system.
In the second phase, the gain
Using this value for the gain , the a posteriori estimate of the covariance matrix becomes
To unify the various forms of the Kalman filters, these equations can be expressed using the variance-covariance matrices as follows:
It can be easily observed that the covariance matrix and the Kalman gain do not depend at all on the state, the observations, or the residual, and have an independent history.
However, the Kalman filter requires an initial value for the state variable and the covariance matrix: the initial state value should be as close as possible to the true value, and the degree of similarity to this value should be reflected in the initial covariance matrix.
It is interesting to illustrate, as an example, the simplified case of a one-dimensional Kalman state filter that coincides with the observable. The transition and observation equations are
| (2.106) |
where is the process noise whose variance
represents the estimate of the probability of variation of the signal itself (low if the signal varies little over time, high if the signal varies significantly), while
is the observation noise with variance
, which is the noise associated with the observation of the state.
The prediction cycle is very simple and becomes:
| (2.107) |
The Kalman gain becomes
| (2.108) |
It is usually possible to estimate the value of a priori, while the value of
must be determined through experiments.
As seen in the first of the equations (2.109), the factor is essentially a blending factor between the observation of the state and the previously estimated state.
In the one-dimensional case, it is easy to see how the gain and the variance
are independent of the state and the observations, let alone the error. If
and
do not vary over time,
and
are numerical sequences that converge to a constant value determined solely by the characterization of the noise, regardless of the initial values. This result should be compared with what is obtained from equation (2.65).
Paolo medici