# IMM Filtering Algorithms for a Highly Maneuvering Fighter Aircraft: An Overview
## 9 Measures of Performance (MoP)  
In order to evaluate the performance of the IMM-EKF, IMM-UKF, and IMM-CKF filters, we calculate the RMS position and velocity errors, ANEES [8; 24; 62; 63], RTAMS errors [12; 18; 51; 63], covariance consistency metric, and CPU times using Monte Carlo simulation. Given the true state \(\mathbf{x}_{k,i}\) and estimated state \(\mathbf{\hat{x}}_{k|k,i}\) of the aircraft, the RMS position and velocity errors at time \(t_{k}\) are defined, respectively, by  
\[\text{RMS}_{\text{position, }k}\ =\ \sqrt{\frac{1}{M}\sum_{i=1}^{M}\big{[}(x_{k,i}- \hat{x}_{k|k,i})^{2}+(y_{k,i}-\hat{y}_{k|k,i})^{2}\big{]}}, \tag{110}\]  
\[\text{RMS}_{\text{velocity, }k}\ =\ \sqrt{\frac{1}{M}\sum_{i=1}^{M}\big{[}(\hat{x}_{k,i}- \hat{x}_{k|k,i})^{2}+(\hat{y}_{k,i}-\hat{y}_{k|k,i})^{2}\big{]}}, \tag{111}\]  
where \(M\) denotes the number of Monte Carlo runs.  
The root time-averaged mean square (RTAMS) position and velocity errors [5; 20; 52] are defined, respectively, by  
\[\text{RTAMS}_{\text{position}}=\sqrt{\frac{1}{(k_{2}-k_{1}+1)M}\sum_{k=k_{1}}^{ k_{2}}\sum_{i=1}^{M}\big{[}(x_{k,i}-\hat{x}_{k|k,i})^{2}+(y_{k,i}-\hat{y}_{k|k,i})^{2} \big{]}}, \tag{112}\]  
\[\text{RTAMS}_{\text{velocity}}=\sqrt{\frac{1}{(k_{2}-k_{1}+1)M}\sum_{k=k_{1}}^{ k_{2}}\sum_{i=1}^{M}\big{[}(\hat{x}_{k,i}-\hat{x}_{k|k,i})^{2}+(\hat{y}_{k,i}- \hat{y}_{k|k,i})^{2}\big{]}}, \tag{113}\]  
where \(k_{1}\) and \(k_{2}\) are the first and the last indices of the trajectory segment, respectively.  
At time \(t_{k}\), the ANEES is calculated as [8; 24; 62; 63]  
\[\text{ANEES}_{k}:=\frac{1}{nM}\sum\limits_{i=1}^{M}{(\mathbf{x}_{k,i}-\hat{ \mathbf{x}}_{k|k,i})^{\prime}\mathbf{P}_{k|k,i}^{-1}(\mathbf{x}_{k,i}-\hat{ \mathbf{x}}_{k|k,i})}, \tag{114}\]  
where \(n\) denotes the dimension of the state, and \(\mathbf{P}_{k|k,i}\) is the covariance corresponding to \(\hat{\mathbf{x}}_{k|k,i}\). The criterion for determining that the estimation error is consistent with the calculated covariance of the filter at time \(t_{k}\) is that \(\text{ANEES}_{k}\) lies within the two-sided 99% confidence interval. For 1,000 Monte Carlo runs and a four-dimensional state vector, the 99% confidence interval is [0.943, 1.058]. Since the nonlinear filters are approximate, the filter calculated covariance, in general, is different from the actual mean square error matrix (MSEM). The average of the covariance matrix at time \(t_{k}\) is \(\bar{\mathbf{P}}_{k|k}=\frac{1}{M}\sum\limits_{i=1}^{M}{\mathbf{P}_{k|k,i}}\). The MSEM at time \(t_{k}\) is specified by  
\[\text{MSEM}_{k}=\frac{1}{M}\sum\limits_{i=1}^{M}{(\mathbf{x}_{k,i}-\hat{ \mathbf{x}}_{k|k,i})(\mathbf{x}_{k,i}-\hat{\mathbf{x}}_{k|k,i})^{\prime}}. \tag{115}\]  
At time \(t_{k}\), to determine the covariance consistency of a filter, we compute the ratio  
\[\zeta_{k}=\frac{\text{trace}(\bar{\mathbf{P}}_{k|k})}{\text{trace}\left(\text {MSEM}_{k}\right)}. \tag{116}\]  
If \(\zeta_{k}\) is close to unity, then the filter-calculated covariance is a good measure of the MSEM. Thus, \(\zeta_{k}\) can be regarded as a second metric for covariance consistency.