# Comprehensive Evaluations of NLOS and Linearization Errors on UWB Positioning
## 2 Methods
### Robust Particle Filter  
The core idea of the PF algorithm is to select a group of particles randomly to replace the posterior probability distribution of the current system state. When the system is nonlinear, this algorithm has better filtering performance and the ability to deal with the influence of non-Gaussian noise compared with other algorithms. Therefore, it is widely used in the positioning system [36]. The recursive formula of PF is as follows:  
1. Setting the initial value \(X_{0}\);
2. Particle initialization: Sampling particle (\(\mathbf{x}_{i,0}\), \(i=1,\,2,\,\dots,\,m\)) is generated from the prior probability distribution \(p(X_{0})\);
3. Predictive step \[\mathbf{x}_{i,1}=\mathbf{F}\mathbf{x}_{i,0}+\mathbf{q}_{i}\] (10) where \(\mathbf{q}_{i}\) is random vector obeying \(\mathbf{N}\) (0, \(\mathbf{Q}\));
4. Update step The observation noise is assumed to obey the Gaussian distribution with the variance \(\mathbf{R}\), and then, the corresponding weight \(\mathbf{w}_{i,1}\) of the particle \(\mathbf{x}_{i,1}\) is calculated [37] by  
\[\mathbf{w}_{i,1}=f_{R}\big{[}\mathbf{Z}_{1}-h(\mathbf{x}_{i,1})\big{]}\mathbf{w}_{i,0}\mathbf{\lambda }_{i}=\frac{1}{\sqrt{2\pi\mathbf{R}}}e^{-\frac{|\mathbf{Z}_{1}-h(\mathbf{x}_{i,1})|^{2}}{2 \mathbf{R}}}\mathbf{w}_{i,0} \tag{11}\]  
Normalization of weights  
\[\mathbf{w}_{i,1}=\frac{\mathbf{w}_{i,1}}{\sum\mathbf{w}_{i,1}} \tag{12}\]  
Particle resampling  
There is a problem of particle degradation in the application of PF algorithm. That is the weights of most particles change to very small, while only a few particles hold very large weights after several iterations. These particles with very small weights will be replaced by new particles. The independent random samples \(\left\{\mathbf{u}_{n,1}\right\}_{n=1}^{m}\) selected from uniformly distributed are compared with the cumulative sum of normalized weights to select particles [38]. From the point of view of selecting particles, in the \(n\)th (\(n=1,2,\ldots,m\)) selection, if there is a particle \(\mathbf{x}_{i,1}\) that satisfies the conditions of (13) in the cumulative sum of weight values, the selected sample particles will be selected. \[\sum_{j=1}^{i-1}w_{j,1}<u_{n,1}<\sum_{j=1}^{i}w_{j,1},j=1,2,\ldots,i \tag{13}\]  
Finally, the new particle set \(\left\{x_{i,1}\right\}_{i=1}^{m}\) after resampling can be obtained. Optimal state estimate  
From steps (1)\(\sim\)(6), particle \(\mathbf{x}_{i,1}\) at \(k=1\) and the corresponding weights \(\mathbf{w}_{i,1}\) are obtained. Then, the state estimate for \(k=1\) can be calculated by  
\[\hat{\mathbf{X}}_{1}=\sum_{i=1}^{m}\mathbf{w}_{i,1}\mathbf{x}_{i,1} \tag{14}\]  
In the above steps, the optimal estimated value is obtained by PF, and it then progresses to the next iteration. Particle is introduced into the state transition equation to obtain a particle set. Then, weight and weight normalization are obtained by step (4) to obtain the optimal system state estimators for epoch \(k\) (=1, 2, 3,...). When observations contain only accidental errors, the state can be approximated by a large number of particles. However, the UWB positioning accuracy will be polluted seriously while there are NLOS signals. In order to reduce the influence of abnormal observation, the IGG-III model is introduced into PF. The weight of the particle is changed when the observed value contains NLOS by  
\[\tilde{\mathbf{w}}_{i,1}=\mathbf{w}_{i,1}\mathbf{\lambda}_{i} \tag{15}\]  
where \(\mathbf{\lambda}_{i}\) is a weight inflation factor, which can be expressed as  
\[\mathbf{\lambda}_{i}=\left\{ \begin{array}{cc}1&\left|\widetilde{\mathbf{V}}_{i} \right|\leq k_{0}\\ \frac{k_{0}}{|\widetilde{\mathbf{V}}_{i}|}(\frac{k_{1}-|\widetilde{\mathbf{V}}_{i}|}{ k_{1}-k_{0}})^{2}&k_{0}<\left|\widetilde{\mathbf{V}}_{i}\right|\leq k_{1}\\ 0&\left|\widetilde{\mathbf{V}}_{i}\right|>k_{1}\end{array} \right. \tag{16}\]  
where \(\widetilde{\mathbf{V}}_{i}\) is the standardized residual; \(k_{0}\) and \(k_{1}\) are constants, with \(k_{0}=1.0\)\(\sim\)1.5, \(k_{1}=2.5\)\(\sim\)8.0 [39].