## 3 Machine Learning-Based GNSS Residual Error Modeling Methodology
### Residual Modeling Using Machine Learning Regression  
The residuals obtained from SBDD consist of mainly noise and multipath components. Therefore, these terms must be separated prior to modeling as shown in Figure 2. While the noise components are rapidly fluctuating close to white noise, the multipath (MP) is changing slowly. Therefore, the results of a high-pass filter (HPF) are representative of receiver noise, while the outputs of a low-pass filter (LPF) are appropriate for modeling the effects of the multipath on the measurements. The cutoff frequency for the HPF and LPF was selected as 0.3 Hz because this was the optimal value used by Forte [32] to detrend the carrier phase measurements for scintillation detection purposes. Finally, both are modeled separately using machine learning regression. Figure 1: Overview of the GNSS carrier phase residual computation, modeling, and monitoring. Figure 2: SBDD residuals are split into HPF and LPF components, then binned according to the C/No, elevation, and azimuth of each satellite P and Q. The input parameters for the machine learning are the normalized East, North, and Up (ENU) of both the satellites with respect to the receivers, and the satellite C/No. Existing methods presented models with only elevation and/or C/No input variables, but the suggested method accounts for the azimuth as well, and the model is constructed empirically using GNSS data collected by the receivers. We used ENU instead of elevation and azimuth of the satellites, as the regression model will not recognize that 0\({}^{\circ}\) azimuth is equivalent to 360\({}^{\circ}\) azimuth. To calculate the residuals, we employed the root-mean-square (RMS) of residuals accumulated over a minimum of 5 continuous seconds. If the residuals exceeded the predetermined bin size, the accumulation was reset, and the RMS value was treated as a single residual corresponding to the respective bin for model training. The bin sizes can be adjusted based on the available sample data and the short-term variability of the parameters. Choosing wider bin widths would yield more conservative residual estimates, whereas opting for finer bin widths would necessitate a significantly larger number of samples to accurately model the residuals. In our case, the bin widths were defined as 0.01 m for East and North, 0.05 m for the Up direction, and 2 dB-Hz for C/No. This is because we wanted finer resolution for azimuth-dependent multipath modeling, and more conservative estimates for elevation dependent residual estimation. Additionally, the 2 dB-Hz frequency was selected, because for our receiver and given ENU bin sizes, the C/No variability for each continuous residual used for RMS computation was within this range. However, for other receivers with different tracking loop bandwidth and antenna characteristics, different bin sizes should be used. For the machine learning models, we considered SVM for HPF and a tree for LPF. This is because thermal noise has a strong Gaussian property, and the SVM would model the residuals as being continuous to the input features described above, which will assist in modeling the residuals for bins with a limited number of samples. Multiple SVM models including linear, second-order, third-order, and Gaussian have been considered, but the Gaussian SVM were finally chosen as their regression modeling errors with respect to the training data were the smallest compared to other models. The smaller the kernel scale means higher variations in the response function, so a kernel scale of \(\frac{\sqrt{p}}{4}\), where \(P\) is the number of predictors, is selected. In contrast to the HPF, a tree is used as the model type for the LPF, as a multipath is discrete and environmentally dependent. The greater the number of nodes means higher flexibility in the response function, so a minimum node size of four was chosen.