Robust Statistical Approaches for RSS-Based Floor Detection in Indoor Localization

Floor detection for indoor 3D localization of mobile devices is currently an important challenge in the wireless world. Many approaches currently exist, but usually the robustness of such approaches is not addressed or investigated. The goal of this paper is to show how to robustify the floor estimation when probabilistic approaches with a low number of parameters are employed. Indeed, such an approach would allow a building-independent estimation and a lower computing power at the mobile side. Four robustified algorithms are to be presented: a robust weighted centroid localization method, a robust linear trilateration method, a robust nonlinear trilateration method, and a robust deconvolution method. The proposed approaches use the received signal strengths (RSS) measured by the Mobile Station (MS) from various heard WiFi access points (APs) and provide an estimate of the vertical position of the MS, which can be used for floor detection. We will show that robustification can indeed increase the performance of the RSS-based floor detection algorithms.


Introduction
Indoor localization is becoming more and more important in today's wireless world. Being able to achieve accurate ubiquitous localization on hand-held battery operating mobile devices in both indoor and outdoor environments would open the window to many new Location Based Services (LBS). Despite the fact that outdoor global localization solutions exist nowadays with the help of Global Navigation Satellite Systems (GNSS), global solutions for indoor localization are still hard to find. Fingerprinting (FP) approaches can solve the indoor localization problem locally [1], but such solutions are expensive and rather computationally expensive to be used on a global scale, meaning over several countries or the entire world. In the fingerprinting-based methods, the location service providers construct a fingerprint database, transfer this database to the mobile station (MS), and the MS then computes its location based on similar fingerprints. The fingerprint databases are typically very large since they do contain received signal strengths (RSSs) coming from various access points (APs) and in many points or coordinates within a building. Thus, if a global localization solution would use a fingerprinting approach, the fingerprint database transferred from the server to the MS would include the fingerprints from all essential buildings in the town (or the location area) where the mobile is situated. For example, assuming that we hear an average of 30 APs in each location point inside a building, that we take measurements from an average of 600 location points per building, that there are 25 important buildings (malls, shopping centers, hospitals, airports, etc.) in the location area where the mobile was identified by the network, then a total of 495, 000 parameters would need to be stored in the database pertaining to that town and transferred to the mobile. The but to be able to guide him/her to their favorite place it must be able to first localize itself. We would mention here that the focus of this work is on the z-axis localization, rather than the three-dimensional (x, y, z) localization. Recently, there has been an increasing interest in estimating the z coordinates due to the fact that finding the correct floor is more important than (x, y) coordinates, as few meters error in estimation of z-coordinates may lead the mobile user to the wrong floor in positioning [6][7][8].
The novelty of our paper is two-fold: first, we present four innovative robustification methods for mobile-based floor detection in wireless positioning, and second, we validate our algorithms through measured and simulated data and show their feasibility in realistic multi-floor scenarios. We point out that the goal of this paper is not to compare different RSS-based localization algorithms (or their robustified counterparts) but rather to show that robustification can improve the performance of each method.
The organization of this paper is as follows: in Section 2 we describe the system model and briefly explain two celebrated methods of indoor localization-namely, the fingerprinting approach and the path-loss approach. The theoretical contribution of the paper is introduced in Section 3, where after describing the M-estimates of regression, we will exploit it to robustify four existing indoor localization approaches. Section 4 is devoted to the performance analysis of the proposed robust localization approaches, based on numerical real-life measurements, and a simulation experiment is provided in Section 5. Finally, we conclude the paper in Section 6.
Notations: Throughout this paper, matrices are denoted by capital boldface letters and vectors and tuples are denoted by small boldface letters. = denotes the equality and denotes the definition. Besides, Table 1 summarizes the most important notations used for denoting quantities used in positioning in this paper.

Quantity Notation
Number of fingerprints N FP Number of Access Points N AP Online 3-D coordinates of MS c (x, y, z) 3-D coordinates of i-th access point The RSS of ap-th AP at n-th fingerprint P n,ap The N AP × 1 measurement vector at n-th fingerprint m n [P n,1 , P n,2 , . . . , P n,N AP ] T The RSS of ap-th AP received by MS in online phase p ap The N AP × 1 measurement vector in online phase m MS [p 1 , p 2 , . . . , p N AP ] T

System Model and Background on Indoor Localization Methods
Consider a localization system equipped with N AP positioning signals (e.g., RSS values received from APs). During the offline phase, the positioning signals are collected in N AP × 1 measurements vectors m i [P i,1 , P i,2 , . . . , P i,N AP ] T , i = 1, . . . , N FP , where N FP is the number of fingerprints collected in the building and P n,ap is the RSS received from access point ap at n-th collected fingerprint. The corresponding known 3-D location of m i is denoted by c i (x i , y i , z i ), i = 1, . . . , N FP . We will use the stored data, D {m i , c i , i = 1, . . . , N FP }, for indoor localization. In the following, we briefly explain two of the famous methods-a nonparametric method and a parametric method-for indoor localization based on the stored data. Then, in Section 3 we will introduce some robust methods for indoor localization.
Assume that a Mobile Station (MS), located at unknown coordinates c = (x, y, z), observes a positioning vector m MS [p 1 , p 2 , . . . , p N AP ] T , where p ap , ap = 1, . . . , N AP is the RSS received from the ap-th AP during the online phase. The basic 1-Nearest Neighbor (1-NN) fingerprinting (FP) approach estimates the location of the MS asĉ and d(·, ·) is a dissimilarity measure which is determined based on our assumption for noise. For instance, if we assume that the noise which deviates the m MS from m i is i.i.d white Gaussian, then d(m MS , m i ) is simply the squared Euclidean distance between m MS and m i ; i.e., In general, the fingerprint-based localization approach is a pattern matching approach [9][10][11] rooted in pattern recognition [12], which tries to match the pattern m MS observed by MS to the examples {m i } N FP i=1 collected in the training data set, and chooses the location of the less-dissimilar example (fingerprint) as the location of the MS. In this regard, each element of the measurements vector m i is a feature of the location c i . On the other hand, any measured signal which depends only on the measurement location (regardless of noise, shadowing, and other uncertainties) can be regarded as a feature of that location and used for localization using the fingerprinting scheme.
The main problem with the fingerprinting approach is the huge amount of data which must be stored by servers and transmitted to the MS to localize itself when N FP is a large number. The situation becomes even more severe when the fingerprints are being collected all the time. If we want to use fingerprinting methods for localizing the mobile device, it can only be done on the server side. Due to the limited processing capability and power supply on most mobile devices, they are not capable of storing and processing that huge amount of data [13]. Furthermore, transmitting such an amount of fingerprinting data from the server to the mobile device takes a lot of time, which makes localization by mobile devices impractical.

Path-Loss Approach for Indoor Localization
To cope with this problem, a well-known alternative is to use the so-called parametric approaches for indoor localization. In parametric approaches, we use a parametric model for finding the MS location. The parameters of the model are then estimated based on the training data (fingerprinting data) and the MS only stores these parameters and uses them for localization by applying them to the online received positioning vector. In the following, we briefly describe a parametric approach for indoor localization based on the path-loss model.
Any RSS-based localization and floor detection method includes two stages: a training stage and an estimation stage. In the training stage-done either in a dedicated/manual mode or in a crowdsource mode-the data is collected building by building, and the following observations are stored on a server database: D = {(x i , y i , z i ), P i,ap , i = 1, . . . , N FP , ap = 1, . . . , N AP }, where (x i , y i , z i ), i = 1, . . . , N FP are the 3D coordinates where the measurements were taken within a certain building, N FP is the total number of fingerprints measured in a building, N AP is the total number of AP per building, and P i,ap , i = 1, . . . , N FP , ap = 1, . . . , N AP is the measured RSS for the i-th fingerprint, coming from the ap-th access point.
In the path-loss approach for the localization (one of the main parametric approaches for localization), the target is to extract a sub-set S of relevant information starting from the available database D. The steps are as follows: (1) Estimate the unknown AP locations (if there is a known AP location, this can replace the estimated ones). The estimation can be done either via averaging over the positions of a few of the strongest fingerprints (i.e., where that AP was heard with strongest power) or via the use of a weighted approach, such as the one presented in [14], or by applying a two-step deconvolution process, as described in [5]. Our studies showed that the weighted approach gives slightly better results than the other two; thus, it will be selected in our analysis. Since AP location is done in 3D plane, after this step, there will be three parameters to be stored per AP regarding AP position.
(2) Associate an underlying path-loss model with the measured RSS and estimate the model parameters via certain statistical methods. In our paper, we will discuss two path-loss models: the classical slope-based path-loss model [5] with two additional parameters per AP (transmit power and slope coefficients), and a new simplified path-loss model which focuses on the z-dimension only and has only one parameter. Thus, the number of extracted parameters per AP is five or six, according to the underlying path-loss model.
The traditional path-loss model is based on free space wave propagation [15], and involves two modeling parameters per AP: Θ AP = [P T ap n ap ], where P T ap is the ap-th AP transmit power and n ap is the path-loss coefficient of the ap-th AP. Those two parameters are related to the RSS via: where P T ap is the ap-th AP transmit power and n ap is the path-loss coefficient of the ap-th AP, and η i,ap is a noise factor, typically assumed Gaussian distributed, of zero mean and standard deviation σ. The noise is typically due to shadowing, fading, and measurement errors: is the Euclidean distance between the ap-th AP and the i-th measurement point. The above model can be re-written in matrix form as: where P ap [P 1,ap P 2,ap . . . P N FP ,ap ] is the vector with power fingerprints in logarithmic scale coming from the ap-th access point, is the transpose operator, n is a Gaussian distributed N FP × 1 vector with elements η i,ap and

Memory Complexity of Model-Based Approaches Versus Fingerprinting Approach
We live in the era of Big Data and the need for algorithms which can cope with the huge volume of data and extract insight from it has been a major challenge in almost all data science areas, including wireless localization, for the past few years and will remain a challenge for a foreseeable future. While distributed and cloud-based algorithms remain a clear candidate in many cases, there are scenarios, like what we have here for indoor localization, that the technical limitations (here, the fact that a mobile device should perform the localization task in real-time and cheaply, and therefore cannot get help from other nearby devices or use cloud services).
To address the memory complexity issue we provide a brief comparison between the complexity of fingerprinting approach and model-based approaches in terms of the memory size required for performing localization in the mobile side. In fingerprinting approach the size of data we need to store in the mobile device is proportional to N f p × N ap as we need to store all fingerprinting vectors which are of size N ap . However in model-based methods (such as the ones proposed in this paper and also in their original non-robust counterparts) the size of data that we need to keep is just proportional to the number of APs, i.e. N ap . For example in the above-mentioned path-loss approach we need to store 5N ap parameters, i.e., the 3 coordinates of each AP plus their transmit power and their associated path-loss exponents. In Weighted Centroid Localization [3,14,16,17] approach, as well as its robust version which will be introduced in the next section, we only need to store the 3 coordinates of each AP which means a total of 3N ap parameters. This is a significant reduction in the size of data as usually N f p can be a huge number but N ap is limited by the hardware cost employed in the building for internet coverage which is typically tens to hundreds maximum.
We remark that all the robust approaches introduced in this paper have the same memory complexity as of their non-robust counterparts and do not increase the size of the data needed to store in the mobile side.

Robust Floor Estimation Algorithms
In this section, we introduce four robust floor estimation algorithms. We first review the M-estimates of regression-a method for robust estimation of parameters in a linear regression problem-and then, based on that, robustify four existing indoor localization algorithms for floor estimation.
Consider the linear regression problem where H is the matrix of regressors (for example matrix H ap in Equation (5)), y is the n × 1 noisy observation vector, x denotes the k × 1 parameter vector for which we are going to find an estimate, and ε denotes the error vector whose entries are assumed to be i.i.d. from a symmetric continuous distribution with an unknown scale parameter s. Let e i = e i (x) = y i − h i x denote the i-th residual for a candidate vector x, where y i is the i-th entry of y, and h i is the i-th row of matrix H. At this point, assume that the scale parameters are known. The ordinary least-squares (LS) tries to minimize ∑ i e 2 i , which yields an unstable solution in the presence of outliers or heavy-tailed noise. The M-estimators reduce the effect of outliers and heavy-tailed noise by replacing the sum of squared residuals by the following objective function where ρ(·) is a symmetric, convex, positive-definite function; see, e.g., the upper plot in Figure 1. Let ψ = ρ ′ be the derivative of ρ. Then, the minimizer of Equation (8) is the solution to the following equation Defining w(e i ) ≜ ψ(e i )/e i and denoting w i ≜ w(e i /s), Equation (9) can be re-written as Since w i is iteself a function of e i , to solve Equation (10) we use an iterative algorithm called iterative re-weighted least squares (IRLS) [18,19], where in each iteration t an estimatex {t} is computed from Equation(10) by assuming that w i is constant, then the residuals and weights are updated based onx {t} , which will be used in the next iteration for solving Equation (10) and finding the new estimatê x {t+1} . This iteration continues until a stopping criterion is satisfied. Since the scale s is unknown in practice, it is commonly replaced at each iteration by a robust estimateŝ calculated from the current residuals. A commonly-used estimator for scale is the median absolute deviation (MAD) s = MAD(e) = 1.4286 · median i (|e i − median i (e i )|), which is the default choice in the robustfit Let ψ = ρ be the derivative of ρ. Then, the minimizer of Equation (8) is the solution to the following equation Defining w(e i ) ψ(e i )/e i and denoting w i w(e i /s), Equation (9) can be re-written as Since w i is iteself a function of e i , to solve Equation (10) we use an iterative algorithm called iterative re-weighted least squares (IRLS) [18,19], where in each iteration t an estimatex {t} is computed from Equation(10) by assuming that w i is constant, then the residuals and weights are updated based onx {t} , which will be used in the next iteration for solving Equation (10) and finding the new estimatê x {t+1} . This iteration continues until a stopping criterion is satisfied. Since the scale s is unknown in practice, it is commonly replaced at each iteration by a robust estimateŝ calculated from the current residuals. A commonly-used estimator for scale is the median absolute deviation (MAD) s = MAD(e) = 1.4286 · median i (|e i − median i (e i )|), which is the default choice in the robustfit routine of Matlab. From now on, we denote this iterative robust solution to the regression problem of Equation (7) as robustfit(H, y) Choosing the weight function w(·), or equivalently ψ(·) and ρ(·), plays an important role here. In fact, the function ρ can be interpreted as − log f e (e/s), which means that if the error term has distribution f e , then the IRLS estimate coincides with the maximum likelihood (ML) estimate. In practice, we do not know the error distribution and we choose the weight function so as to alleviate the effect of large errors stemming from impulsive or heavy-tailed noise. This is accomplished by choosing bounded ψ(·) functions. Function ψ(·), sometimes called the influence function [20], determines the influence of a datum on the estimate. For example, in the LS case when ψ(e) = e, this influence is linear, which results in the non-robustness of the LS solution. On the other hand, by choosing a bounded ψ, the influence of large errors stemming from outliers or heavy-tailed noise is bounded, which results in the robustness of the estimate. Some commonly-used robust functions which will be used later in this paper for robustification of localization approaches are presented in Table 2 and Figure 1. As can be seen from Figure 1, all three robust influence functions are bounded. The constant k is called the tuning constant, which trades between the robustness and the efficiency when the noise is Gaussian; smaller values of k provide more robustness but are less efficient when the noise is normally distributed [2]. Table 2. Functions ρ(e), ψ(e), and w(e) for ordinary least-squares (LS), and three commonly-used robust functions. In followings, we show concrete examples of how these robustification functions can be applied to solve the 3D indoor localization problem.

Robust Weighted Centroid Localization
The weighted centroid localization (WCL) approach, first proposed for position estimation in wireless sensor networks [3], is a simple and low-complexity but promising localization approach. The position of the MS in the WCL approach is computed as the weighted average of the positions of APs heard by the MS. Denoting the set of all hearable APs by H and the (known) coordinates of APs by c ap (x ap , y ap , z ap ), ap = 1, . . . , |H|, the WCL-based estimate of mobile station coordinates is computed asĉ WCL = ∑ ap∈H w ap c ap ∑ ap∈H w ap (12) where w ap are weight functions. To weight shorter distances (nearer APs) more than higher distances, w ap may be chosen as [3] w ap = 1/(d ap ) g where d ap is the distance between the ap-th AP and the MS, and degree g is to ensure that remote APs still impact the position estimation [3].
Since d ap are not readily available, and also since RSS heard from AP ap is inversely proportional to d ap , the weights w ap in Equation (12) can be replaced by RSS to obtain the following RSS-based formula for WCL [14,16,17]ĉ WCL = ∑ ap∈H p ap c ap ∑ ap∈H p ap (14) where p ap is the measured RSS of AP number ap. Equation (14) can be written independently for each coordinate. For instance, for the height coordinate (which is the coordinate that matters in the floor detection task), we havê To robustify the WCL approach, we first remark that Equation (15) can be written aŝ where e ap (z) √ p ap (z − z ap ).
The robust WCL is then obtained by replacing |e ap (z)| 2 in the right-hand side of Equation (16) by the general cost function ρ(e ap (z)/s), which yieldŝ where s is the scale parameter, which can be estimated as discussed in the previous section.

Implications of the Weighted Centroid Localization Approach
Before proceeding with the next section, we investigate some implications arising from the WCL approach, which will ease the understanding of our assumptions in the next section. We first remark that Equation (16), and hence Equation (15), is the maximum likelihood solution of the following set of |H| equations √ p ap z ap = √ p ap z + q ap , ∀ap ∈ H (18) for finding z, where q ap is a zero-mean Gaussian random variable with identical variance for all ap ∈ H. Equation (18) in fact implies that, according to the WCL approach, the relationship between the received power p ap and the vertical distance between the MS and the ap-th access point, d z,ap |z − z ap |, complies with the following formula: Now, it is easy to verify that the linear scale Equation (19) will coincide with the noise-free logarithmic scale path-loss model of Equation (4) if 1. Path loss exponent in Equation (4) has the value n ap = 2, ∀ap ∈ H, which is the typical path-loss exponent of free space. 2. P i,ap in Equation (4) relates to p ap as P i,ap = 10 log p ap . 3. P T ap in Equation (4) relates to random variable q ap as P T ap = 10 log |q ap | 2 . This means that |q ap | 2 represents the transmit power of the ap-th AP that is considered as a nuisance parameter here, whose value is not of interest. 4. The distance d i,ap in Equation (4) represents the distance along the z-coordinate.
In other words, WCL model Equation (14) can be regarded as a coarse approximation of path-loss model Equation (4) when the four above assumptions are adopted. In fact, the beauty of the WCL approach is that despite its apparent simplicity and it being a coarse approximation of the channel model (which makes it appealing for use in mobile computing devices) its performance is very promising.

Robust Nonlinear Joint Parameter Estimation and Trilateration
Let us denote the location of MS by (x, y, z). Taking into account the discussion from the previous section, we now start from the assumption that the vertical distance between MS and each AP is proportional to the inverse of the square-root of received power, which is This model is in line with the observation made in the previous section and Equation (19), where c = |q ap | is assumed to be the square root of the identical transmit power of APs.
The task is then to estimate c and z by minimizing the following function Employing the Gauss-Newton method, we obtain the following iterative formula for finding the minimizer of Equation (21)θ where subscript {k} denotes the value in k-th iteration, θ [z, c] T , and To robustify this algorithm, we notice that the second term in the right hand side of Equation (23) can be interpreted as the LS solution to the regression equation for finding ∆θ. Therefore, to robustify Equation (23), we can simply replace this term with the IRLS solution of Equation (26) to get the following formula for the robust joint estimation of z and c: The method can be easily extended to a trilateration case, where all three coordinates (x, y, z) are assumed to affect the received RSS. Although a more realistic assumption, it deteriorates the floor detection results in practice, because of the introduction of the errors along the nuisance directions x and y to the problem.

Robust Linear Joint Parameter Estimation and Multilateraion
Let us denote the location of MS by (x, y, z), the coordinates of the i-th AP by (x i , y i , z i ), the distance of MS to the i-th AP by r i , and the distance between the i-th and j-th APs by d ij . Then, it can be easily verified that the set of the following N ap − 1 equations are satisfied [4].
Assuming that r i = c √ p i , i = 1, . . . , N ap , this can be rewritten in matrix form as and Then, the LS solution for joint location estimation and parameter estimation will bê Now, the robust linear trilateration approach can be obtained by replacing the LS solution by the IRLS solution:x The above robust method can be simplified for estimating the vertical position by removing the first two columns of G as well as the first two rows of x and then solving the robust estimation problem in Equation (34).

Robust Deconvolution-Based Path-Loss Estimator
In this section, we show how to robustify the deconvolution-based path-loss parameter estimator [5] by employing the IRLS estimator [18,19]. The deconvolution-based approach consists of two main stages: an offline stage, during which we estimate the AP parameters, and an online stage in which we estimate the MS position. We robustify the algorithm by replacing the ordinary LS approach employed in the offline stage (see [5], Section 3) by the IRLS estimator described earlier.
where H i is the matrix built from the AP parameters as in Equation (11) [5], and P ap [P 1,ap , P 2,ap , . . . , P N f ,ap ] T is the vector whose n-th entry P n,ap is the received power of access point ap at fingerprint n.

Measurement-Based Results
In this section, we study the performance of the proposed algorithms through some real-life numerical examples.

Measurement Set-up
The experimental testbed is set-up in four different buildings in our city: University Building 1 (UBldg1), which is a four-storey building inside the university campus; University Building 2 (UBldg2), which is a three-storey building inside the university campus; a six-storey Mall; and a Shopping center (ShCtr), which is a three-storey building. The RSS data collection in each building is accomplished along several tracks (each including tens to hundreds of measurement points) and the probability of floor detection results are computed by averaging the results over all tracks in each building.
The device employed for collecting the data is an Acer windows tablet with proprietary software to collect the RSS data, which is pictured in Figure 2. The software records the RSS as well as the coordinates by pressing the location point in the building map. The measurement points in the first floor of Ubldg1 have been shown in Figure 3. To give an idea of the building structure, a picture taken from the second floor of Ubldg1 has been demonstrated in Figure 4.

Numerical Results
The following three examples study the performance of the robust weighted centroid approach, robust deconvolution-based approach, and robust nonlinear trilateration approach, respectively.
Example 1-Robust weighted centroid localization with real data: The first example studies the performance of ordinary WCL and robust WCL approaches with four different robust methods: Huber with parameter k = 1.345 (Hub1), Huber with parameter k = 0.9 (Hub2), Bi-square with parameter k = 4.685 (Bsq), and Cauchy with parameter k = 2.385 (Cau). The results are shown in Table 3. As can be observed, the robust approaches show improvement over the ordinary WCL approach, regardless of the chosen weighting function. Table 3. Comparison of the floor detection probability for different Weighted Centroid Localization (WCL) approaches. Column 2 shows the basic approach, columns 3 to 6 are the robust WCL approach with various robust functions: Hub1 (Huber with tuning coefficient k = 1.345), Hub2 (Huber with tuning coefficient k = 0.9), Bsq (Bi-square with tuning coefficient k = 4.685), and Cau (Cauchy with k = 2.385). The highest probability in each row has been shown in Bold. All of the robust methods outperform the ordinary WCL. Example 2-Robust deconvolution-based approach with real data: The second example studies the performance of the robust deconvolution-based approach compared to the other deconvolution-based approaches when the estimator employed for parameter vector estimation is least-squares (LS), minimum mean-squared error (MMSE), or weighted least-squares (WLS). The robust function used here is Hub1. The data used here is the same as in the previous example. The results are shown in Table 4. As can be observed, the robust approach outperforms the other deconvolution-based approaches for all the considered buildings. The only building in which the robust approach is inferior to the others is the Mall, in which all detection methods have rather low detection probabilities.

Building
Example 3-Robust nonlinear trilateration with real data: The goal of the third experiment is to study the nonlinear trilateration approach. The data used here is the same as in the previous examples. The deconvolution-based approach has been used for the estimation of AP positions (we use only the z-coordinate). We employed the ordinary nonlinear trilateration approach [4], as well as its robust version that we introduced here. The results are shown in Table 5. Again, the results show that robustification has improved the performance. Furthermore, comparison between the second and third columns of the table illustrates how the tuning coefficient affects the performance of the estimator for a given robust weight function. As can be seen, decreasing the value of the tuning coefficient implies more robustification.
Concluding remarks of the experimental tests: The results of the three real-life experiments studied in this section demonstrate the ability of the robust methods to improve the performance of localization algorithms used for floor detection in indoor environments. For instance, comparing Hub1 with the ordinary methods in Tables 3-5 shows improvement everywhere other than the Mall building for the deconvolution-based method. This is because the Mall building studied in this experiment has a very spacious middle area and therefore can better comply with the Gaussianity assumption in path-loss model, which is the core of the deconvolution-based algorithm.

Simulation Example
In this section, we study the performance of the proposed robust linear trilateration approach compared to the ordinary linear trilateration [4] through a simulation example. We remark that for the evaluation of this method, we use simulation instead of real data because the linear trilateration is very sensitive to the coordinates of the AP chosen as the reference point, due to the fact that all the distances are determined with respect to this reference point (see, e.g., Equations (28) and (30), where all distances are with respect to AP number 1). In the real data used for the first three experiments, we do not have the exact coordinate of any of the APs to choose it as the reference point. Therefore, the linear trilateration methods are here examined through a simulation example in which the exact location of the APs is assumed known. The number of access points with known locations in the simulation is N ap = 80, which are located in a four-story building with 20 APs in each floor. The area of each floor is 50 m × 50 m, and the floor height is 4 m. All the APs have the same transmit power and the path-loss exponent is set to n ap = 2, ∀ap. The receiver noise variance varies from 0 to 1. The number of random runs (the random location of MS in the building) is 10 5 . The floor detection is performed by first estimating the 3-D coordinates of the MS as in Equation (34) and then rounding the estimated z-coordinate to the height of the nearest floor. As can be seen, the robust methods surpass the ordinary LS method. The best performance belongs to Hub2, the Huber robust function with tuning constant k = 0.9, which provides more robustness compared to the case k = 1.345.

Conclusions
In this paper, we proposed four robustification methods for floor detection on mobile devices. This was accomplished by exploiting the M-estimators to robustify four existing probabilistic positioning approaches with the goal of applying them to the problem of floor detection from RSS measurements in an indoor environment. The first approach was obtained by robustifying the weighted centroid localization approach by replacing the ordinary sum of squared errors by a more general cost function. The second and third approaches were, respectively, a linear and a nonlinear trilateration approach that first adopt a simplified path-loss model and then estimate the position of MS using robust regression methods. The methods need the information of AP locations as a prerequisite. We finally robustified the deconvolution-based approach [5] via replacing the ordinary least-squares estimator by an iterative reweighted least-squares estimator.
The performance of the proposed robust schemes were exemplified both via real-life measurements (Examples 1 to 3 in Section 4.2) and simulations ( Figure 5), and all of the proposed robust methods were compared with their non-robust counterparts. In addition, such robust schemes can find their applicability in many LBS applications, such as in emergency applications (e.g., the fast identification of the damaged floors in case of flood or fire), in advertising (e.g., fast finding of the nearby shops at the user's floor with the desired items), etc. In addition, the proposed robustification results can be used jointly with additional sensors, such as barometers, when available on the user's mobile for increased positioning accuracy. The main findings of our paper is that, by using robustification, we can achieve better results than without robustification. The proposed mobile computing-based floor detection algorithms, which use the heard RSS information from APs, are indeed feasible with today's existing WLAN infrastructures.