## 3 Three-step WLS Localization Algorithm for Hybrid Positioning  
In this section, a three steps WLS localization algorithm is proposed for positioning based on TDOA and TOA measurements shown in Section 2. The algorithm is an improvement of the two-step WLS TDOA-only localization algorithm, called the Chan-Ho algorithm, in Reference [17]. Those two algorithms use the same linearization method, and the third step WLS of the proposed algorithm is the same as the second step WLS of the Chan-Ho algorithm. Using the following method, a linear equation about TDOA measurement and \(x\), \(y\) coordination could be obtained. Moving the \(r_{1}\) from the right side of Equation (2) to the left side and then squaring both sides, we obtain:  
\[r_{i}{}^{2}=(r_{1}-r_{i,1})^{2}. \tag{6}\]  
Expanding (6) we obtain:  
\[x_{i,1}x+y_{i,1}y+r_{i,1}r_{1}=\frac{1}{2}\Big{(}K_{1}-K_{i}+r_{i,1}^{2}\Big{)} \tag{7}\]where:  
\[ \begin{array}{ll}x_{i,1}=(x_{1}-x_{i}),&i=2,3,\ldots,M\\ y_{i,1}=(y_{1}-y_{i}),&i=2,3,\ldots,M\\ K_{i}=x_{i}^{2}+y_{i}^{2},&i=1,2,3,\ldots,M.\end{array}  \tag{8}\]  
Different to the Chan-Ho algorithm, the proposed algorithm needs to consider the TOA measurement and uses a new solution as follows. Using Equation (8), write Equation (5) in matrix form as:  
\[Gw+\varphi=h \tag{9}\]  
where:  
\[ \begin{array}{l}G=\left[\begin{array}{ccc}0&0&1\\ x_{2,1}&y_{2,1}&d_{2,1}\\ x_{3,1}&y_{3,1}&d_{3,1}\\ \vdots&\vdots&\vdots\\ x_{M,1}&y_{M,1}&d_{M,1}\end{array}\right],\ w=\left[\begin{array}{c}x\\ y\\ r_{1}\end{array}\right],\\ h=\left[\begin{array}{c}d_{1}\\ \frac{1}{2}\Big{[}K_{1}-K_{2}+d_{2,1}{}^{2}\Big{]}\\ \frac{1}{2}\Big{[}K_{1}-K_{3}+d_{3,1}{}^{2}\Big{]}\\ \vdots\\ \frac{1}{2}\Big{[}K_{1}-K_{M}+d_{M,1}{}^{2}\Big{]}\end{array}\right],\ \varphi=\left[\begin{array}{c}\varphi_{1}\\ \varphi_{2}\\ \varphi_{3}\\ \vdots\\ \varphi_{M}\end{array}\right].\end{array}  \tag{10}\]  
The vector \(\varphi\) is the error between \(h\) and \(Gw\). It can be obtained by:  
\[\varphi=h-Gw \tag{11}\]  
In accordance with Equations (3) and (4), the items in vector \(\varphi\) can be written as the following expressions:  
\[\varphi_{1}=d_{1}-r_{1}=e_{1} \tag{12}\]  
\[\varphi_{i}=\frac{1}{2}\Big{[}K_{1}-K_{i}+(d_{i,1}-e_{i})^{2}\Big{]}-x_{i,1}x -y_{i,1}y-(d_{i,1}-e_{i})r_{1}=\frac{1}{2}e_{i}^{2}-d_{i,1}e_{i}-r_{1}e_{i} \tag{13}\]  
where the assumption \(r_{i}\gg e_{i}\) has been used. To minimize \(\varphi^{T}\varphi\), the hybrid positioning problem is cast as the following quadratic optimization  
\[\min_{w}(h-Gw)^{T}(h-Gw) \tag{14}\]  
Ranging errors of TDOAs can be assumed as an independent, identical and zero-mean Gaussian distribution [31]. The ranging error of TOA can also be assumed to be a zero-mean Gaussian distribution [32]. Because TDOA and TOA measurements are estimated using different techniques, TOA and TDOA ranging errors can be assumed to be independent and have different variances. The parameter \(k\) is used to represent the ratio of TOA ranging error's standard deviation to TDOA ranging error's standard deviation. The ranging errors have the following statistical properties:  
\[ \begin{array}{l}E(e_{i})=0,\ \ i=1,2,3,\ldots,M\\ Cov\big{(}e_{i}e_{j}\big{)}=0,\ \ i\
eq j\ and\ i,j=1,2,3,\ldots,M\\ Var(e_{i})=\sigma_{lda\sigma}^{2},\ \ i=2,3,\ldots,M\\ Var(e_{1})=\sigma_{tba}^{2}=k^{2}\sigma_{tda\sigma}^{2},\ \ \ k=\frac{\sigma_{tba}}{\sigma_{tba}}.\end{array}  \tag{15}\]  
The errors in \(\varphi\) do not meet the Gauss-Markov assumption, ordinary least squares estimator is not the best linear unbiased estimator (BLUE) for this optimization problem. WLS could make it BLUEwhen each weight is equal to the reciprocal of the variance of the error [33]. The WLS solution of \(w\) that minimizes \(\varphi^{T}W\varphi\) is:  
\[w=\left(G^{T}WG\right)^{-1}G^{T}Wh \tag{16}\]  
where \(W\) is the weighting matrix which could be given by the covariance matrix of \(\varphi\). The covariance matrix of \(\varphi\) is:  
\[