7
$\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.

Evaluating the performances of adaptive Kalman filter methods in GPS/INS integration by Ali Almagbile, Jinling Wang, and Weidong Ding, 2010

$\endgroup$
2
  • $\begingroup$ If you've found an answer, please post it as an answer and mark it as accepted. Thanks! $\endgroup$
    – Peter K.
    May 12, 2015 at 7:53
  • $\begingroup$ The link doesn't work. Could you write the title of the paper? $\endgroup$
    – Mark
    Feb 23, 2021 at 5:39

2 Answers 2

3
$\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$
4
  • $\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$ Dec 6, 2016 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, 2016 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$ Dec 6, 2016 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, 2016 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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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