I don't understand where the matrices A and A transpose come from in the equation in this series. I have done a one-dimensional example in the series but I don't see how to derive these matrices in matrix form.

Equation image


The $A$ matrix (sometimes $F$) comes from your equations of motion. There's a technical example on Wikipedia that goes over modeling position and speed of a truck.

You can model speed and position with the following equations:

$$ x = x_0 + \Delta t \dot{x} + \frac{1}{2}\Delta t^2 \ddot{x} \\ \dot{x} = \dot{x}_0 + \Delta t \ddot{x} \\ $$

Assuming your input $u$ is the acceleration ($u = \ddot{x}$), and being more explicit with the coefficients on everything, you could rewrite the above as:

$$ x = \left(1\right)x_0 + \left(\Delta t\right) \dot{x} + \left(\frac{1}{2}\Delta t^2\right) u \\ \dot{x} = \left(0\right)x_0 + \left(1\right)\dot{x}_0 + \left(\Delta t\right)u \\ $$

And then you convert to matrix form:

$$ \left[\begin{matrix} x \\ \dot{x}\end{matrix}\right] = \left[\begin{matrix} 1 & \Delta t \\ 0 & 1 \end{matrix}\right] \left[\begin{matrix} x_0 \\ \dot{x}_0 \end{matrix}\right] + \left[\begin{matrix} \frac{1}{2}\Delta t^2 \\ \Delta t\end{matrix}\right]u $$

The current sample being: $$ x_k = \left[\begin{matrix} x \\ \dot{x}\end{matrix}\right] $$ and the previous sample being: $$ x_{k-1} = \left[\begin{matrix} x_0 \\ \dot{x}_0 \end{matrix}\right] $$

You can then define your "state matrix" $A$ or $F$ as:

$$ A = \left[\begin{matrix} 1 & \Delta t \\ 0 & 1 \end{matrix}\right] $$ and your input matrix $B$ or $G$ as:

$$ B = \left[\begin{matrix} \frac{1}{2}\Delta t^2 \\ \Delta t\end{matrix}\right] $$

And so you have:

$$ x_k = Ax_{k-1} + Bu $$

And then those are used with the output equations:

$$ y_k = Cx_k + Du $$

to form the Kalman filter. These are all standard matrices from the state space representation of a system.

  • 2
    $\begingroup$ To expand on this. The value we are estimating is assumed to be a gaussian distribution with $x - \mathcal{N}(x,P)$. Chuck shows how $A$ works on the mean($x$). In your equation you are estimating the covariance. The transpose is used to keep the matrix symmetric, and because the covariance is the variance^2. You essentially need to square the $A$ matrix. Which is accomplished by multiplying by the transpose. A proof of this can be found here(math.stackexchange.com/questions/332441/…) $\endgroup$ – edwinem Jun 5 '20 at 15:31
  • 1
    $\begingroup$ Thanks, @edwinem ! Op's question was about "where the matrices A and A transpose come from" in the equations, so I tried to answer just that aspect as directly as possible, but this is great context and excellent further reading :) $\endgroup$ – Chuck Jun 5 '20 at 15:34
  • $\begingroup$ I needed the math part too. $\endgroup$ – heretoinfinity Jun 5 '20 at 17:39
  • $\begingroup$ @heretoinfinity - What do you mean? You need the math part for what? What is missing from the answer I provided, or what can I explain better? $\endgroup$ – Chuck Jun 5 '20 at 19:32
  • 2
    $\begingroup$ The linear algebra and how I ended up with the transpose. I see it in the link with the comment so that's solved. $\endgroup$ – heretoinfinity Jun 5 '20 at 20:08

Your Answer

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

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