4
$\begingroup$

I've recently started playing with the Kalman filter for a simple 2D (x,y,dx,dy) tracking toy problem. But I seem to have some misunderstanding on what I can expect from the filter. I'm interested in plotting the uncertainty ellipse from the corrected covariance matrix but noticed a few observations:

  • The covariance decreases to a steady state regardless of how much error I introduce into the measurement.

  • The variance for x and y are exactly the same even though I introduce more measurement errors in y.

Staring at the maths for a bit it seems that this is how the vanilla Kalman Filter works. What I'm expecting is the opposite of the two points mentioned above. In the end I want to plot an uncertainty ellipse that reflects the error I'm observing. Is this possible at all? Do I have to do some post processing on the covariance matrix?

ANSWER:

It occurred to me what I needed was a Kalman Filter that has the ability to adapt its covariance. I found this paper that details a few different methods to do this.

http://www.gmat.unsw.edu.au/snap/publications/almagbile_etal2010a.pdf

$\endgroup$
  • $\begingroup$ If you've found an answer, please post it as an answer and mark it as accepted. Thanks! $\endgroup$ – Peter K. May 12 '15 at 7:53
  • $\begingroup$ Could you please mark an answer? Thank You. $\endgroup$ – Royi Oct 27 at 11:15
4
$\begingroup$

The covariance matrix of a Kalman filter is a function of the $ Q $ and $ R $ matrices of the model.
If you use a model where $ R $ and $ Q $ are time invariant or known in prior then the calculation of the covariance matrix $ P $ can be done offline and isn't a function of the measurements.

In some cases, advanced implementations of Kalman Filter estimate the covariances $ R $ and $ Q $ on line according to some data gathered in the process of calculating the result.

$\endgroup$
  • $\begingroup$ I'm just learning about the Unscented Kalman Filter (UKF). It seems like the estimation of the predicted state covariance matrix needs to be done online. I thought the UKF would yield different estimates for the variances of x and y in some cases (e.g. dynamics moving only in the y direction). Should the UKF also yield identical estimates for variances for x and y? $\endgroup$ – user3731622 Dec 6 '16 at 18:48
  • $\begingroup$ Without knowing the model I can't say much. But if it is simple movement on 2D, why would you use UKF? UKF should be used for Non Linear Model. For instance measureing $ r $ and $ \theta $ instead of $ x $ and $ y $, $\endgroup$ – Royi Dec 6 '16 at 18:57
  • $\begingroup$ One reason to use the UKF might be to implement a single KF that supports both linear and non linear dynamic models. Let's just assume a simple constant acceleration dynamic model. $\endgroup$ – user3731622 Dec 6 '16 at 20:11
  • $\begingroup$ Would you open a new question with the whole model? Unless you show the non linear part of the model there is no point in UKF. $\endgroup$ – Royi Dec 7 '16 at 6:03
2
$\begingroup$

The covariance decreases to a steady state regardless of how much error I introduce into the measurement.

Yes, as @Drazick notes, if the $Q$ and $R$ matrices are time invariant, then the $P$ matrix will converge to a steady state that does not depend on the data (measurements).

The variance for x and y are exactly the same even though I introduce more measurement errors in y.

When you did that, did you change the $R$ matrix to take account of this extra error in one component over the other? (I'm assuming you just used $x$ and $y$ as the measurements). If the $R$ matrix was chosen to be $\sigma I$, then you will not see any difference between $x$ and $y$ state variances.

Even the Wikipedia page on Kalman filtering mentions what you can do if you need to estimate $Q$ and $R$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.