# Hybrid TOA/RSS Range-Based Localization with Self-Calibration in Asynchronous Wireless Networks
## 3 Proposed Localization Algorithm with Self-Calibration
### TOA/RSS Parameters Estimation Using Self-Calibration
By posing \(\tilde{\mathbf{t}}_{a}=\mathbf{t}_{a}-\mathbf{q}\), it follows that the likelihood function associated with the anchor-to-anchor TOA measurements can be expressed as:  
\[\ell(\tilde{\mathbf{t}}_{a};\mathbf{\theta}_{a},\sigma_{t}^{2})=\frac{1}{(2\pi\sigma_{ t}^{2})^{\frac{N(N-1)}{2}}}\mathrm{e}^{-\frac{1}{2\sigma_{t}^{2}}\|\tilde{\mathbf{t}}_{a }-\mathbf{Q}\mathbf{\theta}_{a}\|^{2}}. \tag{14}\]  
It is a simple matter to show that the ML estimate of \(\sigma_{t}^{2}\) is given by:  
\[\vartheta_{t}^{2}=\min_{\mathbf{\theta}_{a}}\frac{\|\tilde{\mathbf{t}}_{a}-\mathbf{Q}\bm {\theta}_{a}\|^{2}}{N(N-1)}=\frac{\tilde{\mathbf{t}}_{a}^{\top}\mathbf{P}_{\mathbf{Q}}^{ \perp}\tilde{\mathbf{t}}_{a}}{N(N-1)}, \tag{15}\]  
where \(\mathbf{P}_{\mathbf{Q}}^{\perp}\) is the (orthogonal) projection matrix onto the orthogonal complement of the space spanned by the columns of \(\mathbf{Q}\). At this point, it should be noticed that the ML estimate of \(\mathbf{\theta}_{a}\) (namely the minimizer for \(\mathbf{\theta}_{a}\) in the previous formula) can be uniquely determined only when \(\mathbf{Q}\) is a full-rank matrix. From the definition in Equation (13), it is not difficult to see that \(\mathbf{Q}\) has rank \(N-1\); therefore, we can estimate \(\mathbf{\theta}_{a}\) using a Least Squares (LS) approach as:  
\[\hat{\mathbf{\theta}}_{a}=\mathbf{Q}^{\dagger}\tilde{\mathbf{t}}_{a}+\tau\mathbf{1}_{N}, \tag{16}\]  
where \(\tau\in\mathbb{R}\), \(\mathbf{Q}^{\dagger}\) denotes the Moore-Penrose generalized inverse of \(\mathbf{Q}\), and \(\mathbf{1}_{N}\) represents the \(N\)-dimensional vector of ones. The RSS model parameters can be estimated following the same procedure described in [14], where it is shown that ML estimation of the unknown vector \(\mathbf{\beta}\) reduces to a simple linear regression. More precisely, we start by observing that the vector \(\mathbf{r}_{a}\in\mathbb{R}^{N(N-1)\times 1}\) of RSS measurements among the anchors can be written as:  
\[\mathbf{r}_{a}=\mathbf{H}\mathbf{\beta}_{a}+\mathbf{n}_{a} \tag{17}\]  
where \(\mathbf{\beta}_{a}=[P_{0}\ \alpha]^{T}\) and \(\mathbf{n}_{a}\) denotes the \(N\times(N-1)\) vector of shadowing effects defined as:  
\[\mathbf{n}_{a}=[n_{1,2}\ \cdots\ n_{1,N}\ \cdots\ n_{N,1}\ \cdots\ n_{N,N-1}]^{T}. \tag{18}\]  
Similarly to the TOA model, \(\mathbf{n}_{a}\sim\mathcal{N}(\mathbf{0}_{N(N-1),1},\sigma_{t}^{2}\mathbf{I}_{N(N-1)})\) is a Gaussian random vector independent of the \(n_{i,b}\)s. Moreover, we observe that \(\mathbf{H}=[\mathbf{1}_{N(N-1)}\ \mathbf{v}]\in\mathbb{R}^{N(N-1)\times 2}\) is a known matrix with:  
\[\mathbf{v}= \begin{bmatrix}-10\log_{10}\|x_{1}-\mathbf{x}_{2}\|\\ \vdots\\ -10\log_{10}\|\mathbf{x}_{1}-\mathbf{x}_{N}\|\\ \vdots\\ -10\log_{10}\|\mathbf{x}_{N}-\mathbf{x}_{1}\|\\ \vdots\\ -10\log_{10}\|\mathbf{x}_{N}-\mathbf{x}_{N-1}\|\end{bmatrix} \in\mathbb{R}^{N(N-1) \times 1}. \tag{19}\]  
The likelihood function associated with the anchor-to-anchor RSS measurements can be expressed as:  
\[\ell(\mathbf{r}_{a};\mathbf{\beta}_{a},\sigma_{t}^{2})=\frac{1}{(2\pi\sigma_{t}^{2})^{ \frac{N(N-1)}{2}}}\mathrm{e}^{-\frac{1}{2\sigma_{t}^{2}}\|\mathbf{r}_{a}-\mathbf{H}\bm {\beta}_{a}\|^{2}}. \tag{20}\]  
As it can be noticed, Equation (20) has the same structure of the likelihood in Equation (14); hence, the ML estimate of \(\sigma_{t}^{2}\) can be easily computed by considering Equation (15) with \(\tilde{\mathbf{t}}_{a}\) and \(\mathbf{Q}\) replaced by \(\mathbf{r}_{a}\) and \(\mathbf{H}\), respectively.