3
$\begingroup$

I am quite confused about the interpretations/implementation of the system and measurement noise covariance matrices for the continuous and discrete time Kalman Filter. What I want is to initialize those matrices with physically meaningful values for the continuous system (think continuously, implement discrete).

I know that the standard deviation has the same unit as the corresponding quantitiy, e.g., for the (arbitrary) system $$ \begin{align} \dot{x}&=Ax+Bu+w,\quad &w\in\mathcal{N}(0,Q_c)\\ y&=Cx+v,\quad &v\in\mathcal{N}(0,R_c) \end{align} $$ if $x=[s,\,v]^\top$ are the position and velocity of a falling particle, respectively, the covariances $Q_c=\text{diag}(\sigma_{w,\,1}^2,\,\sigma_{w,\,2}^2)$ have the units [m$^2$/s$^2$] and [m$^2$/s$^4$] (since the standard deviations have the same units as $\dot s$ and $\dot v$), and $R_c=\sigma_v^2$ has unit [m$^2$] (the same as $s$). So far so good. For the sake of completeness, the discrete-time Kalman Filter ​equations read $$ \begin{align} &\textbf{Time update}\\ &\hat{x}^-_k=A_d\hat{x}^+_{k-1}+B_du_{k-1}\\ &P^-_k=A_dP_{k-1}^+A_d^\top+Q_{k-1}\\ &\textbf{Measurement Update}\\ &K_k=P_k^-C^\top\left(CP_k^-C^\top+R_k\right)^{-1}\\ &\hat{x}^+_k=\hat{x}^-_k+K_k(y_k-Cx^-_k)\\ &P_k^+=(I-K_kC)P^-_k \end{align} $$ where $A_d=(I+\Delta tA),\quad B_d=\Delta tB$ using a forward Euler. Now, according to "Optimal State Estimation: Kalman, H-Infinity, and Nonlinear Approaches" by D. Simon p.231 ff it is mentioned that $$Q_c=\frac{Q_{k-1}}{\Delta t},\qquad R_c={R_{k}}\Delta t$$ and one can substitute these expressions in the discrete KF equations (and look at the limit $\Delta t\rightarrow 0$) to derive the continuous-time Kalman-Bucy Filter $$ \begin{align} \dot{\hat{x}}&=A\hat{x}+Bu+K(y-C\hat{x})\\ \dot{P}&=-PC^\top R_c^{-1}CP+AP+PA^\top+Q_c \end{align} $$ where $K=PC^\top R_c^{-1}$.

QUESTION

It is not clear to me why the covariances scale with the discretization time? For example if I were to look at the sensor measuring the position and it would tell me in its data sheet it has standard deviation, say, $\sigma_v=0.2\,m$, and I were to implement the discrete KF with a sampling time of $\Delta t=0.01\,s$, i.e. $100\,Hz$, then $$R_k=\frac{\sigma_v^2}{\Delta t}=\frac{0.04\,m^2}{0.01\,s}=4\frac{m^2}{s}$$ so the "uncertainty" in my measurements would blow up, even though I receive more measurements (which should be a good thing?)! On the other hand, let's say we're not confident with the model so we expect the velocity and acceleration varies with standard deviation $\sigma_{w,\,1}=0.1\,\frac{m}{s}$ and $\sigma_{w,\,2}=1\,\frac{m}{s^2}$. For the discrete KF, $$ \begin{align} Q_{k-1}&=\Delta t\ \text{diag}(\sigma_{w,\,1}^2,\,\sigma_{w,\,2}^2)\\ &=0.01\,s \begin{bmatrix} 0.1\,\frac{m^2}{s^2}& 0\\ 0& 1\,\frac{m^2}{s^4} \end{bmatrix}= \begin{bmatrix} 0.001\,\frac{m^2}{s}& 0\\ 0& 0.01\,\frac{m^2}{s^3} \end{bmatrix}\end{align}$$ meaning that our model gets "better" with smaller step size. This makes somewhat sense, since the discretization gets more accurate, right? Is my reasoning correct? Or did I miss something. Is there a way to interpret the discrete covariances? I never actually see coded Kalman Filters take this into account. Why is that?

EDIT1: Additional question, if I want to add noise to my measurements in Matlab, do I use $R_c$ or $R_{k}$, i.e.,

yk = C*xk+sqrt(Rc)*randn(1,1)

or

yk = C*xk+sqrt(Rk)*randn(1,1)

EDIT2: Changes example system to make more sense

$\endgroup$

Your Answer

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

Browse other questions tagged or ask your own question.