## 3 LoMoB Localization Scheme
### Location Estimation
#### 3.3.2 Estimating the Location of a Sensor Node Using the Weighted Mean  
The location of a sensor node can be estimated using all the potential locations. The location of a sensor node can simply be estimated as the mean of all the potential locations. However, to improve the estimation accuracy, a weighted mean of the potential locations can be used instead. Here, the weight is determined based on a residual, which we define here. Given \(\hat{x}\) as a solution of \(x\) at \(f(x)=b\), the residual is \(b-f(\hat{x})\), which indicates how far \(f(\hat{x})\) is from the correct value of \(b\), and the error is \(\hat{x}-x\). As we do not know \(x\), we cannot compute the error, but we can compute the residual. From Equation (2), \(N\) residuals associated with the potential location \(P_{jk}(\hat{x}_{jk},\hat{y}_{jk})\) can be computed as follows:  
\[ \begin{cases}\hat{\varepsilon}_{jk}(1)=\left|\sqrt{(\hat{x}_{jk}-x^{\prime}_{1 })^{2}+(\hat{y}_{jk}-y^{\prime}_{1})^{2}}-r^{\prime}_{1}\right|\\ \hat{\varepsilon}_{jk}(2)=\left|\sqrt{(\hat{x}_{jk}-x^{\prime}_{2})^{2}+(\hat {y}_{jk}-y^{\prime}_{2})^{2}}-r^{\prime}_{2}\right|\\ \vdots\\ \hat{\varepsilon}_{jk}(N)=\left|\sqrt{(\hat{x}_{jk}-x^{\prime}_{N})^{2}+(\hat {y}_{jk}-y^{\prime}_{N})^{2}}-r^{\prime}_{N}\right|\end{cases}  \tag{4}\]  
Because the accuracy of a potential location is expected to be inversely proportional to the sum of the residuals, the reciprocal of the sum of the residuals represents a weighting factor. The weight for the potential location \(P_{jk}(\hat{x}_{jk},\hat{y}_{jk})\) is defined as follows:  
\[w_{jk}=\frac{1}{\sum\limits_{i=1}^{N}\hat{\varepsilon}_{jk}(i)} \tag{5}\]  
Finally, the location of a sensor node is estimated as the weighted mean of all the potential locations. \[(\hat{x},\hat{y})=\frac{\sum\limits_{j=1}^{N-1}\sum\limits_{k=j+1}^{N}w_{jk} (\hat{x}_{jk},\hat{y}_{jk})}{\sum\limits_{j=1}^{N-1}\sum\limits_{k=j+1}^{N}w_ {jk}} \tag{6}\]  
Less than three beacon points may be acquired for some sensor nodes in certain circumstances. In this case, because the location of a sensor node cannot be estimated through Equation (6), another approach is needed. When just two beacon points \(BP^{\prime}_{1}\) and \(BP^{\prime}_{2}\) are acquired for a sensor node, the intersection points \(C_{12}(1)\) and \(C_{12}(2)\) of two circles with centers \(BP^{\prime}_{1}\) and \(BP^{\prime}_{2}\) and radii \(r^{\prime}_{1}\) and \(r^{\prime}_{2}\) are obtained. Because there are no other beacon points available to the decision-making process, the neighboring sensor nodes can play the role of an additional beacon point in order to estimate the sensor location. The sensor node can receive the location information of neighboring sensor nodes by sending a request to the neighboring sensor nodes that know their location after localization. The sensor node just knows that the neighboring sensor nodes are within the communication range without the distance information between the sensor node and the neighboring sensor nodes. If one of the intersection points is close to the sensor node, more sensor nodes among neighboring sensor nodes of the sensor node are expected to be within the communication range of the intersection point, compared to the other intersection point. By comparing the number of neighboring sensor nodes of the sensor node within the communication range for each intersection point, one of the two intersection points that has more neighboring sensor nodes of the sensor node is estimated as the location of the sensor node. When a sensor node has less than two beacon points, the estimated locations of the neighboring sensor nodes can be used. In this case, the location of the sensor node is estimated as the midpoint of all the neighboring sensor nodes. It is noteworthy that the main feature of LoMoB that can improve LDB is the use of the weighted mean of all the potential locations.