Background
I have been trying to understand Kalman filters and implement them in a project I have. I have been following Roger Labbe's online book (https://nbviewer.jupyter.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb – which has been amazing at walking through step by step and explain practical aspects as well) but am confused on a section of Chapter 7: Kalman Filter Math. My implementation is not too dissimilar from Labbe's examples and as my time-steps can be constant and discrete I decided to use the simpler piecewise discrete white noise model as my process variance Q
.
Problem
In Labbe's Kalman Filter Math chapter, the 2-dimensional implementation of the filter uses state transition function:
$$
F=\begin{bmatrix}1& \Delta t\\0&1\end{bmatrix}
$$
as $x$ is position and $\dot x$ is velocity:
$$
\bar x = x + \dot x \Delta t
$$
and
$$
\bar{\dot x}=\dot x
$$
to me this implies that velocity is being assumed constant across discrete time periods, but earlier wording makes this confusing in the chapter itself though:
where Γ is the noise gain of the system, and w is the constant piecewise acceleration (or velocity, or jerk, etc).
I think maybe this is just a small oversight that makes it confusing as this is clearly a two-dimensional (position and velocity) system and inconsistent with the prior section on continuous white noise.
and so for $\Gamma$, the noise gain it makes sense to me that position noise changes by integrating wrt time:
$$
\Gamma=\begin{bmatrix}1/2 \Delta t^2\\\Delta t\end{bmatrix}
$$
Where I lose track and get confused is when including second order effects (ie. a 3-dimensional system where acceleration is now included and held constant for discrete time periods – I think as again, the wording is confusing to me in this section).
The state transition matrix I agree with and is still straightforward:
$$
F=\left[\begin{array}{1}1&\Delta t&\Delta t^2/2\\
0&1&\Delta t\\
0&0&1
\end{array}\right]
$$
But I do not understand why the noise gain function does not follow the same pattern. I would have though it would simply be our now 2nd order system integrated wrt time:
$$
\Gamma =\left[\begin{array}{1}\frac 1 6\Delta t^3\\
\frac 1 2\Delta t^2\\
\Delta t
\end{array}\right]
$$
Instead in Labbe's book he has:
$$
\Gamma =\left[\begin{array}{1}
\frac 1 2\Delta t^2\\
\Delta t\\1
\end{array}\right]
$$
Why is it different? does this not imply that the variance for acceleration is not scaled by time step if we were to project this into our process covariance matrix? And what if we wanted to include even more higher order components? would additional components of vector $\Gamma$ just be 1s??
Best Answer
I was wondering the reason for this as well. It appears that Labbe has used material from Bar-Shalom's book Estimation with Applications to Tracking and Navigation: Theory Algorithms and Software.
The relevant part of that book (Chapter 6, section 6.3.3) goes as follows (emphasis in bold is mine):
Long story short, he's using acceleration instead of jerk and he doesn't explain why further than it's "more convenient".