The Kalman filter is an effective recursive filter that evaluates the state vector of a dynamic system using a series of incomplete and noisy measurements. Named after Rudolf Kalman .
The Kalman filter is widely used in engineering and econometric applications: from radars and vision systems to parameter estimates of macroeconomic models [1] [2] . Kalman filtration is an important part of control theory , plays a large role in the creation of control systems. Together with the linear-quadratic controller, the Kalman filter allows solving the linear-quadratic Gaussian control problem. The Kalman filter and the linear-quadratic controller are a possible solution to most of the fundamental problems in control theory.
In most applications, the dimension of the object state vector exceeds the dimension of the observation data vector. And at the same time, the Kalman filter allows you to evaluate the complete internal state of the object.
The Kalman filter is designed to recursively underestimate the state vector of an a priori known dynamic system, that is, to calculate the current state of the system, you need to know the current measurement, as well as the previous state of the filter itself. Thus, the Kalman filter, like other recursive filters, is implemented in the temporal, and not in the frequency representation, but unlike other similar filters, the Kalman filter operates not only with state estimates, but also with uncertainties (distribution density) of the state vector, relying on on Bayes formula of conditional probability .
The algorithm works in two stages. At the forecasting stage, the Kalman filter extrapolates the values of state variables, as well as their uncertainties. At the second stage, according to the measurement data (obtained with some error), the extrapolation result is specified. Due to the step-by-step nature of the algorithm, it can track the state of the object in real time (without looking ahead, using only current measurements and information about the previous state and its uncertainty).
There is an erroneous opinion that for the correct operation of the Kalman filter, a Gaussian distribution of input data is allegedly required. In the initial work of Kalman, the results on the minimum filter covariance were obtained on the basis of orthogonal projections, without assuming that the measurement errors are Gaussian. [3] Then it was simply shown that for a special case of the Gaussian error distribution, the filter gives an accurate estimate of the conditional probability of the distribution of the state of the system.
A good example of filter capabilities is obtaining optimal, continuously updated estimates of the position and speed of an object based on the results of a time series of inaccurate measurements of its location. For example, in radar, the task is to track the target, determine its location, speed and acceleration, while the measurement results arrive gradually and are very noisy. The Kalman filter uses a probabilistic model of target dynamics that defines the type of probable movement of the object, which allows you to reduce the impact of noise and get good estimates of the position of the object in the present, future or past time.
Introduction
The Kalman filter operates with the concept of the state vector of the system (a set of parameters describing the state of the system at some point in time) and its statistical description. In the general case, the dynamics of a state vector is described by the probability densities of the distribution of its components at each moment in time. In the presence of a certain mathematical model of the observations made for the system, as well as a model for a priori changing the parameters of the state vector (namely, as a Markov forming process ), one can write the equation for the posterior probability density of the state vector at any moment in time. This differential equation is called the Stratonovich equation . The Stratonovich equation in general is not solved. An analytical solution can be obtained only in the case of a number of restrictions (assumptions):
- Gaussian a priori and a posteriori probability densities of the state vector at any moment of time (including the initial one)
- Gaussian shaping noises
- Gaussian observation noises
- white noise of observations
- linearity of the observation model
- linearity of the model of the forming process (which, recall, should be a Markov process)
The classical Kalman filter is the equation for calculating the first and second moments of the posterior probability density (in the sense of the mathematical expectation vector and the variance matrix, including mutual) under these restrictions. Due to the fact that the mathematical expectation and the dispersion matrix for the normal probability density completely determine the probability density, we can say that the Kalman filter calculates the posterior probability density of the state vector for each moment in time. So it completely describes the state vector as a random vector quantity.
The calculated values of the mathematical expectations are optimal estimates by the standard error criterion, which determines its widespread use.
There are several varieties of the Kalman filter, differing in approximations and tricks that have to be used to reduce the filter to the described form and reduce its dimension:
- (EKF, Extended Kalman filter). Reduction of non-linear models of observations and the forming process using linearization by expanding in a Taylor series ;
- Kalman sigma point filter (UKF, Unscented Kalman filter) . It is used in problems in which simple linearization leads to the destruction of useful links between the components of the state vector. In this case, “linearization” is based on a ;
- Ensemble Kalman filter (EnKF). Used to reduce the dimension of the task;
- options with a nonlinear additional filter are possible, allowing to bring non-Gaussian observations to normal;
- options with a “whitening” filter are possible, allowing you to work with “color” noise ;
- etc.
In addition, there are analogues of the Kalman filter that use the full or partial model of continuous time:
- Kalman-Bucy filter, in which both the evolution of the system and the measurements take the form of functions of continuous time;
- Kalman hybrid filter, using continuous time to describe the evolution of the system, and discrete time points for measurements.
Historical Overview and Names
The filter is named after the Hungarian mathematician Rudolph E. Kalman , who emigrated to the United States. Although Torvald, Nikolai Thiele [4] [5] and developed a similar algorithm before (Thiele considered only a certain particular setting, while the Sverling algorithm is almost identical to the Kalman one). Richard S. Bucy of the University of Southern California contributed to the theory that led to the so-called Kalman-Bucy filter. is considered the first to implement the Kalman filter during Kalman’s visit to the Ames Research Center , so Kalman saw the applicability of his ideas to the trajectory estimation problem for the Apollon program , which ultimately led to the inclusion of this filter into the Apollo computer navigation system. The Kalman filter was first described and partially developed in the works of Sverling (1958), Kalman (1960) and Kalman and Bucy (1961).
Kalman filters proved to be critical for the implementation of navigation systems of submarines of the US Navy with nuclear ballistic missiles on board, in navigation systems of cruise missiles, for example, Tomahawks . It was also used in the navigation and control systems of the NASA Space Shuttle project, and is used in the ISS control and navigation systems.
The Kalman digital filter is sometimes called the Stratonovich – Kalman – Bucy filter, since it is a special case of a more general, nonlinear filter, developed somewhat earlier by the Soviet mathematician R. L. Stratonovich [6] [7] [8] [9] . In fact, some of the equations for particular cases of a linear filter appeared in these works of Stratonovich, published before the summer of 1960, when Kalman met with Stratonovich during a conference in Moscow.
The used model of a dynamic system
Kalman filters are based on time- discrete linear dynamic systems . Such systems are modeled by Markov chains using linear operators and terms with a normal distribution . The state of the system is described by a vector of finite dimension - a state vector . At each time step, the linear operator acts on the state vector and translates it into another state vector (deterministic state change), some normal noise vector (random factors) is added, and in the general case the control vector simulating the influence of the control system. The Kalman filter can be considered as an analogue of hidden Markov models , with the difference that the variables describing the state of the system are elements of an infinite set of real numbers (as opposed to a finite set of state space in hidden Markov models). In addition, hidden Markov models can use arbitrary distributions for subsequent values of the state vector, in contrast to the Kalman filter, which uses the normally distributed noise model. There is a strict relationship between the Kalman filter equations and the hidden Markov model. A review of these and other models is given by Roweis and Chahramani (1999) [10] .
When using the Kalman filter to obtain estimates of the state vector of a process from a series of noisy measurements, it is necessary to present a model of this process in accordance with the filter structure - in the form of a matrix equation of a certain type. For each cycle k of the filter operation, it is necessary to determine the matrices in accordance with the description below: process evolution F k ; observational matrix H k ; covariance matrix of the process Q k ; covariance matrix of noise measurements R k ; in the presence of control actions, the matrix of their coefficients B k .
The system / process model implies that the true state at time k is obtained from the true state at time k −1 in accordance with the equation:
- ,
Where
- F k - matrix of the process / system evolution, which acts on the vector x k −1 (state vector at the moment k −1 );
- B k is the control matrix, which is applied to the vector of control actions u k ;
- w k is a normal random process with zero expectation and a covariance matrix Q k that describes the random nature of the evolution of a system / process:
At time k , observation (measurement) z k of the true state vector x k is carried out, which are interconnected by the equation:
where H k is the measurement matrix connecting the true state vector and the vector of measurements made, v k is the white Gaussian measurement noise with zero mean and the covariance matrix R k :
The initial state and vectors of random processes on each clock cycle { x 0 , w 1 , ..., w k , v 1 , ..., v k } are considered independent .
Many real dynamic systems cannot be accurately described by this model. In practice, unaccounted for dynamics in the model can seriously spoil the filter’s performance, especially when working with an unknown stochastic input signal. Moreover, unaccounted for dynamics in the model can make the filter unstable . On the other hand, independent white noise as a signal will not lead to a divergence of the algorithm. The problem of separating measurement noise from dynamics unaccounted for in the model is complex; it is solved using the theory of robust control systems .
Kalman Filter
The Kalman filter is a type of recursive filter . To calculate an estimate of the state of the system for the current step of work, he needs an assessment of the state (in the form of an assessment of the state of the system and an estimate of the error in determining this state) at the previous step of work and measurement at the current step. This property distinguishes it from packet filters that require knowledge of the history of measurements and / or estimates at the current cycle. Further under the entry we will understand the estimate of the true vector at the moment n taking into account measurements from the moment of the beginning of work and up to the moment m inclusively.
The state of the filter is set by two variables:
- - a posteriori assessment of the state of the object at time k obtained from observations up to and including time k (in Russian-language literature it is often indicated where means "assessment", and k is the measure number at which it was received);
- - an a posteriori covariance error matrix that determines the accuracy of the obtained state vector estimate and includes the error variance of the calculated state and covariance error, showing the identified relationships between the state parameters of the system (in Russian literature )
Each iteration of the Kalman filter is divided into two phases: extrapolation (forecast) and correction. During extrapolation, the filter receives a preliminary assessment of the state of the system. (in Russian-language literature is often indicated where means “extrapolation”, and k is the measure number at which it was received) for the current step according to the final assessment of the state from the previous step (or preliminary assessment for the next measure according to the final assessment of the current step, depending on the interpretation). This preliminary estimate is also called an a priori state estimate, since observations of the corresponding step are not used to obtain it. In the correction phase, a priori extrapolation is supplemented by relevant current measurements to correct the estimate. The adjusted estimate is also called an a posteriori state estimate, or simply an estimate of the state vector . Usually these two phases alternate: extrapolation is carried out according to the results of the correction until the next observation, and the correction is carried out together with the observations available at the next step, etc. However, another development of events is possible, if for some reason the observation turned out to be unavailable, then the correction stage may be skipped and performed by extrapolation according to an unadjusted estimate (a priori extrapolation). Similarly, if independent measurements are available only at separate clock cycles, corrections are still possible (usually using a different observation matrix H k ).
Next, we consider the operation of the classical optimal Kalman filter.
Extrapolation Stage
Extrapolation (prediction) of the state vector of the system according to the estimation of the state vector and the applied control vector from step ( k −1 ) to step k : | |
Covariance matrix for the extrapolated state vector : |
Correction Stage
The deviation of the observation obtained in step k from the observation expected during the extrapolation: | |
Covariance matrix for the deviation vector (error vector): | |
The Kalman optimal gain matrix formed on the basis of the covariance matrices of the extrapolation of the state vector and the measurements obtained (by means of the covariance matrix of the deviation vector): | |
Correction of the previously obtained extrapolation of the state vector — obtaining an estimate of the state vector of the system: | |
Calculation of the covariance matrix for estimating the system state vector: |
The expression for the covariance matrix for estimating the state vector of the system is valid only when using the reduced optimal vector of coefficients. In the general case, this expression has a more complex form.
Invariants
If the model is absolutely accurate and the initial conditions are absolutely precisely set and , then the following values are stored after any number of iterations of the filter — they are invariants:
Mathematical expectations of estimates and extrapolations of the state vector of the system, the error matrix are zero-vectors:
Where - expected value .
The calculated matrices of covariances of extrapolations, estimates of the state of the system, and the error vector coincide with the true matrices of covariances:
Filter construction example
Imagine a trolley standing on infinitely long rails in the absence of friction . Initially, it rests at position 0, but under the influence of random factors, random acceleration arises. We measure the position of the trolley every ∆ t seconds, but the measurements are inaccurate. We want to get estimates of the position of the trolley and its speed. We apply the Kalman filter to this problem, define all the necessary matrices.
In this problem, the matrices F , H , R, and Q are independent of time; we omit their indices.
The coordinate and speed of the trolley is described by a vector in the linear state space
Where - speed (first derivative of the coordinate by time).
We assume that between the ( k −1 ) th and k th steps the trolley moves with constant acceleration a k distributed according to the normal law with zero mean and standard deviation σ a . According to Newtonian mechanics can be written
Where
The control matrix is written as a vector
- .
The control vector degenerates into a scalar a k .
Random covariance matrix
- ( σ a is a scalar).
At each step of the work, the position of the trolley is measured. Suppose that the measurement error v k has a normal distribution with zero mathematical expectation and standard deviation σ z . Then
Where
and the covariance matrix of observation noise has the form
- .
The initial position of the trolley is known exactly
- ,
- .
If the position and speed of the trolley is known only approximately, then the dispersion matrix can be initialized with a sufficiently large number L so that this number exceeds the variance of the coordinate measurements
- ,
- .
In this case, in the first steps of operation, the filter will use the measurement results more heavily than the available a priori information.
Derivation of formulas
Covariance matrix of state vector estimation
By the definition of the covariance matrix P k | k
we substitute the expression for estimating the state vector
and paint the expression for the error vector
and measurement vectors
we take out the vector of measurement error v k
since the measurement error vector v k is not correlated with other arguments, we obtain the expression
in accordance with the properties of the covariance of vectors, this expression is converted to
replacing the expression for the covariance matrix of extrapolation of the state vector by P k | k −1 and determination of the covariance matrix of observation noise on R k , we obtain
The resulting expression is valid for an arbitrary matrix of coefficients, but if the matrix of coefficients that is optimal according to Kalman acts as this matrix, then this expression for the covariance matrix can be simplified.
Optimum Gain Matrix
The Kalman filter minimizes the sum of the squares of the mathematical expectations of the errors in estimating the state vector.
State vector estimation error vector
The task is to minimize the sum of the mathematical expectations of the squares of the components of this vector
- ,
which is equivalent to minimizing the trace of the covariance matrix for estimating the state vector P k | k . We substitute the existing expressions into the expression for the covariance matrix of the state vector estimate and add to the full square:
Note that the last term is a covariance matrix of some random variable; therefore, its trace is non-negative. The trace minimum is reached when the last term is zeroed:
It is argued that this matrix is the desired one and when used as a matrix of coefficients in the Kalman filter it minimizes the sum of the mean square errors of the state vector estimate.
The covariance matrix for estimating the state vector when using the optimal matrix of coefficients
The expression for the covariance matrix for estimating the state vector P k | k when using the optimal matrix of coefficients takes the form:
-
.
This formula is computationally simpler and therefore almost always used in practice, but it is correct only when using the optimal matrix of coefficients. If, due to low computational accuracy, a problem arises with computational stability, or if a matrix of coefficients other than optimal is specially used, the general formula should be used for the covariance matrix for estimating the state vector.
Kalman Filter - Bussy
Kalman Filter - Buci (named after Richard Snowden Buci) - version of the Kalman filter for continuous time [11] [12] , is based on the following continuous dynamic state model:
here and will represent the intensities of two terms (with white noise characteristics) and , respectively.
The filter consists of two differential equations, one of which serves to assess the state of the system, and the other to assess covariance:
где коэффициент Калмана получается по формуле
Отметим, что в выражении для ковариация шумов наблюдения представляет одновременно ковариацию ошибки предсказания ; причем эти ковариации равны только для случая непрерывного времени. [13]
Различие между шагами прогноза и коррекции в дискретной калмановской фильтрации не имеет места для непрерывного случая.
Второе дифференциальное уравнение для ковариации — это пример уравнения Риккати .
Гибридный фильтр Калмана
Большинство физических систем имеют модель непрерывного времени для эволюции состояния системы, и модель дискретных измерений для уточнения состояния. Поэтому модель фильтра может быть представлена так:
Where
- .
- Инициализация
- Forecast
Уравнения прогноза взяты из фильтра Калмана-Бюси с непрерывным временем, при . Прогноз состояния и ковариации получается интегрированием дифференциальных уравнений с начальным значением, взятым из предыдущего шага коррекции.
- Correction
-
- {\ displaystyle {\ hat {\ mathbf {x}}} _ {k \ mid k} = {\ hat {\ mathbf {x}}} _ {k \ mid k-1} + \ mathbf {K} _ { k} (\ mathbf {z} _ {k} - \ mathbf {H} _ {k} {\ hat {\ mathbf {x}}} _ {k \ mid k-1})}
- {\ displaystyle {\ hat {\ mathbf {x}}} _ {k \ mid k} = {\ hat {\ mathbf {x}}} _ {k \ mid k-1} + \ mathbf {K} _ { k} (\ mathbf {z} _ {k} - \ mathbf {H} _ {k} {\ hat {\ mathbf {x}}} _ {k \ mid k-1})}
Correction equations are identical to equations from a discrete Kalman filter.
Criticism of the Kalman Filter
At the moment, the main criticism of the Kalman filter is carried out in the following areas [14] :
- In the Kalman filter, errors are represented by white noise, which actually does not exist in nature.
- There is no correspondence to the necessary and sufficient optimality condition
- at
- Error in the Kalman filter output - conflicting conditions of fidelity of different equations of the algorithm are required: in some so that τ < t and in others τ = t .
Accordingly, the position of the proponents of the optimality of this filter is that [15] :
- It is possible to create a modified Kalman filter, in which the errors will be represented by color noise .
- Using the optimality condition in certain cases leads to a less accurate result than that used in the Kalman filter.
- When deriving the Kalman filter, one can accept the conditions: τ < t , τ → t , which eliminates the contradiction.
Where used
- Course verticals
- Autopilot
- Navigation systems :
- Inertial
- Relief (according to digital maps of the area)
- Satellite
See also
- Marelei theorem
Literature and Publications
- Kalman Filter
- Translation of the article "Kalman Filter"
- “Kalman filter for dummies: the observability matrix and the fundamental matrix”
- Peter Joseph "INTRODUCTORY LESSON: The one-dimensional Kalman Filter"
- Perov, A.I. Statistical Theory of Radio Engineering Systems. - M .: Radio Engineering, 2003 .-- 400 p. - ISBN 5-93108-047-3 .
- Tsyplakov, A. (2011) Introduction to modeling in state space. - Quantile, No. 9, pp. 1-24.
Notes
- ↑ Ingvar Strid & Karl Walentin (2009), " Block Kalman Filtering for Large-Scale DSGE Models ", Computational Economics (Springer). - T. 33 (3): 277–304 , < http://www.riksbank.se/Upload/Dokument_riksbank/Kat_publicerat/WorkingPapers/2008/wp224ny.pdf >
- ↑ Martin Møller Andreasen (2008), Non-linear DSGE Models, The Central Difference Kalman Filter, and The Mean Shifted Particle Filter , < ftp://ftp.econ.au.dk/creates/rp/08/rp08_33.pdf >
- ↑ Kalman, RE (1960). "A new approach to linear filtering and prediction problems." Journal of Basic Engineering 82 (1): pp. 35–45
- ↑ . Time series analysis in 1880. A discussion of contributions made by TN Thiele: [ eng. ] // International Statistical Review. - 1981. - Vol. 49, No. 3 (December). - P. 319–331. - DOI : 10.2307 / 1402616 . - .
- He derives a recursive procedure for estimating the regression component and predicting the Brownian motion. The procedure is now known as Kalman filtering.
- ↑ Lauritzen S. L. Thiele: Pioneer in Statistics . - New York: Oxford University Press , 2002. - P. 41. - ISBN 0-19-850972-3 .
- He solves the problem of estimating the regression coefficients and predicting the values of the Brownian motion by the method of least squares and gives an elegant recursive procedure for carrying out the calculations. The procedure is nowadays known as Kalman filtering.
- ↑ Stratonovich, RL (1959). Optimum nonlinear systems which bring about a separation of a signal with constant parameters from noise . Radiofizika, 2: 6, pp. 892-901.
- ↑ Stratonovich, RL (1959). On the theory of optimal non-linear filtering of random functions . Theory of Probability and its Applications, 4, pp. 223-225.
- ↑ Stratonovich, RL (1960) Application of the Markov processes theory to optimal filtering . Radio Engineering and Electronic Physics, 5:11, pp. 1-19.
- ↑ Stratonovich, RL (1960). Conditional Markov Processes . Theory of Probability and its Applications, 5, pp. 156-178.
- ↑ Roweis, S. and Ghahramani, Z., A unifying review of linear Gaussian models , Neural Comput. Vol. 11, No. 2, (February 1999), pp. 305-345.
- ↑ Bucy, RS and Joseph, PD, Filtering for Stochastic Processes with Applications to Guidance, John Wiley & Sons, 1968; 2nd Edition, AMS Chelsea Publ., 2005. ISBN 0-8218-3782-6
- ↑ Jazwinski, Andrew H., Stochastic processes and filtering theory, Academic Press, New York, 1970. ISBN 0-12-381550-9
- ↑ Kailath, Thomas, “An innovation approach to least-squares estimation Part I: Linear filtering in additive white noise”, IEEE Transactions on Automatic Control , 13 (6), 646–655, 1968
- ↑ http://www.tgizd.ru/mag/aviakos/aviakos_7_6_7.shtml G. F. Savinov On some features of the Kalman-Bucy optimal filtering algorithm // Aerospace Instrumentation No. 6, 2007
- ↑ A. Yu. Gorbachev Evaluation criteria for optimal filtration algorithms // Aerospace Instrumentation No. 6, 2008