Kalman filter: updating the state-transition model I am currently reading lots of material on the Kalman filter (in order to do some experiments), and there is something that I don't get, and I can't get a clear understanding.
I'll stick to the Wikipedia page notation, $\mathbf{F}_k$ is the state transition model and defines how the state goes from step $k$ to step $k+1$.
As I read it, there is a subscript, which means to me that it can change over time (and that makes sense).
However, the "update" step does not describe how I get the new estimation of $\mathbf{F}$.
Example: Consider a robot moving (more or less) randomly in a 2D space.
At first, say I have a 45° line motion.
If speed is constant, my state is described by
$\left[ x \: y \: vx \: vy \right]$, and I'll have
$$
\begin{bmatrix}
x_{k+1} \\ y_{k+1} \\ vx_{k+1} \\ vy_{k+1}
\end{bmatrix}
=
\begin{bmatrix}
1 & 0 & \Delta t & 0 \\
0 & 1 & 0 & \Delta t \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
x_k \\ y_k \\ vx_k \\ vy_k
\end{bmatrix}
$$
But when the robot changes directions, then that state matrix is not valid anymore!
How do I get the updated $\mathbf{F}$ matrix?
What is the point I missed?
Edit to clarify: I have some sample working code that is able to provide a good tracking, and it keeps the same state-mode matrix all the way.
But I just don't understand how that can work.
Edit2: forgot to mention, but the estimation of the covariance matrix $\mathbf{P}$ at a given step also relies on $\mathbf{F}$:
$$
\mathbf{P} = \mathbf{F} \: \mathbf{P} \: \mathbf{F}^{-1} + \mathbf{Q}
$$
How can that possibly work if the motion (expressed by the state-mode matrix $\mathbf{F}$) is incorrect? I really must have something wrong here...
 A: $F_k$ can change over time, but doesn't need to. The wikipedia article is suggesting that $F_k$ can change, perhaps as part of your filter's design (i.e. you may choose how it evolves in your design). But often, $F_0 = F_1 = ... F_k$.
So you are doing nothing wrong, just you are seeing a generalized syntax.
A: Answers:

*

*"which means to me that it can change over time". Yes, the state-space coefficients can indeed depend on time. However, to be more precise, it is the time interval $\Delta t_k$ the coefficient usually depends on instead of time $t$. For example, if you have uniform $\Delta t_k$ for all $k$'s, then $F$ is independent of $k$.


*"However, the "update" step does not describe how I get the new estimation of $F$". The Kalman update step does not estimate $F$.


*"But when the robot changes directions, then that state matrix is not valid anymore! How do I get the updated $F$ matrix? What is the point I missed?". The model you are showing is a Wiener velocity model which describes any target motion in terms of position and velocity. When the robot changes its direction, the model is still a valid model, simply because you have forgotten the noise term. Denote $z = [x\,y\,v_x\,v_y]$. The complete model is $z_k = F \, z_{k-1} + q_{k-1}$, where $q_{k-1} \sim N(0, Q)$ is a Gaussian r.v. with covariance $Q$ depending only on $\Delta t_k$. This noise term $q$ accounts for the permutation/uncertainty of target's position and velocity. Without $q$, your model target will go along a straight line, and of course the direction will not change. With $q$, your model target will have a random trajectory with direction changes. You can try simulate the trajectory and see.
Think of the dynamic model as a prior on your target. The Kalman filter update step's job is to "correct" the prediction from the prior model by using the likelihood model (i.e., your measurement model) and measurement/data.


*"How do I get the updated $F$ matrix? What is the point I missed". If you really want to get more precise $F$ (and $Q$), you may parameterise $F$ ($Q$) with some parameters, say, $\theta$, and get $F(\theta)$ (and $Q(\theta)$). Then you can estiamte $\theta$ by performing maximum likelihood estimation.

