The concept of probabilistic or stochastic mathematics deals with the study and modeling of uncertainties. It seeks to combine concepts from probability theory with statistical methods to understand and make decisions under conditions of uncertainty. Stochastic processes represent probabilistic models for phenomena that evolve in space or time. For example, Markov chains model systems where the future depends only on the present state and not on the distant past; a concept known as the Markov property.
To better understand this concept I followed Sebastian Thrunβs infamous book Probabilistic Robotics. You can find the paper here: https://docs.ufpr.br/~danielsantos/ProbabilisticRobotics.pdf
The mathematics behind
Let be a variable and an event. If the domain of values that can take is discrete (such as the outcome of a coin toss - heads or tails), then it is written as:
From here on, I will use the notation . As the processes are continuous, the random variables can take on a range of values, and it is considered that all these variables have probability density functions (PDF). An example of such a function is the first-order Gaussian distribution with mean π and standard deviation π:
In case of multiple variables, this PDF looks like this:
The Kalman filter is an implementation of the Bayesian filter. This filter is Gaussian and is designed for continuous linear systems. The a priori phase of the Kalman filter is Gaussian if the following properties hold:
- The state has the following linear form:
-
Here, β and represent the state vectors of the system. β is an matrix where n is the number of states of the system, and is an matrix where m is the number of control inputs.
-
The variable β represents a random vector that accounts for the uncertainties of reality (white Gaussian noise with zero mean). This implies that the errors are uncorrelated over time. The covariance of β is denoted by .
- The measurement probability , like the state of the system, must also have a linear form with added white noise:
- β is a matrix, where k is the dimension of the measurement vector. The vector also represents white Gaussian noise with zero mean, and its covariance is denoted by β.
- The assumption must be normally distributed.
Kalman Filter Algorithm
Input:
- Previous state ( )
- Previous covariance ( )
- Current control inputs ( )
- Current measurements ( )
Output:
- Current estimated state ( )
- Current covariance ( )
Steps:
-
Prediction of the current state:
-
Prediction of the covariance matrix:
-
Calculation of the Kalman Gain:
-
State update:
-
Update of the covariance matrix:
Based on six plots, the functionality of the Kalman filter can be represented as follows:
a) The initial assumption with its characteristic bell shape.
b) The measurement is taken with added white noise.
c) The prediction phase.
d) The new assumption after applying a control input.
e) A new assumption based on the new measurement with added white noise.
f) The update phase.
