The extended Kalman Filter

Kalman Filter is build according to the assumptions of f linear state transitions and linear measurements with added Gaussian noise,but which are rarely fulfilled in practice.The extended Kalman filter (EKF) overcomes one of these assumptions: the linearity assumption.Here the assumption is that the next state probability and the measurement probabilities are governed by nonlinear functions gg and hh,respectively:

xt=g(ut,xt1)+εtzt=h(xt)+δt(1) \begin{aligned} x_{t} &=g\left(u_{t}, x_{t-1}\right)+\varepsilon_{t} \tag{1} \\ z_{t} &=h\left(x_{t}\right)+\delta_{t} \end{aligned}

The function gg replace the matrixs AA and BB ,and the hh replace the matrix HH.Unfortunately,the belief is no longer a Gaussian.In fact, performing the belief update exactly is usually impossible.

(写不下去了,切换中文,想想写paper多难。。。)

Linearization Via Taylor Expansion

EKF使用称为 Taylor Expansion 的方法来线性化非线性函数。泰勒展开就是在某点的值和导数构造一个线性approximation。斜率是对某点的偏导数:

g(ut,xt1):=g(ut,xt1)xt1 \begin{aligned}g^{\prime}\left(u_{t}, x_{t-1}\right):=\frac{\partial g\left(u_{t}, x_{t-1}\right)}{\partial x_{t-1}}\end{aligned}

其中 gg 的值和斜率是取决于 gg 的参数的,选取的逻辑就是在线性化的时候最有可能的值,对高斯函数,最有可能的状态就是后验的均值 μt1\mu_{t-1} 。换句话说就是 ggμt1\mu_{t-1} 处 approximate:

g(ut,xt1)g(ut,μt1)+g(ut,μt1)=:Gt(xt1μt1)=g(ut,μt1)+Gt(xt1μt1)\begin{aligned} g\left(u_{t}, x_{t-1}\right) & \approx g\left(u_{t}, \mu_{t-1}\right)+\underbrace{g^{\prime}\left(u_{t}, \mu_{t-1}\right)}_{=: G_{t}}\left(x_{t-1}-\mu_{t-1}\right) \\ &=g\left(u_{t}, \mu_{t-1}\right)+G_{t}\left(x_{t-1}-\mu_{t-1}\right) \end{aligned}

写成概率的表达式可以近似为;

p(xtut,xt1)det(2πRt)12exp{12[xtg(ut,μt1)Gt(xt1μt1)]TRt1[xtg(ut,μt1)Gt(xt1μt1)]}\begin{array}{l} p\left(x_{t} \mid u_{t}, x_{t-1}\right) \\ \begin{aligned} \approx & \operatorname{det}\left(2 \pi R_{t}\right)^{-\frac{1}{2}} \exp \left\{-\frac{1}{2}\left[x_{t}-g\left(u_{t}, \mu_{t-1}\right)-G_{t}\left(x_{t-1}-\mu_{t-1}\right)\right]^{T}\right.\\ &\left.R_{t}^{-1}\left[x_{t}-g\left(u_{t}, \mu_{t-1}\right)-G_{t}\left(x_{t-1}-\mu_{t-1}\right)\right]\right\} \end{aligned} \end{array}

对测量函数同样线性化,这里的泰勒展开取在 μˉt\bar{\mu}_{t} 这附近:

h(xt)h(μˉt)+h(μˉt)=:Ht(xtμˉt)=h(μˉt)+Ht(xtμˉt)\begin{aligned} h\left(x_{t}\right) & \approx h\left(\bar{\mu}_{t}\right)+\underbrace{h^{\prime}\left(\bar{\mu}_{t}\right)}_{=: H_{t}}\left(x_{t}-\bar{\mu}_{t}\right) \\ &=h\left(\bar{\mu}_{t}\right)+H_{t}\left(x_{t}-\bar{\mu}_{t}\right) \end{aligned}

写成概率的形式:

p(ztxt)=det(2πQt)12exp{12[zth(μˉt)Ht(xtμˉt)]TQt1[zth(μˉt)Ht(xtμˉt)]}(7)\begin{aligned} p\left(z_{t} \mid x_{t}\right)=& \operatorname{det}\left(2 \pi Q_{t}\right)^{-\frac{1}{2}} \exp \left\{-\frac{1}{2}\left[z_{t}-h\left(\bar{\mu}_{t}\right)-H_{t}\left(x_{t}-\bar{\mu}_{t}\right)\right]^{T}\right.\\ &\left.Q_{t}^{-1}\left[z_{t}-h\left(\bar{\mu}_{t}\right)-H_{t}\left(x_{t}-\bar{\mu}_{t}\right)\right]\right\} \end{aligned}\tag{7}

看到这么多字母和数字是不是很头晕?没错我也是,我一开始看也完全不知道这些字母什么意思,你就等等,再把EKF的更新公式放出来,就很清晰了。

The algorithm

The extended Kalman Filter

我们再把熟悉的KF放上来:

The extended Kalman Filter

如果对这个类型的KF还是不熟悉,那就再放一个肯定熟悉的:

The extended Kalman Filter

这下对比一下相信已经很熟悉了把,接下来就一个个对应起来理解。第一第二种形式是《Probabilistic Robotics》的,第三种形式是我在这篇intro看到的,第三种看起来更好理解,所以我们就来理一下前两种中字母的关系。

  1. μˉt\bar{\mu}_{t} equal to x^k\hat{x}_{k}^{-} ,predict state。
  2. μt\mu_{t} equal to x^k\hat{x}_{k} ,represent update the state at kk of estimation with measurement。
  3. μt1\mu_{t-1} equal to x^k1\hat{x}_{k-1} ,represent the state at k1k-1 of estimation。
  4. Σˉt\bar{\Sigma}_{t} equal to PkP_{k}^{-} , a priori estimate error covariance,说人话就是估计的误差协方差矩阵,利用先验的知识,还没有得到观测数据。
  5. Σt1\Sigma_{t-1} equal to Pk1P_{k-1} ,a posteriori estimate error covariance,说人话就是利用后验估计误差协方差矩阵,就是利用获得的观测数据更新了误差协方差矩阵。
  6. GtG_{t}AtA_t and AA ,AA present a constant transform matrix,but AtA_t present a dynamic, GtG_t is a Jacobian matrix,what is Jacobian matrix?Partial derivative of variable matrix.
  7. HtH_t and HH and CtC_t Jacobian HtH_t corresponds to CtC_t .

解释完每个变量的意思,就来看看区别:主要的区别是在Predict上:

μˉt=g(ut,μt1)Σˉt=GtΣt1GtT+Rt\begin{array}{l} \bar{\mu}_{t}=g\left(u_{t}, \mu_{t-1}\right) \\ \bar{\Sigma}_{t}=G_{t} \Sigma_{t-1} G_{t}^{T}+R_{t} \end{array}

其中更新predict state不是线性的关系,而是一个非线性的函数 gg, error covariance 更新需要算协方差矩阵了。这应该就是扩展卡尔曼和卡尔曼的区别了吧。

总结

最后总结就是扩展卡尔曼是一个在某处线性化的过程,而这个线性化的点就在mean of posterior μt1\mu_{t-1} ,因为在高斯的图形中,这个mean的点附近是概率最集中的点,这句话应该是精髓吧。然后迭代的过程和卡尔曼滤波是一样的。数学证明有能力有时间再看吧。。。

相关文章: