## 3 The Implementation of the Novel ARPD-RTK/INS Algorithm
### Weight Update  
The purpose of the weight update step is to identify the correct candidate position. Taking the ambiguity function method (AFM) as an example [4], it introduced an ambiguity function and aimed at finding the maximum value. The adaptive ambiguity function, which uses trigonometric functions to process the fractional value of carrier-phase measurement, is insensitive to the whole-cycle change of the carrier-phase measurement. We expect to maintain the advantage of this objective function, and determine to use the posterior probability density function (PDF) to replace the multi-peak and complicated ambiguity function as a new objective function. From the Bayesian rule, the posterior density can be factorized by:  
\[\mathrm{P}(\mathbf{x}_{k}|\mathbf{z}_{k})=\frac{P(\mathbf{z}_{k}|\mathbf{x}_{k})P(\mathbf{x}_{k})} {\int P(\mathbf{z}_{k}|\mathbf{x}_{k})d\mathbf{x}_{k}} \tag{16}\]  
The prior distribution \(P(\mathbf{x}_{k})\) can be obtained from the INS motion model. Assuming that the system noise conforms to the Gaussian distribution, the prior distribution \(P(\mathbf{x}_{k})\) can be achieved as:  
\[\mathrm{P}(\mathbf{x}_{k})\propto exp\bigg{[}-\frac{1}{2}(\mathbf{x}_{k}-\widehat\mathbf{{x}}_{INS})^{T}\mathbf{C}(\mathbf{x}_{k})^{-1}(\mathbf{x}_{k}-\widehat{\mathbf{x}}_{INS})\, \bigg{]} \tag{17}\]  
where \(\widehat{\mathbf{x}}_{INS}\) denotes the position derived by INS measurements, and \(\mathbf{C}(\mathbf{x}_{k})\) is the position error covariance matrix. When new GNSS measurements arrive, the calculation of likelihood distribution \(\mathrm{P}(\mathbf{z}_{k}|\mathbf{x}_{k})\) is similar to Equation (17) under the assumption that the measurement noise is Gaussian. Since we try to avoid involving pseudorange observations, the update of the grid weights only makes use of current carrier phase measurements. For a certain grid point, the float ambiguity corresponding to each satellite can be calculated according to the position, and there definitely exists a set of nearest integer solutions. The float double-difference ambiguity can be estimated by:  
\[\
abla\Delta\mathbf{N}_{rb}^{st,WL}=\,\
abla\Delta\mathbf{\Phi}_{rb}^{st,WL}-\frac{1} {\lambda_{WL}}[(\widehat{\mathbf{r}}_{\mathrm{rs}}-\widehat{\mathbf{r}}_{\mathrm{bs}}) -(\widehat{\mathbf{r}}_{\mathrm{rt}}-\widehat{\mathbf{r}}_{\mathrm{bt}})] \tag{18}\]  
where \(\lambda_{WL}\) is the wide-lane wavelength, \(\widehat{\mathbf{r}}_{\mathrm{rs}}\) is the estimated distance from rover \(r\) to satellite \(s\), and \(\widehat{\mathbf{r}}_{\mathrm{bs}}\) is the estimated distance from base station \(b\) to satellite \(s\). The integer ambiguity solution is set as:  
\[\
abla\Delta\widehat{\mathbf{N}}_{rb}^{st,WL}=R\Big{(}\,\
abla\Delta\mathbf{N}_{rb}^{ st,WL}\Big{)} \tag{19}\]  
where the function \(R(\cdot)\) denotes its nearest integer. Consequently, the likelihood distribution \(\mathrm{P}(\mathbf{z}_{k}|\mathbf{x}_{k})\) is proportional to:  
\[\mathrm{P}(\mathbf{z}_{k}|\mathbf{x}_{k})\propto exp[-\frac{1}{2}(\,\
abla\Delta\mathbf{N} _{rb}^{st,WL}-\,\
abla\Delta\widehat{\mathbf{N}}_{rb}^{st,WL})^{T}\mathbf{C}(\mathbf{N}_{ WL})^{-1}(\,\
abla\Delta\widehat{\mathbf{N}}_{rb}^{st,WL}-\,\
abla\Delta\widehat{\mathbf{N}}_{rb}^{ st,WL})] \tag{20}\]  
Figure 5: A typical example for the grid creation step. The error covariance matrix \(\mathbf{C}(\mathbf{N}_{\text{WL}})\) can be simplified as a constant matrix, which is composed of the covariance matrix of measurement noise \(\mathbf{R}_{MEAS,WL}\) and single-differencing matrix \(\mathbf{D}\). \[\mathbf{C}(\mathbf{N}_{\text{WL}})=\left[ \begin{array}{cccc}\mathbf{D}\mathbf{R}_{\mathbf{\phi}, WL}\mathbf{D}^{\text{T}}\end{array} \right] \tag{21}\]  
\[\mathbf{D}=\left[ \begin{array}{cccc}-1&0&\cdots&0&1\\ 0&-1&\cdots&0&1\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ 0&0&\cdots&-1&1\end{array}