mathematics of the filter says it has two parts ,first one is estimating and second one is predicting. I am having doubt in prediction part. How it predicts the next step?
The main purpose of the Kalman filter is the estimation of those variables which cannot be measured directly. It consists of two steps per each time sample: prediction and correction.
Prediction utilizes a priori information of how the system should evolve over time, i.e., we try to guess the future variable values x' given their current values x by multiplying them by some system matrix F, namely, x' = Fx. The F matrix depends on the system and should be specified by the designer.
Correction utilizes available measurements. First, we should know how the measurements z are connected with the estimated variables x: z = Hx. Now we can compare the actual measurements z with the predicted measurements z' = Hx'. Then, the residual z - z' is multiplied by some gain matrix K and added to the predicted values x' to correct them: x'' = x' + K(z - z'), or, x'' = Fx + K(z - HFx).
The gain matrix K is computed in an "optimal" way, and it is this way that distinguishes the Kalman filter from other similar algorithms, called "observers". It is not obligatory to use the Kalman gain K. Sometimes it is even better to define a non-optimal but simple ad hoc observer (e.g., see the attachment).
The standard Kalman filter is not adaptive, i.e., it does not automatically adjust K by the actual error statistics contained in the model x' = Fx and in the measurements z. However, there are various adaptive extensions of the Kalman filter.
Article A Simple Observer for Gyro and Accelerometer Biases in Land ...
In the Kalman filter, the prediction step precedes the estimation one. the prediction is based on the model of the problem proposed by the designer. The Kalman filter allows to associate a covariance matrix to the error of the proposed model. This matrix is a decisive parameter in the stabilization of the filter solution.
I agree with M.Tereshkov that the Kalman filter in not adaptive in its standard version, but it is possible to modify it by adjusting its covariance matrices during the iterations.
Hello. As a previous poster said, the two parts of a recursive Kalman filter are the prediction and correction steps. Prediction is where you have information up to time k and you wish to estimate the PDF of the state at time k+1 without actually using the data from tiem k+1. This means evaluating E(x(k+1)|Y(k)) and Cov(x(k+1)|Y(k)) in the case of Gaussian processes where Y(k) is all the measurements up to time k: y(1), ..., y(k). For a linear system this is easy to do (see any reference on Kalman filtering). For a linear model, you are just continuing the straight line prediction. For a constant curvature (acceleration) model, you are just continuing the arc of the curve.
The correction step is when you update the state estimate to account for the data you actually measure. This involves calculating E(x(k+1)|Y(k+1)) and Cov(x(k+1)|Y(k+1)), which for a linear Gauss Markov system can be done in terms of the predicted state and its error covariance, along with the other system matrices. The crucial stage in this is writing the state and measurement as jointly Gaussian random variables - you then marginalise to get the conditional expectation (i.e. the extra conditioning on y(k+1)). See Anderson and Moore - Optimal Control.
An easy way to understand this process is to look at recursive least squares first. There is no state equation and it's easier to understand. The control literature on observers tends to focus on optimality, which is correct but obscurs the mechanics of the estimation. You can pose the problem as an optimal estimation problem in Hilbert space, etc., but it is probably easier to understand RLS and the conditional expectation method first, IMO. Remember that the conditional mean estimate is the MMSE estimate and Gaussian processes are characterised by their mean and covariance at all times.
In terms of adaptivity, the standard KF is not adaptive, as other posters have pointed out, although thte KF gain varies with time (being typically large at the start and smaller as time goes on). The statistics of the process and measurement noise must be known, even if they vary with time.
If there are unknown variations in these processes, the KF estimate may diverge because it tends to ignore the data (as the estimation covariance reaches a steady state with decreasing filter gain).
Typical remedies include increasing the process noise covariance, reducing the measurement noise covariance, reinitiatlising the filter, etc, to take account of the new data since the KF must "relearn" the statistics of the new process. A survey of this type of idea in the context of manoeuvring target tracking is contained in the link below.
Technical Report A Survey of Manoeuvring Target Tracking Methods
According to "Adaptive Signal Processing by Bernard Widrow, Peter N. Stearns" adaptive filter gives solution like Wiener filter (not Kalman filter).
But an adaptive Kalman filtering is possible too.
The target function of Wiener filter is
E[ek2]=E[ (dk - yk)2 ]=E[ (dk - WT X )2 ], where W - vector of coef., X - vector of signals, ek, dk, yk - scalars.
Optimal solution is
Wopt = E[ X XT ]-1 * E[ dk X ]
Adaptation process is search estimation of Wi of optimal solution Wopt from iteration to iteration.
The target function of Kalman filter is
sum[ek2]=|| Y - Y' ||2 = || Y - H X ||2 , where Y - vector of observed data, X - vector of required data, H - transfer matrix (model of observation), ek - elements of error vector, scalars.
Optimal solution is
Xopt = [ HT H ]-1 * HT * Y
Adaptation process is search estimation Xm of optimal solution Xopt from measuring to measuring.
How to make correction of estimations Xm of vector Xopt from measuring to measuring see post by Vasiliy Tereshkov.
The algorithm works in a two-step process. In the prediction step, the Kalman filter produces estimates of the current state variables, along with their uncertainties. Once the outcome of the next measurement (necessarily corrupted with some amount of error, including random noise) is observed, these estimates are updated using a weighted average, with more weight being given to estimates with higher certainty. Because of the algorithm's recursive nature, it can run in real time using only the present input measurements and the previously calculated state and its uncertainty matrix; no additional past information is required . Analysis of divergence of optimal estimators like Kalman filter (KF) was
appeared since the first papers given rise to the theoretical foundations
of KF . Indeed, it is recognized from navigation experiments, among others, that
the performance of KF under actual operating conditions can be seriously
degraded from the theoretical performance indicated by the state covariance matrix
inducing a divergence of KF. Typically, divergence is said to occur when the
covariance matrix produced by KF no longer provides a reasonable characterization of the error in estimate. Effects that may cause divergence are
various, for example: i) ill known parameters of the state or measurement models,
i.e.,the model itself is wrong or not adequate; ii) noisy errors are ill known;
iii) initial guesses; vi) strong non linearity.
Assuming that the models are linear and roughly acceptable up to some
Gaussian additive noise with known variance, then it was proven that the filter
converges to the steady state regardless of the initial conditions . This justifies
why particular interest has
been focused on the estimation of the noise
variance, or, equivalently, variance-covariance
matrices Q and R pertaining respectively to the state
and the measurement models. The resulting algorithm is known in the literature as Adaptive Kalman Filter (AKF), which has been investigated by several
researchers . Intuitively, in AKF, the filter adjusts its knowledge about the Q and R
values according to the gap between the predicted estimates and the current
Just a small correction for one of the previous posters who said that: "The target function of Kalman filter is sum [ek2]=|| Y - Y' ||2 = || Y - H X ||2", This is not correct since the system model for the Kalman filter is a stochastic dynamical system with random process noise (whereas the Weiner filter does not have this feature). There is also the error in the initial distribution to account for. The cost function for the Kalman filter actually has three terms, one for initial state error, one for prediction errors and one for measurement errors. The filter can be derived by minimising this cost function as a batch or recursive algorithm. Sorry I don't have the reference to hand but it is a classical result. Maybe someone can provide this.
To the previous poster. The Kalman filter will not diverge in the sense that a steady state filter covariance exists, if the dynamical system is completely controllable and observable. Divergence can be caused by modelling errors in the noise statistics, or due to nonlinearity, i.e. by failure to satisfy the assumptions on which the filter is based. An important source of divergence is the presence of false measurements or false alarms, this is not considered at all in standard KF theory.
I agree with the previous poster about adaptivity, which usually means fixing the KF because the modelling assumptions are not valid. This usually takes the form of increasing the KF gain, which can be thought of as "W=Q/R" (increase Q or reduce R) where Q is process noise covariance and R is measurement noise covariance, or by resetting/reinitialising the KF estimate. Either way you force the filter to take notice of more recent data.