## 3 Bias Compensation Estimator for Localization in 3D Space
### BC-WIV Estimator in 3D Space  
To improve the accuracy, the researchers often apply the weighted instrumental variable algorithm by constructing instrumental variable matrix \(\mathbf{G_{wiv}}\) and weighted matrix \(\mathbf{W_{wiv}}\),  
\[\mathbf{G_{wiv}}= \begin{bmatrix}\sin\tilde{\phi}_{1}&-\cos\tilde{\phi}_{1}\\ \vdots&\vdots\\ \sin\tilde{\phi}_{n}&-\cos\tilde{\phi}_{n}\end{bmatrix} ,\mathbf{W_{wiv}}= \begin{bmatrix}||\mathbf{t}-\mathbf{s}_{1}||^{2}&0&0\\ 0&\ddots&0\\ 0&0&||\mathbf{t}-\mathbf{s}_{n}||^{2}\end{bmatrix} , \tag{42}\]  
where \(\tilde{\phi}_{i}\) is calculated from 2D PLE estimator via (8) and  
\[\tilde{\phi}_{i}=\tan^{-1}\bigg{(}\frac{\mathbf{\hat{t}_{ple}}(2)-y_{s_{i}}}{ \mathbf{\hat{t}_{ple}}(1)-x_{s_{i}}}\bigg{)}. \tag{43}\]  
Then the 2D weighted instrumental variable estimator can be expressed as:  
\[\mathbf{\hat{t}_{wiv}}=(\mathbf{G}_{wiv}^{{}^{\prime}}\mathbf{W_{wiv}^{-1}A_{ n}})^{-1}\mathbf{G}_{wiv}^{{}^{\prime}}\mathbf{W_{wiv}^{-1}B_{n}}. \tag{44}\]  
Similarly, the accuracy of bias compensation method in 2D space can be improved by constructing matrix,  
\[\mathbf{G_{bc}}= \begin{bmatrix}\sin\phi_{1}^{\prime}&-\cos\phi_{1}^{\prime} \\ \vdots&\vdots\\ \sin\phi_{n}^{\prime}&-\cos\phi_{n}^{\prime}\end{bmatrix} ,\mathbf{W_{bc}}= \begin{bmatrix}||\mathbf{\hat{t}_{bc}}-\mathbf{s}_{1}||^{2}&0&0\\ 0&\ddots&0\\ 0&0&||\mathbf{\hat{t}_{bc}}-\mathbf{s}_{n}||^{2}\end{bmatrix} , \tag{45}\]  
where  
\[\phi_{i}^{\prime}=\tan^{-1}\bigg{(}\frac{\mathbf{\hat{t}_{bc}}(2)-y_{s_{i}}}{ \mathbf{\hat{t}_{bc}}(1)-x_{s_{i}}}\bigg{)}. \tag{46}\]  
The 2D bias compensation weighted instrumental variable estimator is:  
\[\mathbf{\hat{t}_{bc-wiv}}=(\mathbf{G}_{bc}^{{}^{\prime}}\mathbf{W_{bc}^{-1}A_ {n}})^{-1}\mathbf{G}_{bc}^{{}^{\prime}}\mathbf{W_{bc}^{-1}B_{n}}. \tag{47}\]  
Here  
\[\frac{1}{n}\mathbf{G}_{bc}^{*}\mathbf{W_{bc}^{-1}A_{n}}\approx\frac{\mathbb{E} (\cos e_{i})}{n}\sum_{i=1}^{n} \begin{bmatrix}\frac{\sin^{2}\phi_{i}}{|| \mathbf{\hat{t}_{bc}}-\mathbf{s}_{1}||^{2}}&-\frac{\sin\phi_{i}\cos\phi_{i}}{ ||\mathbf{\hat{t}_{bc}}-\mathbf{s}_{1}||^{2}}\\ -\frac{\sin\phi_{i}\cos\phi_{i}}{||\mathbf{\hat{t}_{bc}}-\mathbf{s}_{1}||^{2}} &\frac{\cos^{2}\phi_{i}}{||\mathbf{\hat{t}_{bc}}-\mathbf{s}_{1}||^{2}}\end{bmatrix} , \tag{48}\]  
\[\frac{1}{n}\mathbf{G}_{bc}^{*}\mathbf{W_{bc}^{-1}B_{n}}\approx\frac{\mathbb{E} (\cos e_{i})}{n}\sum_{i=1}^{n} \begin{bmatrix}\frac{\sin^{2}\phi_{i}x_{s_{i}}- \sin\phi_{i}\cos\phi_{i}y_{s_{i}}}{||\mathbf{\hat{t}_{bc}}-\mathbf{s}_{1}||^{2 }}\\ -\frac{\sin\phi_{i}\cos\phi_{i}x_{s_{i}}+\cos^{2}\phi_{i}y_{s_{i}}}{||\mathbf{ \hat{t}_{bc}}-\mathbf{s}_{1}||^{2}}\end{bmatrix}  \tag{49}\]  
in probability as \(n\to\infty\). Hence \(\mathbf{\hat{t}_{bc-wiv}}\) is an asymptotically unbiased estimator. Its covariance\[\mathbb{E}((\mathbf{\hat{t}_{bc-wiv}}-\mathbf{t})(\mathbf{\hat{t}_{bc-wiv}}- \mathbf{t})^{{}^{\prime}})\] \[\approx\left(\frac{1}{n}\mathbf{G}_{bc}^{{}^{\prime}}\mathbf{W}_{ bc}^{-1}\mathbf{G}_{bc}\right)^{-1}\left(\frac{1}{n^{2}}\mathbf{G}_{bc}^{{}^{ \prime}}\mathbf{W}_{bc}^{-1}\mathbb{E}((\mathbf{B}_{n}-\mathbf{A}_{n}\mathbf{ t})(\mathbf{B}_{n}-\mathbf{A}_{n}\mathbf{t})^{{}^{\prime}})\mathbf{W}_{bc}^{-1} \mathbf{G}_{bc}\right)\left(\frac{1}{n}\mathbf{G}_{bc}^{{}^{\prime}}\mathbf{W}_ {bc}^{-1}\mathbf{G}_{bc}\right)^{-1} \tag{50}\] \[\approx\mathbf{CRLB}\]  
when \(\mathbb{E}(\sin^{2}e_{i})\) is small as \(n\rightarrow\infty\). In z-axis direction, by constructing matrix  
\[\mathbf{G}_{zbc}= \begin{bmatrix}\cos\bar{\theta}_{1}\\ \vdots\\ \cos\bar{\theta}_{n}\end{bmatrix} ,\mathbf{W}_{zbc}= \begin{bmatrix}||\mathbf{ \hat{T}_{bc}}-\mathbf{S}_{1}||^{2}&0&0\\ 0&\ddots&0\\ 0&0&||\mathbf{\hat{T}_{bc}}-\mathbf{S}_{n}||^{2}\end{bmatrix}