tl;dr

<aside> 🤷🏻 The Kalman Filter is the least squares (LS) solution* to a system of equations where the LS solution (i) is updated recursively and (ii) handles time-varying parameters.

</aside>

*Footnote: Technically it's a regularised least squares solution.

The goal of this tutorial is to give a high level explanation of why the Kalman filter is basically a solver for a set of linear equations — something you would be familiar with from high school.

🎒 High School Algebra

Suppose you have 2 variables you want to estimate $x_1, x_2$ and a set of equations:

$$ \begin{align} 10 = {} & 2x_1 + 3x_2 \\ 5 = {} & 3x_1 + 6x_2 \end{align} $$

The solution is $x_1 = 15, x_2 = -6.67$. In general, for a system with $m$ unknowns requires $m$ equations.

... with noise 😖

Now, suppose you have the same system of equations in (1) and (2), but with some noise

$$ \begin{align} 10 + 0.5 = {} & 2x_{1} + 3x_{2} \\ 20 - 0.2 = {} & 3x_{1} + 4x_{2}
\end{align} $$

Introducing the noise terms 0.5 and -0.2, will mean that your estimates will be noisy too.

In fact, you can still solve this system of equations and get $x_1 = 17.4, x_2 = -8.1$. This is clearly different to the ideal answer of $x_1 = 15, x_2 = -6.67$. And that's the effect of the noise.

📈 Ordinary Least Squares

This is where the least squares (LS) solution comes to play. Equations (3) and (4) can be represented symbolically as,

$$ \begin{align} y_1 = {} \bm{H}_1\bm{x} + n_1 \\ y_2 = {} \bm{H}_2\bm{x} + n_2 \\ \end{align} $$