# Evaluation of 5G Positioning Performance Based on UTDoA, AoA and Base-Station Selective Exclusion
## 3 Position Solution and Measurement Exclusion
### NLoS BS Exclusion Mechanism
#### 3.3.1 Computation of Test Statistic  
The method for calculating the test statistic and its theoretical statistical distribution is presented in this subsection. The network provides a WLS estimate of the position based on TDoA measurements. This is done using the linearized measurement equation in (15). The estimated user position \(\hat{\mathbf{x}}\) and the pseudo-range residual errors \(\Delta\boldsymbol{\rho}=\rho(\hat{\mathbf{x}}_{t-1})-\hat{\boldsymbol{\rho}}\) obtained from the WLS will later contribute in the computation of the test statistic. The vector of pseudo-range residual errors, \(\Delta\boldsymbol{\rho}\), is the difference between the predicted and the measured pseudo-ranges. Given the known location \(\mathbf{x}_{BS,n}\) of the \(n\)-th position among \(M_{\text{BS}_{\text{TDoA}}}\), available BSs and the estimated user position in (15), it is possible to compute the geometry matrix \(\mathbf{G}\) as defined in (19). The geometry matrix is decomposed into the signal matrix (\(\mathbf{U}_{S}\)) and noise matrix (\(\mathbf{U}_{N}\)) through QR factorization [22]. The dimension of the noise subspace is \((M_{\text{BS}_{\text{TDoA}}}-4)\). In the absence of any fault, the noise subspace should only contain the noisy  
Figure 2: NLOS BS exclusion mechanism. contribution of the WLS residuals. and thus it could be modeled as a subspace of zero-mean Gaussian random vectors [23]. However, when a bias is present, the noise subspace will be distorted by the faulty bias and the noise-only condition will not be clear-cut. The QR factorization is preferable instead of performing conventional orthogonal matrix projection because it requires less computation and allows one to easily distinguish the noise from the signal by visualizing the presence of any degradation. These constitutes the building blocks for the detection method. The residuals on which the detection is implemented are obtained as follows:  
\[\varepsilon_{i}=\mathbf{U}_{N_{i}}^{T}\;\Delta\boldsymbol{\rho}_{i}, \tag{31}\]  
where \(\mathbf{U}_{N}^{T}\) is a \((M_{BS_{TDoA}}-4)\times(M_{BS_{TDoA}}-1)\) matrix, whose rows are mutually orthogonal. To normalize the range residuals and remove correlation between data, the whitening process is performed. First, the covariance matrix's dimensions of the range residuals are made independent by performing principal component analysis. The covariance matrix is calculated as:  
\[\mathbf{Cov}_{res_{i}}=\mathbf{U}_{N_{i}}\;\mathbf{Cov}_{i}\;\mathbf{U}_{N_{i} ^{T}}^{T}, \tag{32}\]  
where \(\mathbf{Cov}\) is the covariance matrix of the pseudo-range errors under the conditions of perfect synchronization error and no bias in the measurements. Then, an eigen decomposition is performed:  
\[\mathbf{Cov}_{res_{i}}=\mathbf{V}_{i}\;\mathbf{D}_{i}\;\mathbf{V}_{i}^{T}, \tag{33}\]  
where \(\mathbf{V}\) is an orthogonal rotation matrix composed of eigenvectors of \(\mathbf{Cov}_{res}\), and \(\mathbf{D}\) is a diagonal matrix with eigenvalues on the diagonal. \(\mathbf{V}^{T}\) gives a rotation needed to de-correlate the data. So, we have:  
\[\hat{\varepsilon}_{i}=(\mathbf{V}_{i}\sqrt{\mathbf{D}_{i}})^{-1}\epsilon_{i}. \tag{34}\]  
Finally, the test statistic is formed from the Sum of Squared Residuals (SSR):  
\[\text{SSR}_{\text{i}}=\hat{\varepsilon}_{i}^{T}\hat{\varepsilon}_{i}, \tag{35}\]  
where the \(i\)-th test statistic for \(i=1,2,\ldots\ldots,M_{BS_{TDoA}}-1\) subsets is given by:  
\[T_{i}=\sqrt{\text{SSR}_{\text{i}}/(M_{BS_{TDoA}}-4)}. \tag{36}\]  
If the measurement errors are normally distributed with zero mean, \(\text{SSR}_{\text{i}}^{2}\) has \(\chi^{2}\) distribution with \(M_{BS_{TDoA}}-4\) degrees of freedom. The distribution is modified to a non-central \(\chi^{2}\) with the same degree of freedom if any measurement error is biased. In this case, the distribution is affected more strongly by geometry through the noncentrality parameter. The decision variable \(T_{i}\) is tested against a threshold \(\gamma\) (see next sub-section).