# Mid-State Kalman Filter for Nonlinear Problems
## 2 Traditional Nonlinear Filter  
In practical engineering applications, discrete nonlinear systems are generally characterized using additive noise and the system model is expressed as  
\[\left\{\begin{array}{l}x_{k}=f(x_{k-1})+w_{k-1}\\ z_{k}=h(x_{k})+v_{k}\end{array}\right. \tag{1}\]  
where process noise \(w_{k}\) and observation noise \(v_{k}\) are independent white zero-mean Gaussian noise.  
The EKF obtains linear approximation of nonlinear system by using Taylor series expansion and then uses a KF to deal with the filtering problem of nonlinear system. The EKF approximates the nonlinear functions \(f(x_{k-1})\) and \(h(x_{k})\) in the state space to the first-order Taylor polynomials near \(\hat{x}_{k}\) and \(\hat{x}_{k|k-1}\), respectively:  
\[f(x_{k})\approx f(\hat{x}_{k-1})+\mathbf{F}_{k-1}[x_{k-1}-\hat{x}_{k-1}] \tag{2}\]  
\[h(x_{k})\approx h(\hat{x}_{k|k-1})+\mathbf{H}_{k}[x_{k}-\hat{x}_{k|k-1}] \tag{3}\]  
where \(\mathbf{F}_{k-1}\) and \(\mathbf{H}_{k}\) are the Jacobi matrices as follows:  
\[\mathbf{F}_{k-1} = \left.\frac{\partial f(x_{k-1})}{\partial x}\right|_{x=\hat{x}_{k -1}} \tag{4}\] \[\mathbf{H}_{k} = \left.\frac{\partial h(x_{k})}{\partial x}\right|_{x=\hat{x}_{k|k- 1}} \tag{5}\]  
The UKF is different from the EKF in that it directly calculates the mean and covariance of the target distribution, avoiding the approximation of nonlinear functions. The UKF uses the mean and covariance of initial distribution to generate a series of determined sigma sampling points according to Formulas (6) and (7). These sigma sampling points are propagated through nonlinear functions to get the estimated mean and covariance [17].  
\[\left\{\begin{array}{l}\chi_{0}=x_{k}\\ \chi_{i}=x_{k}+e_{i}\sqrt{(n_{x}+\kappa)P_{x}}\\ \chi_{i+n}=x_{k}-e_{i}\sqrt{(n_{x}+\kappa)P_{x}}\end{array}\right.,i=1,2,\cdots, n_{x} \tag{6}\]  
The corresponding weight is  
\[\left\{\begin{array}{l}w_{0}=\frac{\kappa}{n_{x}+\kappa}\\ w_{i}=w_{i+n}=\frac{1}{2(n_{x}+\kappa)}\end{array}\right. \tag{7}\]  
where \(\kappa\) is a fine-tuned scalar parameter, \(n_{x}\) is the dimension of the state vector \(x_{k}\), and \(e_{i}\) is the \(i\)-th Cartesian fundamental vector. The size of \(\kappa\) is related to the size of the sample moments and controls the distance from the sigma point to the mean point.  
Under the Gaussian assumption, the state estimation of the nonlinear KF can ultimately be equated to the calculation of multidimensional vector integral, which can be summarized in the form of a nonlinear function \(\times\) Gaussian probability density function:  
\[I(g)=\int\limits_{R^{n}}g(x)N(x;\overline{x},\mathbf{P}_{x})dx \tag{8}\]  
where \(g(\cdot)\) is any nonlinear function. To solve the integral numerically, the CKF transforms it into spherical-radial form and then carries out numerical integration according to the spherical-radial criterion  
\[\int_{0}^{\infty}f(r)r^{n-1}\exp(-r^{2})dr=\sum\limits_{i=1}^{m}w_{i}f(r_{i}) \tag{9}\]  
where \(r\) is the radial scalar obtained by spherical-radial transformation of the vector \(x\) in a cartesian coordinate system. The CKF filtering process is similar to that of the UKF. They all transform the sampled points with weight through the equations of the nonlinear system to calculate the first and second order moments required by filtering, but they have essential differences in obtaining sampling points. In a high-dimensional system, the weights of the UKF sigma points are prone to be negative which will cause the problem of unstable estimated values. The weights of the CKF sampling points are always positive, which solves the problem of instability. However, the filtering accuracy will be affected due to the increasing distance between the sampling point and the center point.