## 3 Machine Learning-Based GNSS Residual Error Modeling Methodology
### Inflation Factor and Threshold Computation  
An integrity monitoring system is responsible for detecting potential threats by comparing the residuals to specified thresholds. Typically, the residuals reflect the characteristics of the target threat and can be used to evaluate the system's integrity performance [33]. The thresholds are determined based on the statistic distribution of the residuals and the false alarm rate required to support specific applications [34]. These thresholds are determined using the required probabilities of missed detection and a false alarm as specified by the system. Both of these probabilities must be considered to satisfy the system integrity risk and the continuity of service requirements [35]. A false alarm poses a problem for the continuity risk, which is the probability that the system will be interrupted despite there being no issues present [36; 37]. Particularly, for typical safety-of-life applications, an allowable maximum false alarm rate is allocated, as unscheduled system interruptions can lead to fatal accidents [38; 39]. Therefore, it is critical to determine the proper detection threshold so that the probability of a false alarm does not exceed the desired requirements. The probability of missed detection refers to the possibility that the threshold is not exceeded even though anomalies, such as carrier phase cycle-slips, may be present [40]. However, in this study, the focus is on the probability of a false alarm rather than the missed detection. This is because the residual modeling methodology of this study is designed for nominal conditions without any measurement anomalies. This approach aligns with the typical practice of initially determining the fault-detection thresholds using only the false alarm probability allocated from the continuity requirement of the system [41]. To determine the threshold, it is assumed that the residuals under nominal conditions can be bound by a normal distribution with a zero mean and a specified standard deviation [37]. If the normal distribution was correctly modeled and the estimated residuals effectively bound the actual residuals, the estimated metrics should over-bound the actual metrics at the tails of the normal distribution. However, the two tails of the actual residual distribution may not be Gaussian or may be larger than expected, due to effects of a multi-path or the influence of measurement noise [42; 43]. Therefore, if the tail statistics associated with the threshold are not sufficient for over-bounding of the residuals, the probability of a false alarm may be larger than the system requirement. Hence, inflation factors for the estimated residuals from the machine learning regression need to be calculated in order to over-bound the tails of the actual residual distribution. To compute the inflation factor, the residuals need to be converted prior to being compared to the standard normal distribution. The conversion is carried out by normalizing the actual residuals using the estimated residuals [33], as expressed in Equation (18). \[res_{norm}=\frac{res}{\sigma_{estimated}} \tag{18}\]  
In Equation (18), \(res\), \(res_{norm}\), and \(\sigma_{estimated}\) represent the actual residuals, normalized residuals, and standard deviation of the residuals estimated using machine learning, respectively. As different machine learning models have been applied to the HPF and LPF data, the inflation factors should also be computed for each dataset, respectively. For the HPF, as the residuals represent measurement noise with a zero mean, the resulting ratio distribution is close to a Cauchy distribution. For the LPF, the corresponding ratio distribution is bimodal with peaks at \(\pm 1\) due to the presence of non-zero mean effects of a multipath with both positive and negative signs. However, if the zero mean modeling error is sufficiently large, the ratio distribution for LPF will also be a Cauchy distribution.