How to obtain kalman filter?

123 Views Asked by At

I have a sensoric data from a flying drone. These data are vectors $z_1$, $z_2$, ..., $z_T$, where $z_t$ is sensoric measurement at time $t$ and $T$ is maximal time.

I would like to learn the model of this dynamic system. My question is how to do it?

Here are my ideas: I make a lot of simplifing assumtions and describe the model with some parameters and then I would like to learn these parameters. For simplicity I assume that the drone behaves randomly and that there is no external influence like control-input.

I assume that sensoric data(observations) are linearly projected internal states which can evolve over time plus random noise.

$z_t = H x_t + r_t$.

$H$ is a matrix describing observation model. $x_t$ is internal state at time $t$ which is not directly observable. $r_t$ is random noise from multivariate normal distribution with zero mean and covariance matrix $R$.

$r_t \sim N(0,R)$

I assume that the internal state $x_t$ depends linearly on previous internal state and is added with zero mean normally distributed random noise with covariance matrix $Q$.

$x_t = F x_{t-1} + q_t$

$r_t \sim N(0,Q)$

Under these assumtions I can use Kalman filter and it would be optimal. If prior probability distribution over $x_0$ is normal then posterior distribution of $x_t$ for each $t$ would be also normal and the mean of the estimate of $x_t$ and its covariance marix can be computed recursively using matrix operations.

When one have the matrices $F$, $H$, $Q$, $R$ one can not only use the model but also compute its likelihood or better log-likelihood.

However what I am supposed to do when I don't know these matrices? Should I try to find such matrices which maximize log likelihood? How do I do it?