## 2 GNSS Measurement Residuals
### Residual Computation  
The carrier phase measurements represent the line-of-sight distance between the satellites and the user, so the satellite motion needs to be removed prior to modeling and monitoring. There are several methods for removing the geometry variation, which are detrending or differencing the carrier phase measurements. One way to remove the satellite dynamics is carrier detrending that uses polynomials to estimate satellite motion. Similarly, high-pass filters can be used to separate noise from satellite motion and a multipath. For example, a sixth order Butterworth Filter can be used to remove the slowly varying satellite motion [16]. These detrending methods are often used to obtain residuals for the detection of GNSS anomalies such as ionospheric scintillation. Although the detrending method is effective for a single antenna, the accuracy and precision of the residuals are environment- and receiver-dependent, and the presence of atmospheric and clock variations makes the assessment of receiver noise difficult. It is also available that the satellite motion can be predicted from the GNSS ephemeris files, but the exact location of the receiver should be exactly surveyed to assess their effects on the carrier phase, and the ephemeris degradation over time might cause a buildup of residual inaccuracies. Furthermore, the biggest problem with detrending the carrier phase measurements is that whenever the monitor is reset due to initialization or fault detection, a number of samples are required to bring the filtered residuals back to nominal levels [21]. Code and carrier phase measurements both have an identical geometric range according to Equations (1) and (2). Therefore, if we take the difference between the measurements, Code Minus Carrier (CMC), the satellite motion with common errors is removed. However, the problem with using this metric is that the noise and multipath in code measurement noise are dominant compared to those in the carrier. [PERSON] observed that the noise of the code is approximately 1000 times greater than that of the carrier [22]. Furthermore, while the effect of the troposphere is removed, the ionosphere effect as a delay on the code and as an advance on the carrier results in the ionosphere divergence. When we difference (\(\Delta\)) the carrier phase measurements between receivers \(A\) and \(B\) for a common satellite \(P\), the Single Difference between Receivers, as shown in (3), the effects of the ionosphere and troposphere will be cancelled out as long as the antennas are close to each other. If the receivers share a common antenna, the difference in the geometric range and the multipath cancels out. Otherwise, the difference in the geometric range should be estimated to be removed, which will be outlined further in this paper. The integer ambiguities should be especially fixed and removed as demonstrated by [PERSON] [8] when we difference carrier phases unlike code measurements. The difference in the receiver clock stability will still be a part of the residuals. \[\Delta\phi_{AB}^{P}=(R_{A}^{P}-R_{B}^{P})+c(\delta t_{A}-\delta t_{B})+(N_{A}^{ P}-N_{B}^{P})\lambda+(M_{A}^{P}-M_{B}^{P})+\epsilon_{AB}^{P} \tag{3}\]  
The double difference is a between-satellite single difference of a between-receiver single difference as shown in (4). The between-satellite difference is useful because the combination eliminates clock errors, both the satellite and receiver clock errors. The removal of the clock errors in the double difference makes it possible to reduce all the non-integer biases and determine the integer ambiguity. \[\
abla\Delta\phi_{AB}^{PQ}=\phi_{A}^{P}-\phi_{A}^{Q}-\phi_{B}^{P}+\phi_{B}^{Q} \tag{4}\]  
ZBDD is a popular method used by many academic and industrial entities to estimate GNSS receiver noise [15]. It is computed by taking the double difference of measurements between two satellites and two receivers that share a single antenna. First, we take the difference of the carrier phase for satellite \(P\) between receivers \(A\) and \(B\) as shown in (5).