## 2 The Interacting Multiple Model Filters
### The Framework of the Interacting Multiple Model Filter  
The IMM algorithm utilizes two or more models to describe the possible states. Let a general system for multiple models in discrete time be defined by  
\[\mathbf{x}_{k}=\mathbf{f}_{k-1}(\mathbf{x}_{k-1},M_{k-1})+\mathbf{w}_{k-1}(M_ {k-1}) \tag{3}\]  
\[\mathbf{z}_{k}=\mathbf{h}_{k}(\mathbf{x}_{k},M_{k})+\mathbf{v}_{k}(M_{k}) \tag{4}\]  
where \(\mathbf{f}_{k}(\cdot)\) and \(\mathbf{h}_{k}(\cdot)\) are the parameterized state transition and measurement functions, respectively; \(\mathbf{x}_{k}\) and \(\mathbf{z}_{k}\) are the dynamical state and measurement of the system, respectively, in the model \(M_{k}\), where the system itself is a Markov chain; \(\mathbf{w}_{k}\) and \(\mathbf{v}_{k}\) are the process noise and measurement noise, with the means \(\mathbf{w}_{k}\) and \(\mathbf{v}_{k}\) and covariances \(\mathbf{Q}_{k}\) and \(\mathbf{R}_{k}\), respectively. The effective weighted fusion estimates the system state vector and allows the real-time correction of the state variables such as location and velocity. This flexibility can solve the problem of substantial single-model estimating inaccuracy. Furthermore, the algorithm of IMM-involved nonlinear filters was introduced to address both system nonlinearity and noise uncertainty at once. The IMM approach integrates state possibilities from several filter models for time-varying models to obtain an improved state estimate. One can select the IMM filter model for each state hypothesis that best fits the behavior of the target systems. The primary strength of the IMM algorithm is its capacity to predict the state of a dynamic system with many behavior modes that can \"switch\" between them. The IMM technique uses the model probability to implement a \"soft switch\" between different models. The construction of the IMM-based estimator for the scenario involving the involved \(r\) models is shown in Figure 2. The IMM algorithm weighs the input and output of parallel filters at each instant using model probabilities. The strategy considers several models to reflect the system's model or behavior patterns. Combining the different estimates from the filters running in parallel based on the many models that match the system modes yields the overall estimate. There are four phases in each IMM cycle: (1) interaction, (2) filtering, (3) calculation of the mode probability, and (4) combination. The four key stages of the IMM-EKF algorithm are divided as shown in the following list:  
1. Model interaction/mixingFor the given states \(\mathbf{x}_{k-1}^{j}=\mathbf{x}_{k-1|k-1}^{j}\) with the corresponding covariances \(\mathbf{P}_{k-1}^{j}=\mathbf{P}_{k-1|k-1}^{j}\) and mixing probabilities \(\mathbf{\mu}_{k-1|k-1}^{ij}\) for every model, the initial condition for the model \(j\) is  
\[\mathbf{x}_{k-1|k-1}^{0j}=\sum_{i=1}^{r}\mathbf{x}_{k-1|k-1}^{i}\mathbf{\mu}_{ k-1|k-1}^{ij},\ j=1,2,\dots,r \tag{5}\]  
The covariance corresponding to the above is:  
\[\mathbf{P}_{k-1|k-1}^{0j}=\sum_{i=1}^{r}\mathbf{\mu}_{k-1|k-1}^{ij}\Big{\{} \mathbf{P}_{k-1|k-1}^{i}+[\mathbf{x}_{k-1|k-1}^{i}-\mathbf{x}_{k-1|k-1}^{0j}] [\mathbf{x}_{k-1|k-1}^{i}-\mathbf{x}_{k-1|k-1}^{0j}]^{\mathrm{T}}\Big{\}} \tag{6}\]  
The model transition probabilities are related to the Markov chain and are defined as:  
\[\Pi=p\Big{\{}M_{k}^{j}\Big{|}M_{k-1}^{i}\Big{\}}= \begin{bmatrix}\pi_{11}&\pi_ {12}&\dots&\pi_{1j}\\ \pi_{21}&\pi_{22}&\dots&\pi_{2j}\\ \vdots&\vdots&\ddots&\vdots\\ \pi_{i1}&\pi_{i2}&\dots&\pi_{ij}\end{bmatrix}  \tag{7}\]  
where \(i,j=1,2,\dots,\ r\), and \(r\) is the number of sub-models.