The Extended Kalman Filter: An Interactive Tutorial for NonExperts
Part 15: Nonlinearity
By now it should be obvious that linear algebra is pretty awesome, letting us express a sophisticated algorithm like the Kalman Filter in a very compact form. Linear algebra is however not the whole story. As its name suggests, linear algebra is limited to representing relationships that are linear, i.e., characterized by a straight line. To see this, consider again our simple example of matrix * vector multiplication:
\[
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
=
\begin{bmatrix}
ax + by \\
cx + dy
\end{bmatrix}
\]
The demo below allows you to adjust the values of the constants $a$, $b$, $c$, and $d$ to see how the resulting vector changes, for an arbitrary line segment containing points $(x,y$). As you can see, all settings result in another straight line segment:

$(x,y)$ $(ax + by, cx + dy)$
On the other hand, go outside and take a walk, and you’ll appreciate that very little in nature is linear. The things you’ll see with straight lines – buildings, roads, telephone poles, and the like – are mostly manmade, and most of everything else (trees, birds, clouds) is curved or fractal. And because sensors and motors and other artifacts are made from physical materials, their behavior likewise tends toward nonlinearity, outside some limited range.
Pretty much all the functions you learned about in highschool math, like $f(x) = ax^2 + bx+c$, $f(x) = sin(x)$, $log(x)$, etc., are nonlinear, so there’s a wide variety to choose from. The demo below allows you to pass the line segment from the previous demo through a few different nonlinear functions that I chose for their interesting appearance:


$(x,y)$ $f(x, y)$
Previous: Sensor Fusion Example
Next: Dealing with Nonlinearity