probml / dynamax

State Space Models library in JAX
https://probml.github.io/dynamax/
MIT License
634 stars 70 forks source link

Order of state vector in Kalman Filter example docs/notebook incorrect #357

Closed billtubbs closed 4 months ago

billtubbs commented 4 months ago

Hi, great library, thanks.

I think there might be an error in the documentation on the following page:

It describes the state vector as follows:

\begin{align*}
\underbrace{\begin{pmatrix} u_t\\ \dot{u}_t \\ v_t \\ \dot{v}_t \end{pmatrix}}_{z_t}
  = 
\underbrace{
\begin{pmatrix}
1 & 0 & \Delta & 0 \\
0 & 1 & 0 & \Delta\\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{pmatrix}
}_{F}
\underbrace{\begin{pmatrix} u_{t-1} \\ \dot{u}_{t-1} \\ v_{t-1} \\ \dot{v}_{t-1} \end{pmatrix}}_{z_{t-1}}
+ q_t
\end{align*}

(This equation is also in the example notebook).

Based on this state transition matrix, I think the order of the states should be:

\begin{pmatrix} u_t\\ v_t \\ \dot{u}_t \\ \dot{v}_t \end{pmatrix}
gileshd commented 4 months ago

Thanks for identifying this @billtubbs! It's now been closed in #354.