## 2 GNSS Measurement Residuals
### Residual Modeling  
There are several different methods to model the GNSS residuals; for example, exponential representation of carrier phase noise, elevation angle-dependent noise estimation, and theoretical computation of the carrier phase noise from the third-order PLL. Furthermore, another novel method recently proposed and explored is the machine learning approach that models the residuals with respect to the input parameters using non-linear regression. Measurement noise is well known to be inversely proportional to the elevation angle of the satellites. [PERSON] proved that the carrier phase variance is strongly dependent on the elevation of the satellites [24]. Additionally, there have been numerous elevation-dependent modelsfor the residual estimation. Equation (12) has been proposed by [PERSON] and [PERSON] [10; 11]. Equation (13) was proposed by [PERSON], and Equation (14) by [PERSON] et al. [25; 26]. These are used by various software packages such as the Bernese GNSS software [27]. \[\sigma^{2}=\frac{1}{sin(El)^{2}} \tag{12}\]  
\[\sigma^{2}=\frac{1}{sin(El)} \tag{13}\]  
\[\sigma^{2}=\frac{1}{El^{2}} \tag{14}\]  
where \(El\) is the satellite elevation angle in degrees, and \(\sigma\) is the noise error standard deviation. Another GNSS residual modeling method uses a well-known relationship between the Carrier-to-Noise Ratio (C/No) and expected carrier phase noise for the third-order PLL used by GNSS receivers [28]. This relationship is often used to theoretically assess the expected carrier phase noise, but it does not consider the GNSS receiver hardware clock and voltage-controlled oscillator (VCO), which also contribute to the total noise of the receiver [29]. \[\sigma_{\phi}^{2}=\frac{B_{n}}{C/No}\bigg{(}1+\frac{1}{2T_{\text{c}}C/No} \bigg{)} \tag{15}\]  
where \(B_{n}\) is the PLL loop bandwidth, and \(T_{\text{C}}\) is the integration time of the tracking loop in milliseconds. In this study, we propose applying a machine learning algorithm to consider various GNSS signal reception environment factors at the receiver site, as opposed to using deterministic methods. Decision trees and support vector machines (SVM) are popular machine learning tools used in data classification and regression. For the residual modeling, we use both methodologies due to their inherent characteristics. The decision tree method makes no assumptions on the distribution of the data nor the structure of the model, so it is effective for modeling data with discrete behavior such as multipath behavior [30]. On the other hand, SVM are effective for continuous data such as multi-variable-dependent noise, as they are able to effectively model the noise while mitigating portions of data with anomalies or unavailability. In order to construct the regression tree, we followed the method outlined by [PERSON] et al. [31] by defining two regions \(R_{1}\) and \(R_{2}\) based on a splitting variable \(j\) and a split point \(s\). \[\left\{ \begin{aligned}  R_{1}(j,s)&=\left\{X|X_{j} \leq s\right\}\\ R_{2}(j,s)&=\left\{X|X_{j}>s\right\}\end{aligned} \right. \tag{16}\]  
where \(X\) is the data. We find the pair \((j,s)\) such that we minimize the cost function \(J\). \[J=\min_{js}\bigg{[}\min_{cl}\sum_{\alpha_{l}\in R_{1}(j,s)}(y_{i}-c_{1})^{2} +\min_{cl2}\sum_{\alpha_{l}\in R_{2}(j,s)}(y_{i}-c_{2})^{2}\bigg{]}\]  
\[\text{where }\left\{ \begin{aligned} & c_{1}=\frac{(y_{i}|x_{i}\in R_{1}(j,s))}{(y_{i}| x_{i}\in R_{2}(j,s))}\\ \end{aligned} \right. \tag{17}\]  
In Equation (17), \(x\) is the input variable, and \(y\) is the predictor. After splitting the data into two regions, they are split further again until the minimum node size is reached. For the SVM, we find non-linear boundaries for the data by constructing a hyperplane. The input data are transformed using kernel functions. There are various options for the kernel including polynomial and Gaussian. In our case, the third-order polynomial kernel is selected. Afterwards, a hyperplane is selected such that the distance between the plane and the data points is maximized.