- DevOps
- JavaScript
- Programming
- TypeScript
- Website development

- Algorithms
- Mathematics

There are a lot of different articles on Kalman filter, but it is difficult to find the one which contains an explanation, where all filtering formulas come from. I think that without understanding of that this science becomes completely non understandable. In this article I will try to explain everything in a simple way.

Kalman filter is very powerful tool for filtering of different kinds of data. The main idea behind this that one should use an information about the physical process. For example, if you are filtering data from a car’s speedometer then its inertia give you a right to treat a big speed deviation as a measuring error. Kalman filter is also interesting by the fact that in some way it is the best filter. We will discuss precisely what does it mean. In the end of the article I will show how it is possible to simplify the formulas.

At first, let’s memorize some definitions and facts from probability theory.

When one says that it is given a random variable $$, it means that it may take random values. Different values come with different probabilities. For example, if someone drops a dice then the set of values is discrete $$. When you deal with a speed of moving particle then obviously you should work with a continuous set of values. Values which come out after each experiment (measurement) we would denote by $$, but sometimes we would use the same letter as we use for a random variable $$. In the case of continuous set of values a random variable is characterized by its probability density function $$. This function shows a probability that the random variable falls into a small neighbourhood $$ of the point $$. As we can see on the picture, this probability is equal to the area of the hatched rectangle below the graph $$.

Quite often in our life, random variables have the Gauss Distribution, when the probability density is $$.

We can see that the bell-shaped function $$ is centered at the point $$ and its characteristic width is around $$.

Since we are talking about the Gaussian Distribution, then it would be a sin not to mention from where does it come from. As well as the number $$ and $$ are firmly penetrated in mathematics and can be found in the most unexpected places, so Gaussian Distribution has deep roots in the theory of probability. The following remarkable statement partly explains presence of the Gauss Distribution in a lot of processes:

Let a random variable $$ has an arbitrary distribution (in fact there are some restrictions on arbitrariness, but they are not restrictive at all). Let’s perform $$ experiments and calculate a sum $$, of fallen values. Let’s make a lot of experiments. It is clear that every time we will get a different value of the sum. In other words, this sum is a random variable with its own distribution law. It turns out that for sufficiently large $$, the law of distribution of this sum tends to a Gaussian Distribution (by the way, the characteristic width of a bell is growing like $$. Read more in the Wikipedia: Central limit theorem. In real life there are a lot of values which are a sum of large number of independent and identically distributed random variables. So this values have Gauss Distribution.

By definition, a mean value of a random variable is a value which we get in a limit if we perform more and more experiments and calculate a mean of fallen values. A mean value is denoted in different ways: mathematicians denote by $$ (expectation), Physicists denote it by $$ or $$. We will denote it as mathematicians do.

For instance, a mean value of Gaussian Distribution $$ is equal to $$.

For Gaussian distribution, we clearly see that the random variable tends to fall within a certain region of its mean value $$. Let us enjoy the Gaussian distribution once again:

On the picture, one may see that a characteristic width of a region where values mostly fall is $$. How can we estimate this width for an arbitrary random variable? We can draw a graph of its probability density function and just visually evaluate the characteristic range. However it would be better to choose a precise algebraic way for this evaluation. We may find a mean length of deviation from the mean value: $$. This value is a good estimation of a characteristic deviation of $$. However we know very well, how problematic it is to use absolute values in formulas, thus this formula is rarely used in practice.

A simpler approach (simple from calculation’s point of view) is to calculate $$.

This value called variance and denoted by $$. The quadratic root of the variance is a good estimation of random variable’s characteristic deviation. It’s called the standard deviation.

For instance, one can compute that for the Gaussian distribution $$ the variance is equal to $$ thus the standard deviation is $$. This result really corresponds to our geometrical intuition. In fact a small cheating is hidden here. Actually in a definition of the Gauss distribution you see the number $$ in a denominator of expression $$. This $$ stands there in purpose, for the standard deviation $$ to be equal exactly to $$. So the formula of Gauss distribution is written in a way, which keep in mind that one would compute its standard deviation.

Random variables may depend on each other or not. Imagine that you are throwing a needle on the floor and measuring coordinates of its both ends. This two coordinates are random variables, but they depend on each other, since a distance between them should be always equal to the length of the needle. Random variables are independent from each other if falling results of the first one doesn’t depend on results of the second. For two independent variables $$ and $$ the mean of their product is equal to the product of their mean: $$

For instance to have blue eyes and finish a school with higher honors are independent random variables. Let say that there are $$ of people with blue eyes and $$ of people with higher honors. So there are $$ of people with blue eyes and higher honors. This example helps us to understand the following. For two independent random variables $$ and $$ which are given by their density of probability $$ and $$, the density of probability $$ (the first variable falls at $$ and the second at $$) can by find by the formula

$$

- PVS-Studio corporate blog
- C++
- DevOps
- Java

- Old hardware

Go

Extend cloud computing, data and service seamlessly to edge devices.

- Создание своего jsfiddle, часть 1
- Thimble (Mozilla) переезжает на Glitch
- Дайджест свежих материалов из мира фронтенда за последнюю неделю №348 (14 — 20 января 2019)
- defi.js — реактивная библиотека, основанная на Object.defineProperty
- Учебный курс по React, часть 10: практикум по работе со свойствами компонентов и стилизации

- Январь (255)

- Декабрь (505)
- Ноябрь (515)
- Октябрь (513)
- Сентябрь (470)
- Август (539)
- Июль (476)
- Июнь (448)
- Май (486)
- Апрель (586)
- Март (443)
- Февраль (478)
- Январь (485)

- Декабрь (509)
- Ноябрь (584)
- Октябрь (571)
- Сентябрь (341)
- Август (435)
- Июль (538)
- Июнь (450)
- Май (502)
- Апрель (382)
- Март (384)
- Февраль (99)
- Январь (68)

- Декабрь (119)
- Ноябрь (149)
- Октябрь (353)
- Сентябрь (361)
- Август (419)
- Июль (425)
- Июнь (460)
- Май (552)
- Апрель (612)
- Март (502)
- Февраль (192)
- Январь (88)

- Декабрь (82)
- Ноябрь (53)
- Октябрь (37)
- Сентябрь (208)
- Август (330)
- Июль (78)
- Июнь (175)
- Май (365)
- Апрель (448)
- Март (579)
- Февраль (508)
- Январь (915)

- Декабрь (1254)
- Ноябрь (1255)
- Октябрь (1037)
- Сентябрь (844)
- Август (963)
- Июль (820)
- Июнь (920)
- Май (930)
- Апрель (921)
- Март (677)

- developerslife (1288)
- django (72)
- geektimes (2189)
- github (5700)
- habrahabr (4930)
- javascript (847)
- kinopoisk (805)
- megamozg (138)
- pikabu (7701)
- python (884)
- xaker (5830)
- xkcd (78)

- robot (28693)