# Applying Kalman filter to a data set

I went through the answer Kalman filter in practice and it seems we must know all the first and second order properties of random variables to apply the Kalman filter.

But when I only have a set of data $y_1,\dots,y_n$ and a given model $G$ and $F$ with assumed noise processes, could someone please explain to me how to apply Kalman filter?

Thanks.

## 1 Answer

Signal Model

The first thing you really need when you start to use a Kalman filter is what I would call the "signal model". That means, you need to take a guess (and sometimes that's all it is, though usually you can have an educated guess) at how the signal you're measuring, $y$, was generated.

The usual signal model comprises $F$, $G$, $H$, $Q$ and $R$:

$$x_{k+1} = F x_k + G u_k + w_k\\ y_k = H x_k + v_k$$

where $Q$ is the covariance of $w_k$ and $R$ is the covariance of $v_k$.

What are you trying to achieve?

Implicit in the signal model is that you've chose the "state variables" (the components of $x_k$) that you are working with. Usually, what you are trying to achieve is to measure something and, from that, infer the value of one or more of the state variables.

What's missing?

Based on what you've said, the only thing that seems to be missing is how you get from the states $x_k$ to your measurements $y$ (i.e. $H$).

• Are the $x_k$s and $y_k$s random variables? or are they specific samples of those random variables? When I read the book I feel like they develop the theory for random variables not for smaples. But in my application I only have a data set no random variables. Thanks – triomphe Oct 30 '13 at 13:41
• $y_k$ are your measurements, your data. I'm not sure I understand your confusion. Measurements are random variables. Data sets are random variables. – Peter K. Oct 30 '13 at 14:00
• My confusion is, I think a measurement is just one instance of a random variable. But random variable is the whole possible range. That is my confusion. Like $Y_k$ can take any value in it's range and $y_k$ is just the one we observed at that particular trial. They develop the theory for $Y_k$s but in practice we only have $y_k$s. I hope I made clear my confusion, many thanks for trying to help me understand it. – triomphe Oct 30 '13 at 14:18
• OK. Thanks for the clarification. The data, as you say, is just one realization of the random process, $Y_k$. However, that's all you need: the KF is developed for the random variables, but the equations apply to any particular realization of the process, $y_k$. – Peter K. Oct 30 '13 at 14:54