Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Defining a kalman filter and its application ( Concept)

I have a simple problem. I am tracking an object and getting its position in non-uniform time intervals. Velocity and accelration of object are not constant.

data_=[time x,y,z]

To design a kalman filter, I need to define

z=[x;y;z] % observation

% Estimation vector
xt=[xt;yt;zt;x't;y't;z't]  % ' first derivative



P=Covariance matrix of estimation vector 
R=Covariance matrix of measurement 
Q= covariance of noise

Question1: What is difference between these two R & P If measurment accuracy is 1mm what would be P? Question2: What is benefit of using this Kalman filter in post processing. It it to get smoth trajectory if yes why we need it.

Hope I will get enough information from you people.

like image 224
Shahgee Avatar asked Jun 04 '12 19:06

Shahgee


People also ask

What are the applications of Kalman filter?

A common application is for guidance, navigation, and control of vehicles, particularly aircraft, spacecraft and ships positioned dynamically. Furthermore, Kalman filtering is a concept much applied in time series analysis used for topics such as signal processing and econometrics.

What is Kalman filter?

Kalman filters are used to optimally estimate the variables of interests when they can't be measured directly, but an indirect measurement is available. They are also used to find the best estimate of states by combining measurements from various sensors in the presence of noise.

How the Kalman filter algorithm used in radar application?

1. Introduction Kalman filter known as linear quadratic estimation, is an algorithm that uses a series of measurements observed over time, containing statistical noise and other inaccuracies, and produces estimates of unknown variables that tend to be more accurate than those based on a single measurement alone.

What are the advantages of Kalman filter?

For the linear problems, Kalman filter provides a sequential, unbiased, and minimum error variance estimate under the assumption of known statistics of system and measurement errors. The major advantage of Kalman filter in oceanic applications is that it can quantitatively generate flow-dependent error covariance.


2 Answers

Question 1

R is the covariance matrix of the measurement. It has nothing to do with your model and your estimations.

P is the covariance matrix of the errors in your estimations. It is totally realted to your model and the way you estimate the state. P has nothing to do with your accuracy on measurements. You have to compute it every iteration with update equations.

Question 4

Kalman's goal is filtering noisy measurements of the state you want to track, so you can get a result more similar to the real state without noise (noise is uncertainty in your measurements).

like image 132
Jav_Rock Avatar answered Jan 03 '23 17:01

Jav_Rock


Kalman filter can be described first by graphical model that shows dependencies, independences, what's hidden and what's observed, how things evolve; also by probability formulas and only then by explicitly writing these probabilities through matrices that represents noise, linear models, etc. Understanding probabilities is a first unavoidable step before writing them as matrix models (a typical mistake is jumping to the matrices and linear algebra without understanding underlying probabilistic framework).

Below W means world state variable (hidden) and X represent measurements; lower index t is a time step.

Question 1: You have two models that Kalman filter is based on:
a. Data model P(Xt|Wt) = probability of measurement given a hidden state of the world; this is simply a model of the noise in data (represented by R) which also linearly transforms W to get X (using some other matrix); NOTE that it depends only on current step Wt, i.e. no history involved.
b. Temporal transition model P(Wt|Wt-1) which shows how your system evolves (e.g. moves, accelerates); just like the previous model it also has some uncertainty (not noise but similar) represented by P and also some linear transition matrix (to transform states in time);
c. Q? 'covariance of noise' is a strange term in your question since it doen't say where this noise comes from. Often in descriptions Q is what you referred by P, so you probably just mistaken P for Q or vice versa.

Question 2: the goal of Kalman filter is to give a statistically optimal estimate of the hidden world state at time t given measurements at time t as well as the history of measurements. Since the history is incorporate one step at a time (Markov property) you "measurement incorporation" step combines a current measurement with its estimation so that the resulting uncertainty is smaller than in each of these pieces of information.

In layman's terms a Kalman filter takes a weighted average of your data and data prediction where the weights are reliabilities (inversely proportional to the variances). In statistical terms, a Kalman filter is a Markov model that assumes dependence on the previous step only and uses posterior probability of state at t-1 to evaluate the prior at time t (prediction step) and then combine this prior with data probability in Bayesian framework (measurement incorporation step). Read formuli below like this:

     prediction: current state guess  = transition_model * prev. state guess

P(Wt | Xt1..t-1) = Integral[ P(Wt|Wt-1) * P(Wt-1 | X1..t-1) dWt-1]

          measurement: best estimate = data_noise_model * current state guess

P(Wt | Xt1..t) = P(Xt | Wt) P(Wt | Xt1..t-1) /P(Xt1..t)

Note a tiny difference in LHS (a top formula has t-1 and the bottom one has t stressing that a current measurement is taken into account). Note the similarity of left sides, this is a key for a Kalman filter update: previous posterior become a prior. You learn something and then use it as your assumptions to learn/estimate more.

like image 42
Vlad Avatar answered Jan 03 '23 18:01

Vlad