14
$\begingroup$

What is the significance of the noise covariance matrices in the Kalman Filter framework?

I am referring to:

  • process noise covariance matrix Q, and
  • measurement noise covariance matrix R

at any time step t.

How do I interpret these matrices? What do they represent? Do they talk about how one observation's noise varies with respect to another observation's noise in the state vector?

$\endgroup$
2
  • $\begingroup$ Excellent intuitive explanation! I also have two questions 1. First what is the meaning of covariance of let's say 1,3 element of the acceleration covariance matrix? 2. Secondly, how does one tune the observation noise covriance matrix for the firs step of the algortihm? If that requires high computational effort or mathematics, what are some good typical values when trying to observe a multi degree of freedom vibrating system ? Thank you very much. $\endgroup$
    – george p
    Commented Nov 24, 2017 at 16:30
  • 1
    $\begingroup$ @georgep Please NEVER post follow-up questions as an answer. Please ask a new question, but perhaps link to this question when you do. $\endgroup$
    – Peter K.
    Commented Nov 24, 2017 at 21:42

1 Answer 1

21
$\begingroup$

Roughly speaking, they are the amount of noise in your system. Process noise is the noise in the process - if the system is a moving car on the interstate on cruise control, there will be slight variations in the speed due to bumps, hills, winds, and so on. Q tells how much variance and covariance there is. The diagonal of Q contains the variance of each state variable, and off diagonal contain the covariances between the different state variables (e.g. velocity in x vs position in y).

R contains the variance of your measurement. In the above example, our measurement might just be speed from the speedometer. Suppose it's reading has a standard deviation of 0.2 mph. Then R=[0.2^2]=[0.04]. Squared because variance is the square of the standard deviation.

Q is in state space, and R is in measurement space. In the example above, our state might be position only $[x, y]^T$, and measurement space is velocity $[v]$. That is problematic because that is not velocity in terms of x and y - you need the heading to convert. The Kalman filter matrix H is used to do that conversion, and in nonlinear systems you tend to have to linearize that in some manner.

Shameless plug: my free book on the Kalman filter goes into this in great detail: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python

$\endgroup$
5
  • 5
    $\begingroup$ The book looks great! $\endgroup$
    – Royi
    Commented Jul 3, 2015 at 18:57
  • $\begingroup$ If your measurement variables are your state variables, does that mean [Q] = [R]? $\endgroup$ Commented Feb 5, 2020 at 5:08
  • $\begingroup$ Thanks for opening the eye $\endgroup$
    – jomegaA
    Commented Feb 5, 2020 at 8:52
  • $\begingroup$ How to update Q and R in each iteration? $\endgroup$
    – nn0p
    Commented Nov 5, 2021 at 6:33
  • 1
    $\begingroup$ @nn0p: usually neither $Q$ not $R$ are updated. This paper provides a way how you can do it for the Extended Kalman Filter (EKF). $\endgroup$ Commented Jun 10, 2022 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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