## 2 The Interacting Multiple Model Unscented Kalman Filter
### Model Individual Filtering  
- _Step 1 in UKF loop_. The unscented transform creates \(2n+1\) sigma vectors \(\mathbf{X}\) (a capital letter) and weighted points \(W\). For state estimation at instant \(k-1\), sigma points are generated according to:  
\[\begin{cases}\mathbf{X}_{0,k-1}^{j}=\hat{\mathbf{x}}_{k-1}^{0j}\\ \mathbf{X}_{i,k-1}^{j}=\hat{\mathbf{x}}_{k-1}^{0j}+(\sqrt{(n+\lambda)\mathbf{ P}_{k-1}^{0j}})_{i}^{T}\\ \mathbf{X}_{i+n,k-1}^{j}=\hat{\mathbf{x}}_{k-1}^{0j}-(\sqrt{(n+\lambda) \mathbf{P}_{k-1}^{0j}})_{i}^{T}\end{cases},\;i=1,...,n \tag{11}\]  
where \((\sqrt{(n+\lambda)\mathbf{P}_{k-1}^{0j}})_{i}\) is the \(i\)th row (or column) of the matrix square root. \(\sqrt{(n+\lambda)\mathbf{P}_{k-1}^{0j}}\) can be obtained from the lower-triangular matrix of the Cholesky factorization; \(\lambda=\alpha^{2}(n+k)-n\) is a scaling parameter used to control the covariance matrix; \(\alpha\) determines the spread of the sigma points and is usually set to a small positive (e.g., \(1e-4\leq\alpha\leq 1\)); \(k\) is a secondly scaling parameter (usually set as 0); \(\beta\) is used to incorporate prior knowledge of the distribution of \(\mathbf{\bar{x}}\) (when \(\mathbf{x}\) is normally distributed, \(\beta=2\) is an optimal value); \(W_{i}^{(m)}\) is the weight for the mean associated with the \(i\)th point; and \(W_{i}^{(c)}\) is the weight for the covariance associated with the \(i\)th point:  
\[W_{0}^{(m)}=\frac{\lambda}{(n+\lambda)} \tag{12a}\] \[W_{0}^{(c)}=W_{0}^{(m)}+(1-\alpha^{2}+\beta)\] (12b) \[W_{i}^{(m)}=W_{i}^{(c)}=\frac{1}{2(n+\lambda)},\;i=1,...,2n \tag{12c}\]- _Step 2 in UKF loop._ Time update (prediction steps):  
\[\zeta^{j}_{i,k;k-1}=f_{j}(\mathbf{X}^{j}_{i,k;k-1})\,,\,\,i=0,...,2n \tag{13}\]  
\[\hat{\mathbf{x}}^{j}_{ik-1}=\sum\limits_{i=0}^{2n}W^{(m)}_{i}\mathbf{\varsigma}^ {j}_{i,k;k-1} \tag{14}\]  
\[\mathbf{P}^{j}_{k;k-1}=\sum\limits_{i=0}^{2n}W^{(c)}_{i}[\zeta^{j}_{i,k;k-1}- \hat{\mathbf{x}}^{j}_{i,k;k-1}|\zeta^{j}_{i,k;k-1}-\hat{\mathbf{x}}^{j}_{i,k;k-1 }|^{T}+\mathbf{Q}^{j}_{i-1} \tag{15}\]  
\[\mathbf{Z}^{j}_{i,k;k-1}=h(\zeta^{j}_{i,k;k-1}) \tag{16}\]  
\[\hat{\mathbf{z}}^{j}_{ik-1}=\sum\limits_{i=0}^{2n}W^{(m)}_{i}\mathbf{Z}^{j}_{ i,k;k-1} \tag{17}\]  
- _Step 3 in UKF loop._ Measurement update (correction steps):  
\[\mathbf{P}^{j}_{zz}=\sum\limits_{i=0}^{2n}W^{(c)}_{i}[\mathbf{Z}^{j}_{i,k;k-1 }-\hat{\mathbf{z}}^{j}_{ik-1}|\mathbf{Z}^{j}_{i,k;k-1}-\hat{\mathbf{z}}^{j}_{ ik-1}]^{T}+\mathbf{R}^{j}_{k} \tag{18}\]  
\[\mathbf{P}^{j}_{xz}=\sum\limits_{i=0}^{2n}W^{(c)}_{i}[\zeta^{j}_{i,k;k-1}- \hat{\mathbf{x}}^{j}_{ik-1}][\mathbf{Z}^{j}_{i,k;k-1}-\hat{\mathbf{z}}^{j}_{ ik-1}]^{T} \tag{19}\]  
\[\mathbf{K}^{j}_{k}=\mathbf{P}^{j}_{xz}\,(\mathbf{P}^{j}_{zz})^{-1} \tag{20}\]  
\[\hat{\mathbf{x}}^{j}_{ik}=\hat{\mathbf{x}}^{j}_{ik-1}+\mathbf{K}^{j}_{k} \mathbf{v}^{j}_{k}\]  
, where \(\mathbf{v}^{j}_{k}=\mathbf{z}_{k}-\hat{\mathbf{z}}^{j}_{ik-1}\)  
\[\mathbf{P}^{j}_{ik;k}=\mathbf{P}^{j}_{ik-1}-\mathbf{K}^{j}_{k}\mathbf{P}^{j}_ {zz}\mathbf{K}^{j}_{k} \tag{22}\]  
The samples are propagated through true nonlinear equations; the linearization is unnecessary (Calculation of the Jacobian matrix is not required).