# Anomaly Detection in Autonomous Deep-Space Navigation via Filter Bank Gating Networks
## 3 Materials and Methods
### Discussion  
As described, the cost function that defines this optimal gating network was designed to prefer filters in the bank that were generating predicted measurement residuals that were not anomalously large relative to the uncertainty associated with the measurements and state estimates. Among its strengths, are its abilities to analytically generate normalized weightings for a filter bank with an arbitrary number of filters, automatically identify and de-weight filters that are producing anomalous results, maintain a memory of how well each filter in the bank is performing, and be tuned to adjust how strong its memory is. Though this method has its strengths, it has two notable limitations, which include:  
* Dealing with Biased Measurements: When measurements are biased, a filter that processes them will generally produce solutions that drift away from truth. This may or may not be detectable in measurement-residual space. However, the measurement residuals from a properly functioning filter that does not process the biased measurements will show the bias in its \(\chi^{2}\) residual metrics. Whether it can be detected or not is based on how large the bias is relative to the filter innovations uncertainty. Essentiallythis means that properly functioning filters are penalized by the presence of biased measurements even when this filter does not process the biased measurements. * Preference for Over-Inflated Uncertainty Metrics: When state or measurement uncertainty is inflated (i.e., made to appear more uncertain than the available information implies), the resulting \(\chi^{2}\) metrics will be smaller than they should be in a statistical sense, which will make the filter seem like it is performing better than it really is. This weighting scheme only penalizes residuals when they are too big, not when they are abnormally small. To ensure that biased measurements do not disadvantage a filter that does not even process them, we can modify the optimal weighting scheme by using a mean \(\chi^{2}\) value for all residual metrics when the associated measurement was not actually processed by the filter in question. This is accomplished by setting \(G_{k,i,j}=n_{j}\) (i.e., the \(\chi^{2}\) distribution mean) where \(n_{j}\) is the dimension of the \(j\)th measurement vector and \(i\) is in the set \(\Omega_{j}\), which defines all filter indices that do not process the \(j\)th measurement vector. All non-processing filters will be represented as performing nominally, while the remaining filters will be penalized if the biased measurements degrade their performance. The second issue, a preference for over-inflated uncertainty metrics, does not have an obvious solution within the currently defined algorithm. The algorithm's \(\chi^{2}\) form could be adjusted to penalize solutions that produce residuals that deviate from a mean or median estimator, but this would require significant adjustments to the algorithm. We leave this as an avenue for future development of this algorithm. For now, the user would need to manually check that the filters are not producing residuals that are statistically too small too often. In terms of practical application, the authors provide the following notes:  
* Gating network a priori weights: When initializing a filter bank with \(N\) filters, we generally assume that the filters are equally weighted (i.e., each has an initial weight of \(1/N\)). * Gating network batch length: This optimal gating network is designed to work on batches of data. New weights are computed each time a new set of \(M\) measurements are processed. These \(M\) measurements can be a collection of different types (e.g., radiometric, optical, etc.). The selected batch length can have a large effect of the gating network's performance. A small batch size makes the network more agile, but it also makes the network less robust to false detections. Generally, it is preferred that each batch size contains a good mixture of the available data types, but this is not a requirement.