Working of Kalman Filters

A Kalman filter gives us a mathematical way to infer velocity from only a set of measured locations. So, here I’m going to create a 1D Kalman filter that takes in positions, takes into account uncertainty, and estimates where future locations might be and the velocity of an object. Further, if we want to understand how Kalman filter works, we first need to know a bit about Gaussians which represents the Uni-modal distribution in the Kalman filters.

Gaussian:

Graph representing Gaussian

Gaussian is a continuous function over the space of location and the area underneath sums up to 1.

The Gaussian is characterized by two parameters, the mean, often abbreviated with the Greek letter Mu(μ), and the width of the Gaussian often called the variance i.e. Sigma square ( σ²). So, our job in common phases is to maintain a Mu(μ) and a Sigma square( σ²) as our best estimate of the location of the object we are trying to find. Also, remember that the larger the width, the more uncertainty it possesses.

The equation for 1D Gaussian

The diagram in the above image represents the mean(μ) and variance(σ²) of the gaussian. The taller the mean(μ), the chances of the object present at that position are higher. conversely, if the variance(σ²) is larger, i.e. wider the distribution, higher the uncertainty of that object; that might be positioned at any place within the gaussian. And as far as the formula is concerned, it is an exponential of a quadratic function where we take the exponent of the expression. The quadratic difference of our query point x, relative to the mean(μ), divided by sigma square(σ²), multiplied by -(1/2). Now if x = μ, then the numerator becomes 0, and if x of 0, which is 1. It turns out we have to normalize this by a constant, 1 over the square root of 2 Pi(π) sigma square(σ²).

Gaussian Characteristics:

Gaussians are exponential function characterized by a given mean(μ), which defines the location of the peak of a Gaussian curve, and a variance(σ²) which defines the width/spread of the curve. All Gaussian are:

symmetrical

they have one peak, which is also referred to as a “unimodal” distribution, and they have an exponential drop off on either side of that peak.

More on Variance:

The variance is a measure of Gaussian spread; larger variances correspond to shorter Gaussians. Variance is also a measure of certainty; if you are trying to find something like the location of a car with the most certainty, you’ll want a Gaussian whose mean is the location of the car and with the smallest uncertainty/spread.