# Tracking Extended Targets: Novel TPMB Filter Driven by Model and Data Collaboration
## 3 Model-Driven IMM-TPMB Filter
### Implementation of an IMM-TPMB Filter Based on Two Consecutive Time Points  
In multi-maneuvering target tracking scenarios, the motion states at different times may be described by multiple motion models, and the filtering results must consider the state outputs from various models. The IMM method is an effective solution for such problems. The IMM method uses multiple different models to model the target's state, and each model could be the optimal one at the current moment. Assuming the number of tracking models is \(\psi\), the motion matching model at time step \(k-1\) is \(M_{k-1}^{\xi^{\prime}}\), and at time step \(k\) it is \(M_{k}^{\xi^{\prime}}\), with a model mixing probability of \(\mu_{k-1}^{\xi^{\prime}}\), it can be represented as follows:  
\[\mu_{k-1}^{\xi^{\prime}} =P\big{(}M_{k-1}^{\xi^{\prime}}\big{|}M_{k}^{\xi^{\prime}},Z_{k-1} \big{)} \tag{29}\] \[=1/\overline{c}^{\xi^{\prime}}P\big{(}M_{k-1}^{\xi^{\prime}} \big{|}M_{k}^{\xi^{\prime}},Z_{k-1}\big{)}P\big{(}M_{k-1}^{\xi^{\prime}}|Z_{k- 1}\big{)}\] \[=1/\overline{c}^{\xi^{\prime}}\pi_{k-1}^{\xi^{\prime}}\mu_{k-1}^ {\xi^{\prime}}\]  
where the Markov transition probability from \(\xi\) to \(\xi^{\prime}\) at time step \(k-1\) for model \(\pi_{k-1}^{\xi^{\prime}}\), \(\mu_{k-1}^{\xi^{\prime}}\) represents the probability of model \(\xi\) being the matching model at time step \(k-1\), and \(\overline{c}^{\xi^{\prime}}\) represents the normalization constant, which can be expressed as follows:  
\[\overline{c}^{\xi^{\prime}}=\sum_{\xi=1}^{\psi}\pi_{k-1}^{\xi^{\prime}|\xi^{ \prime}}\mu_{k-1}^{\xi},\xi^{\prime}=1,\cdots,\psi \tag{30}\]  
Figure 1: Factor graph of the factorization of Equation (24), with circles and squares representing factor nodes and variable nodes. Using the initial state mean \(\hat{x}_{k-1}^{i}\) of model \(i\), the initial conditions for model \(\xi\) are calculated. \[\hat{x}_{k-1}^{0\xi^{\prime}}=E\left(X_{k-1}\left|M_{k}^{\xi},Z_{k-1}\right. \right)=\sum\limits_{\xi^{\prime}=1}^{N}\hat{x}_{k-1}^{\xi^{\prime}}\hat{x}_{k- 1}^{\xi^{\prime}} \tag{31}\]  
\[P_{k-1}^{0\xi^{\prime}}=\sum\limits_{\xi=1}^{N}\mu_{k-1}^{\xi^{\prime}}\left[P _{k-1}^{\xi^{\prime}}+\left(\hat{x}_{k-1}^{\xi^{\prime}}-\hat{x}_{k-1}^{0|\xi }\right)\left(\hat{x}_{k-1}^{\xi^{\prime}}-\hat{x}_{k-1}^{0|\xi}\right)^{\sf T }\right] \tag{32}\]  
where \(\hat{x}_{k-1}^{0\xi^{\prime}}\) and \(P_{k-1}^{0\xi^{\prime}}\) represent the mixed state matrix and mixed covariance input to the filter, respectively. The filtering algorithm is used for prediction and updating. After each time update, it is necessary to recompute the Markov matrix. However, the computation of the transition matrix is complex and susceptible to noise. To address this issue, this section adopts the posterior probability density of each model to calculate the transition probabilities \(\pi_{k-1}^{\xi^{\prime}}\). As the transition probabilities are closely related to state changes, and the state changes are mainly determined by the posterior probability \(p_{k}^{\xi}\) of model \(M_{k}^{\xi}\) at time step \(k\), the transition probabilities between models can be reflected using changes in the posterior probabilities between two consecutive moments. Given the posterior probability density \(\mu_{k-1}^{\xi^{\prime}}\) of model \(M_{k-1}^{\xi^{\prime}}\) at time step \(k-1\), the relative rate of change of probability between two adjacent moments \(\Delta_{k}^{\xi^{\prime}|\xi^{\prime}}\) can be given by the following proportional form:  
\[\Delta_{k}^{\xi^{\prime}|\xi^{\prime}}=\frac{\mu_{k}^{\xi}}{\mu_{k-1}^{\xi^{ \prime}}} \tag{33}\]  
As indicated by Equation (33), when the probability density \(\mu_{k}^{\xi}\) of model \(M_{k}^{\xi}\) at time step \(k\) increases, \(\Delta_{k}^{\xi^{\prime}|\xi^{\prime}}>1\). This means that the posterior probability density from other models at \(k-1\) moments transitioning to the current model gradually increases; the converse is also true.