# Ambiguity-Resolved Model Tests for Carrier-Phase GNSS
## Appendix A Proof of Lemma 1 (Differences normed residuals).
This changes under \(\mathcal{H}_{a}\), since \(\underline{\hat{a}}_{0}\) will then have become a biased estimator of \(a\), \(\mathsf{E}(\underline{\hat{a}}_{0}|\mathcal{H}_{a})=a+\bar{A}^{+}C\varepsilon\
eq a\). Thus, under \(\mathcal{H}_{a}\), we have \(\underline{\hat{a}}\to a\) and \(\underline{\hat{a}}_{0}\to a_{0}\
eq a\), when \(\mathsf{P}[\underline{\hat{a}}=a]\to 1\). Therefore, we have \(\lim\limits_{\mathsf{P}[\underline{\hat{a}}=a]\to 1}\underline{T}(\underline{\hat{a}}_{0}, \underline{\hat{a}})=\underline{T}(a_{0},a)\). To determine the distribution of the latter, we make use of its representation  
\[ \begin{array}{rcl}\underline{T}(a_{0},a)&=&||\hat{c}(a_{0})||_{Q_{ab}(a)}^{ 2}+\underline{\hat{a}}(a_{0},a)\\ \underline{\hat{a}}(a_{0},a)&=&||\underline{\hat{a}}-a_{0}||_{Q_{\underline{a} }}^{2}-||\underline{\hat{a}}-a||_{Q_{\underline{a}}}^{2}\end{array}  \tag{1}\]  
thereby recognizing that \(\underline{\hat{a}}(a_{0},a)\) is independent of \(||\underline{\hat{c}}(a_{0})||_{Q_{c(a)(a)}}^{2}\), since \(\underline{\hat{a}}\) is independent of \(\underline{\hat{c}}(a_{0})\). We now determine the distributions of \(||\underline{\hat{c}}(a_{0})||_{Q_{c(a)(a)}}^{2}\) and \(\underline{\hat{n}}(a_{0},a)\) separately. Since \(\underline{\hat{c}}(a_{0})=\tilde{\mathcal{C}}^{+}(\underline{y}-Aa_{0})\), we have \(\tilde{\mathcal{C}}\underline{\hat{c}}(a_{0})=P_{\mathcal{C}}(\underline{y}-Aa _{0})\) and, therefore, \(||\underline{\hat{c}}(a_{0})||_{Q_{c(a)(a)}(a)}^{2}=||P_{\mathcal{C}}(\underline{y }-Aa_{0})||_{Q_{gy}}^{2}\). Hence,  
\[ \begin{array}{l}||\underline{\hat{c}}(a_{0})||_{Q_{c(a)(a)}}^{2}\left\{\begin{array} []{l}\begin{array}{l}\mathcal{H}_{a}\\ \sim\end{array}\chi^{2}(q,\lambda)\\ \mathcal{H}_{0}\\ \sim\end{array}\chi^{2}(q,0)\end{array} \right.\end{array} \tag{2}\]  
with noncentrality parameter \(\lambda=||\tilde{\mathcal{C}}c+P_{\mathcal{C}}A(a-a_{0})||_{Q_{gy}}^{2}=||c+ \tilde{\mathcal{C}}^{+}A(a-a_{0})||_{Q_{c(a)(a)}}^{2}\). For \(\underline{\hat{n}}(a_{0},a)\), we may write \(\underline{\hat{n}}(a_{0},a)=||(\underline{\hat{a}}-a)+(a-a_{0})||_{Q_{\underline{ a}}}^{2}-||\underline{\hat{a}}-a||_{Q_{\underline{a}}}^{2}=2(a-a_{0})^{T}Q_{ \underline{a}}^{-1}(\underline{\hat{a}}-\frac{1}{2}(a+a_{0}))\), thus showing that \(\underline{\hat{n}}(a_{0},a)\) is a linear function of a normally distributed random vector and, therefore, is normally distributed itself. Furthermore, it is identically zero if \(a=a_{0}\). Hence, it follows that  
\[\underline{\hat{n}}(a_{0},a)\left\{ \begin{array}{l}\mathcal{H}_{a}\\ \sim\end{array} \mathcal{N}(\mu,4\mu^{2})\\ \stackrel{{\mathcal{H}_{0}}}{{=}}0\end{array}\right. \tag{3}\]  
with \(\mu=||a-a_{0}||_{Q_{\underline{a}}}^{2}\). Combining (2) and (3) proves the result of Theorem 1. **Proof of Lemma 2 (Distribution of \(\underline{T(\underline{\mathbf{\hat{z}}},\underline{\mathbf{\hat{z}}})}\)). ** As \(||\underline{\hat{\varepsilon}}(z)||^{2}_{Q_{(\underline{\mathbf{\hat{z}}})( \underline{\mathbf{\hat{z}}})}}\stackrel{{\mathcal{H}_{\mathbf{ \hat{z}}}}}{{\sim}}\chi^{2}(q,\lambda_{z})\), and \(\underline{\hat{c}}(z)\) and \(\underline{\hat{d}}\) are independent, we have for any \(\Omega\subset\mathbb{R}^{q}\),  
\[ \begin{array}{rcl}\mathsf{P}[\underline{T}\in\Omega]&=&\mathsf{P}[|| \underline{\hat{c}}(a)||^{2}_{Q_{(\underline{\mathbf{\hat{z}}})(\underline{ \mathbf{\hat{c}}})}}\in\Omega]\\ &=&\sum\limits_{z\in\mathbb{Z}^{n}}\mathsf{P}[||\underline{\hat{c}}(z)||^{2}_ {Q_{(\underline{\mathbf{\hat{c}}})(\underline{\mathbf{\hat{c}}})}}\in\Omega, \underline{\hat{d}}=z]\\ &=&\sum\limits_{z\in\mathbb{Z}^{n}}\mathsf{P}[||\underline{\hat{c}}(z)||^{2}_ {Q_{(\underline{\mathbf{\hat{c}}})(\underline{\mathbf{\hat{c}}})}}\in\Omega] \mathsf{P}[\underline{\hat{d}}=z]\\ &=&\sum\limits_{z\in\mathbb{Z}^{n}}\mathsf{P}[\underline{\chi}^{2}(q,\lambda_ {z})\in\Omega]\mathsf{P}[\underline{\hat{d}}=z]\end{array} \]  
from which the result follows.