Beginning Kalman filter (KF), extended Kalman filter (EKF) and unscented difference between the three Kalman filter (UKF)?

Original Kalman filter (KF), extended Kalman filter (EKF) and unscented difference between the three Kalman filter (UKF)?

Original: https://www.zhihu.com/question/22714163/answer/87629897

 

KF for the linear Gaussian case, the EKF for nonlinear Gauss, which is part of the nonlinear first-order Taylor expansion, thus ignoring the higher order terms, the error is larger, UT UKF is converted to KF product of the combination, it the basic idea is to close a non-linear function of the probability distribution of the non-close itself easier. The latter two are different ideas Kalman solutions to the same problem, in fact, the ability to UKF has jumped out of the range of non-linear Gaussian, it can also solve the problem of non-Gaussian, but PF can do better in this regard, operation the amount is greater.

 

1.KF is a linear filter, much explanation. 2. When it comes to non-linear Kalman filter is derived from the theoretical framework uniform Bayesian filtering theory: linear Kalman filter state estimation can be equivalent to computing the integral multi-dimensional vector. Points may be represented in the form of a probability density function is a nonlinear function of x gauss. However, the integration of the closed form solution is difficult to solve, so you have a Gaussian weighted integral multidimensional nonlinear function is approximated. Approximately two main categories: non-linear function approximation and Gaussian probability density function is approximated.

Approximate non-linear function of the Taylor series expansion ekf, based on the differential polynomial and the Kalman DDF (such as Chebyshev polynomial).

Approximate the probability density function of the presence or absence of the main track transform (UKF), Kalman volume, central difference Kalman, or decomposition of the covariance matrix constituted based on square root Kalman filter or the like. Therefore, the Kalman filter is the posterior density make assumptions suboptimal estimate. The particle filter, Gaussian mixture filter, an adaptive filter grid point group and the like are not optimal estimate the posterior probability density make any assumptions. However, computational big. Image based on the position estimate ukf + srcdkf state, during the time when the update, it is necessary to update the plurality of data 1700. If the filter calculation using the amount of particles is bigger ......


Figure that the Kalman filter, an easy to understand tutorial

Original: https://zhuanlan.zhihu.com/p/39912633

Author: Bzarg

Compile: Bot

Editor's note: Kalman filtering (Kalman filter) is an efficient auto-regressive filter which can exist in the state of the dynamic system is a combination of information in the case of a lot of uncertainty estimation, is a powerful, highly versatile tool. Its author, Rudolf .E. Kalman, during a visit to NASA Ames Research Center, found that this method can help solve the problem of forecasting the track of the Apollo program, NASA did later in the Apollo spacecraft navigation system also used this filter. In the end, the spacecraft towards the moon correct, completed the first landing on the moon in human history.

This article is written by foreign bloggers Bzarg in 2015 an illustration. Although the article a few years ago, but dynamic positioning, automatic navigation, time series models, satellite navigation - the scope of application of Kalman filtering is still very wide. So, as a software engineer and machine learning engineer, you really understand Kalman filter it?

What is the Kalman filter?

For this filter, we can almost under such a conclusion: As long as there is a dynamic system is uncertain information, the Kalman filter can be made to the system what to do next guesses. Even if there is interference noise information, the Kalman filter is usually also good to find out what happened, to find out the correlation between phenomena imperceptible.

So Kalman filter is well suited to changing the system, its advantages as well as a smaller memory footprint (just to retain the previous state), fast speed, is ideal for real-time and embedded systems problems.

If you've ever had Google tutorial Kalman Filter (now there is a little bit better), you will find related algorithms tutorial is very scary, but did not specifically say what clearly yes. In fact, the Kalman filter is very simple, if we look at it the right way, understanding is very natural thing.

This article will use a lot of clear, beautiful images and colors to explain this concept, the reader just have a general knowledge of basic probability theory and matrix.

What do we do with Kalman filter?

Let's take an example: you can make a walk around in the woods a small robot , in order to make it happen navigation, robots need to know your location is located.

That is, the robot has a state position information and speed information included  [official] :

Note that, in this example, the position and velocity state, into other problems where it may be water in the liquid volume, automotive engine temperature, position of the fingertip on the touchpad, or any other data.

Our little robot equipped with GPS sensors , positioning accuracy of 10 meters. Although in general this point accuracy is good enough, but we hope it's a small point positioning error again, after all, the woods are full of pits and steep slopes, if the robot so little biased few meters, it is likely rolling hillside. Therefore, the information provided by GPS is still not sufficient.

We can also predict the robot how to move: it will send a command to the control wheel motor, if at this moment it is always move in one direction, without encountering any obstacles, then the next moment it may continue to adhere to this line. But the robot of their own state is not omniscient: it could sail against the wind, the wheels skid, rolled down bumpy terrain ...... so the number of rotations of the wheel and do not represent the actual distance traveled, based on predicted this distance is not perfect.

Under this problem, GPS provides us with some information about the state, but that is indirect, inaccurate; our forecast provides information about the robot trajectory, but also indirect, inaccurate.

But That's all the information we can get in their basis, whether we can give a complete forecast, it's a single prediction accuracy than the robot to collect summary higher? With the Kalman filter, this problem can be solved.

Kalman filter problem robot eyes

Or the above problem, we have a state, and its speed, location of:

We do not know how much their actual value, but may hold some combination of speed and position, the higher the possibility of some combination of:

Kalman filter is assumed that two variables (in our example is the position and speed) should be random , and consistent with the Gaussian distribution . Each variable has a mean value [official]  , which is the center of randomly distributed; there is a variance  [official] , a measure of uncertainty combinations.

在上图中,位置和速度是不相关的,这意味着我们不能从一个变量推测另一个变量。

那么如果位置和速度相关呢?如下图所示,机器人前往特定位置的可能性取决于它拥有的速度。

这不难理解,如果基于旧位置估计新位置,我们会产生这两个结论:如果速度很快,机器人可能移动得更远,所以得到的位置会更远;如果速度很慢,机器人就走不了那么远。

这种关系对目标跟踪来说非常重要,因为它提供了更多信息:一个可以衡量可能性的标准。这就是卡尔曼滤波的目标:从不确定信息中挤出尽可能多的信息!

为了捕获这种相关性,我们用的是协方差矩阵。简而言之,矩阵的每个值是第 [official] 个变量和第 [official] 个变量之间的相关程度(由于矩阵是对称的, [official] 和 [official] 的位置可以随便交换)。我们用 [official] 表示协方差矩阵,在这个例子中,就是 [official] 。

用矩阵描述问题

为了把以上关于状态的信息建模为高斯分布(图中色块),我们还需要 [official] 时的两个信息:最佳估计 [official] (均值,也就是 [official] ),协方差矩阵 [official] 。(虽然还是用了位置和速度两个变量,但只要和问题相关,卡尔曼滤波可以包含任意数量的变量)

接下来,我们要通过查看当前状态(k-1时)来预测下一个状态(k时)。这里我们查看的状态不是真值,但预测函数无视真假,可以给出新分布:

我们可以用矩阵 [official] 表示这个预测步骤:

它从原始预测中取每一点,并将其移动到新的预测位置。如果原始预测是正确的,系统就会移动到新位置。

这是怎么做到的?为什么我们可以用矩阵来预测机器人下一刻的位置和速度?下面是个简单公式:

换成矩阵形式:

这是一个预测矩阵,它能给出机器人的下一个状态,但目前我们还不知道协方差矩阵的更新方法。这也是我们要引出下面这个等式的原因:如果我们将分布中的每个点乘以矩阵A,那么它的协方差矩阵会发生什么变化

把这个式子和上面的最佳估计 [official] 结合,可得:

外部影响

但是,除了速度和位置,外因也会对系统造成影响。比如模拟火车运动,除了列车自驾系统,列车操作员可能会手动调速。在我们的机器人示例中,导航软件也可以发出停止指令。对于这些信息,我们把它作为一个向量 [official] ,纳入预测系统作为修正。

假设油门设置和控制命令是已知的,我们知道火车的预期加速度 [official] 。根据运动学基本定理,我们可得:

把它转成矩阵形式:

[official] 是控制矩阵, [official] 是控制向量。如果外部环境异常简单,我们可以忽略这部分内容,但是如果添加了外部影响后,模型的准确率还是上不去,这又是为什么呢?

外部不确定性

当一个国家只按照自己的步子发展时,它会自生自灭。当一个国家开始依赖外部力量发展时,只要这些外部力量是已知的,我们也能预测它的存亡。

但是,如果存在我们不知道的力量呢?当我们监控无人机时,它可能会受到风的影响;当我们跟踪轮式机器人时,它的轮胎可能会打滑,或者粗糙地面会降低它的移速。这些因素是难以掌握的,如果出现其中的任意一种情况,预测结果就难以保障。

这要求我们在每个预测步骤后再加上一些新的不确定性,来模拟和“世界”相关的所有不确定性:

如上图所示,加上外部不确定性后, [official] 的每个预测状态都可能会移动到另一点,也就是蓝色的高斯分布会移动到紫色高斯分布的位置,并且具有协方差 [official] 。换句话说,我们把这些不确定影响视为协方差 [official] 的噪声。

这个紫色的高斯分布拥有和原分布相同的均值,但协方差不同。

我们在原式上加入 [official] :

简而言之,这里:

[official] 是基于 [official] 和 [official] 校正后得到的预测。

[official] 是基于 [official] 和 [official] 得到的预测。

现在,有了这些概念介绍,我们可以把传感器数据输入其中。

通过测量来细化估计值

我们可能有好几个传感器,它们一起提供有关系统状态的信息。传感器的作用不是我们关心的重点,它可以读取位置,可以读取速度,重点是,它能告诉我们关于状态的间接信息——它是状态下产生的一组读数。

请注意,读数的规模和状态的规模不一定相同,所以我们把传感器读数矩阵设为 [official] 。

把这些分布转换为一般形式:

卡尔曼滤波的一大优点是擅长处理传感器噪声。换句话说,由于种种因素,传感器记录的信息其实是不准的,一个状态事实上可以产生多种读数。

我们将这种不确定性(即传感器噪声)的协方差设为 [official] ,读数的分布均值设为 [official] 。

现在我们得到了两块高斯分布,一块围绕预测的均值,另一块围绕传感器读数。

如果要生成靠谱预测,模型必须调和这两个信息。也就是说,对于任何可能的读数 [official] ,这两种方法预测的状态都有可能是准的,也都有可能是不准的。重点是我们怎么找到这两个准确率。

最简单的方法是两者相乘:

两块高斯分布相乘后,我们可以得到它们的重叠部分,这也是会出现最佳估计的区域。换个角度看,它看起来也符合高斯分布:

事实证明,当你把两个高斯分布和它们各自的均值和协方差矩阵相乘时,你会得到一个拥有独立均值和协方差矩阵的新高斯分布。最后剩下的问题就不难解决了:我们必须有一个公式来从旧的参数中获取这些新参数!

结合高斯

Let's look from the one-dimensional, set variance  [official] , mean  [official] , a standard one-dimensional Gaussian bell-shaped curve equation is as follows:

So it is multiplied by two Gaussian curves?

This equation according to extend one dimensional equation, obtain:

If some are too complicated, we simplify it by k:

 

These are the contents of a one-dimensional, if it is multi-dimensional space, to turn this formula in a matrix format:

This matrix  [official] is what we call the Kalman gain , easy!

Put them together

Up to now, we have a useful matrix  [official] distribution prediction of sensor readings useful for  [official] the distribution of prediction. Substituting them into the equation on the matrix in the section:

Accordingly, the Kalman gain is:

Considering  [official] there also contains a  [official] , we look to further simplify the equation:

Finally,  [official] our best estimate we can make it continue to do another round into the forecast:

Hopefully this article useful to you!

Released seven original articles · won praise 13 · views 20000 +

Guess you like

Origin blog.csdn.net/xingsongyu/article/details/103728236