55
WIRELESS POSITIONING USING ELLIPSOIDAL CONSTRAINTS Giovanni Soldi Lund University

Wireless Positioning using Ellipsoidal Constraints

Embed Size (px)

DESCRIPTION

This master's thesis presents a new approach for indoor positioning, based on the notion of separating ellipsoids. In order to improve the position estimation algorithm, the technique is combined with the algorithm A*, being applied to binary maps of the examined buildings to take into account obstacles such as walls. The combination of separating ellipsoids and A seems to promise an improvement over previous algorithms based on a probabilistic approaches.

Citation preview

Page 1: Wireless Positioning using Ellipsoidal Constraints

WIRELESS POSITIONINGUSING ELLIPSOIDAL

CONSTRAINTS

Giovanni Soldi

Lund University

Page 2: Wireless Positioning using Ellipsoidal Constraints

i

Acknowledgements

First, I would like to thank my supervisor at the department of Mathematical Statis-tics at Lund University, professor Andreas Jakobsson, for his continuous supportand commitment throughout this master’s thesis. Furthermore, I am really gratefulto Qubulus AB for providing me with the data and for giving me the opportunityof a three-month internship.

I would like to thank also my supervisor in Milano, professor Marco Trubian, andmy Erasmus coordinator, professor Kevin Payne, for his help with all the bureau-cratic issues. Special thanks go to all my international friends that I have knownduring these ten months and made my stay in Sweden more fun.

Last but not least, I would like to thank my mother and all my family for theircontinuous support and encouragement during all these years of studies.

Page 3: Wireless Positioning using Ellipsoidal Constraints

ii

Abstract

Since the advent of the global positioning system in 1999, positioning systems havebeen used to deliver location-based services (LBs) in outdoor environments. Inrecent years, LBs have become of equal interest in indoor environments in a widerange of personal and commercial applications. For this reason, recent research hasfocused its attention on wireless positioning systems. This master’s thesis presentsa new approach for indoor positioning, based on the notion of separating ellipsoids.In order to improve the position estimation algorithm, the technique is combinedwith the algorithm A∗, being applied to binary maps of the examined buildings totake into account obstacles such as walls.

The combination of separating ellipsoids and A∗ seems to promise an improve-ment over previous algorithms based on a probabilistic approaches.

Page 4: Wireless Positioning using Ellipsoidal Constraints

CONTENTS

1 INTRODUCTION 1

1.1 Wireless Positioning Systems 1

2 PROBLEM EXPLANATION AND PREVIOUS WORK 3

2.1 Notation 3

2.2 Problem explanation 3

2.3 Properties of the weights functions wi 4

2.4 The kernel-based method 5

2.5 A projection-based method 6

3 A NEW APPROACH 9

3.1 Theory 9

3.2 Homogeneous Embedding 11

3.3 SDP Formulations 12

3.4 Classification Rule 13

4 DATA 15

4.1 Plotting the locations on the maps 15

4.2 Data 18

4.3 Version with one slack for location 19

4.4 Iterative version 20

4.5 Variance ellipsoids 22

5 THE A* ALGORITHM 24

5.1 The A* algorithm 24

5.1.1 How A* works 24

5.2 Applied A* star 25

iii

Page 5: Wireless Positioning using Ellipsoidal Constraints

iv

6 ANALYSES 28

6.1 Computation of the distance matrix and of the ellipsoids 28

6.2 Classification 31

6.3 Interpolation Step 38

6.4 Results for the first floor of the Hansa Mall 40

6.5 Results for the ground floor of the Hansa Mall 42

7 CONCLUSIONS 45

BIBLIOGRAPHY 46

Page 6: Wireless Positioning using Ellipsoidal Constraints

Chapter 1

INTRODUCTION

One must learn by doing the thing;for though you think you know itYou have no certainty, until you try.

Sophocles

1.1 Wireless Positioning Systems

Since the advent of the Global Positioning System (GPS) in 1999 [1], position-ing systems have been used to deliver Location-Based services (LBs) in outdoorenvironment. In the recent years, LBs have become of equal interest in indoor envi-ronments as well as in a wide range of personal and commercial applications. Theseinclude location-based network management and security, medicine and health care,personalized information delivery and context awareness.

Unfortunately, coverage of the GPS system is limited in indoor environmentsand dense urban areas. For this reason, recent research has focused on some ex-isting wireless communication infrastructures such as wireless local area networks(WLANs) to be a complementary technique. A WLAN is characterized by a num-ber of access points (APs), which are devices that allow wireless communicationbased on the IEEE 802.11 standard and are widespread indoors for Internet access.Since the power-sensing function is available in every WLAN device, localizationusing the received signal strength (RSS) is a relatively cost-effective solution.

Commonly, the procedure to estimate the position using RSS measurements isbased on a two step method known as location fingerprinting. Fingerprinting basedpositioning is divided into an offline and an online phase.

1. In the offline phase (also known as training phase), by site-surveying, the RSSfrom multiple APs at different points in the building are collected and storedin a fingerprint database, called a radio map. More specifically, a numberN of survey locations in the site of interest are chosen and for each locationa number M of RSS measurements is collected and stored to constitute thefingerprint of that location. For each location, the sample mean and thesample variance of the M measurements are computed.

1

Page 7: Wireless Positioning using Ellipsoidal Constraints

2 Introduction Chapter 1

Figure 1.1. Example of a building map with the plotted survey locations.

2. In the online phase, the client’s position is inferred online by comparing themeasured RSS with the previous stored measurements, and the position esti-mate is a combination of the locations whose fingerprints most closely matchthe observation. This approach can be viewed as an application of patternrecognition.

There are four key challenges in fingerprinting:

1. generation of fingerprints,

2. preprocessing for reducing computational complexity and enhancing accuracy,

3. selection of APs for use in positioning, and

4. estimation of the distance between a new RSS observation and the fingerprints.

When the positioning algorithm is performed on handheld devices, extra careshould be taken due to their constrained resource and, clearly, using all availableAPs increases the computational complexity of the algorithm. For this reason, an

Page 8: Wireless Positioning using Ellipsoidal Constraints

Section 1.1. Wireless Positioning Systems 3

AP selection method is needed. The recent work of Kushki et al. [2] offers a real-time AP selection technique that minimizes the correlation between the selectedAPs to reduce the complexity and ensure the coverage.

The contribution of this thesis is twofold:

∙ the initial development of a new algorithm based on the separating ellipsoidsmethod, in order to obtain a better estimate of the user position compared tothe previous methods.

∙ The application of the A∗ algorithm in order to take into account the previouspositions of the user and possible obstacles, such as walls, and to reduce thecomputational complexity of the positioning algorithm.

The second chapter of this report explains the mathematical problem of thewireless positioning and gives a brief overview of the previous work by Kushki etal. [2] and by Fang et al. [3]. The third and the forth chapter concern the theoryof the separating ellipsoids method and the application of this method to an initialdataset from the Entre mall in Malmo. The fifth chapter explains the A∗ algorithmand how it is used in the context of wireless positioning. Finally, the sixth chapterpresents the obtained results by the carried analyses.

Page 9: Wireless Positioning using Ellipsoidal Constraints

Chapter 2

PROBLEM EXPLANATIONAND PREVIOUS WORK

2.1 Notation

The following notation will be used throughout the report:

∙ L : number of APs

∙ N : number of survey locations in the radio map

∙ p : point in 2-D cartesian space

∙ r : measured RSS vector

∙ F(pi) : Fingerprint record at the ith location of the radio map

∙ A : Multiple Discriminant Analysis (MDA) projection matrix

∙ D : number of discriminative components (DCs) generated after the MDAprojection

∙ q : Projected RSS vector by the projection matrix A

∙ F(pi) : Projected fingerprint record at the ith location of the radio map

∙ Φi : Computed ellipsoid for the location i

∙ Dist(i, k) : real distance between the location i and the location k

2.2 Problem explanation

One of the fundamental problems in location fingerprinting is to produce a positionestimate using training information on a discrete grid of training points when a new

4

Page 10: Wireless Positioning using Ellipsoidal Constraints

Section 2.3. Properties of the weights functions wi 5

RSS observation is received. That is, we seek a function g such that

g : ℝL × ℝ2 × . . .× ℝ2︸ ︷︷ ︸N

→ ℝ2

g : (r,p1, . . . ,pN ) → p (2.2.1)

where p1, . . . ,pN are the cartesian coordinates (x, y) of the N survey locations withrespect to a predefined reference point (0, 0). If the function g is restricted to theclass of linear functions, the problem is reduced to determining a set of weights suchthat

p =

N∑i=1

w(r,F(pi))pi, (2.2.2)

where F(pi) = [ri(1), . . . , ri(M)] is an L×M matrix defined as

F(pi) =

⎛⎜⎝r1i (1) . . . r1

i (M)...

. . ....

rLi (1) . . . rLi (M)

⎞⎟⎠ (2.2.3)

The column of the fingerprint matrix are RSS vectors ri(t) = [r1i (t), . . . , r

Mi (t)]T

that contain readings from L APs at time t in the ith survey location pi. Forconvenience the weights w(r,F(pi)) can be also denoted with wi.

2.3 Properties of the weights functions wi

The weights wi in the estimation function (2.2.2) are required to be decreasingfunctions of the distance between an observation vector and the training records.That is, survey points whose training records closely match the observations shouldreceive a higher weight. In particular, the functions w(r,F(pi) should satisfy thefollowing properties:

1.∑Ni=1 w(r,F(pi)) = 1 so that the estimated position belongs to the convex

hull defined by the set of survey positions. This can be achieved by includinga normalization term in (2.2.2).

2. w(r,F(pi)) is a monotonically decreasing function in both arguments withrespect to a distance measure d(r,F(pj)):

d(r,F(pi)) ≥ d(r′,F(pi)) ⇒ w(r,F(pi)) ≤ w(r′,F(pi)), (2.3.1)

d(r,F(pi)) ≥ d(r,F(pj)) ⇒ w(r,F(pi)) ≤ w(r,F(pj)). (2.3.2)

The inequality (2.3.1) means that, if a RSS measurement r′ is closer thananother RSS measurement r to the training records in a location i, then, thesurvey point i should receive a higher weight for the RSS measurement r′ thanthe RSS measurement r.

Page 11: Wireless Positioning using Ellipsoidal Constraints

6 Problem Explanation and previous work Chapter 2

The inequality (2.3.2) means that, if a RSS measurement r is further fromthe training measurements in a location i than the training measurements inanother location j, then, the survey site i should receive a lower weight thanthe location j.

2.4 The kernel-based method

The method developed by Kushki et al. [2] involves the use of kernel functions toestimate the weights wi. In particular, a non-linear mapping � : r ∈ ℝd 7→ �(r) ∈ ℱis used to map the input to a higher (possibly infinite) dimensional space ℱ wherethe weight calculations take place. Once mapped, the weights are calculated in thefollowing way:

w(r,F(pi)) =1

M

M∑t=1

⟨�(r), �(ri(t))⟩∥�(r)∥ ∥�(ri(t))∥

. (2.4.1)

where ⟨⋅, ⋅⟩ denotes the scalar product in ℱ . At first glance, the calculation ofweights in a possibly infinite dimensional space may seem computationally in-tractable. Fortunately, the kernel trick can be used to calculate the inner productin ℱ without the need for explicit evaluation of the mapping �. The kernel trickallows the replacement of inner products in ℱ by a kernel evaluation on the inputvectors. In the WLAN context, the kernel is a function k : ℝL × ℝL → ℝ suchthat k(r, r′) = ⟨�(r), �(r′)⟩. Since the training data only enter weight calculationsthrough inner products, the kernel trick can be used to carry out inner productsin ℱ without the need for explicit evaluation of mapping �. The weights functionw(r,F(pi)) then becomes

w(r,F(pi)) =1

M

M∑t=1

k(r, ri(t))√k(r, r)k(ri(t), ri(t))

(2.4.2)

. Mercer’s theorem guarantees the correspondence between a kernel function andan inner product in a feature space ℱ , given that the kernel is a positive definitefunction. Moreover the weights w(r,F(pi)) satisfy the properties (2.3.1) and (2.3.2)with the distance d defined as follows:

d(r,F(pi)) =

wwwww �(r)

∥�(r)∥− 1

N

N∑t=1

�(ri(t))

∥�(ri(t))∥

wwwww (2.4.3)

In fact, we have that:

w(r,F(pi)) = −1

2

(d(r,F(pi))

2 − C), (2.4.4)

One of the kernels proposed in the article by Kushki et al. [2] is the Gaussian kerneldefined as follows:

w(r,F(pi)) =1

N

N∑t=1

exp

(−∥r− ri(t)∥2

2�2

). (2.4.5)

Page 12: Wireless Positioning using Ellipsoidal Constraints

Section 2.5. A projection-based method 7

One drawback is that the Gaussian Kernel is linearly dependent on the number Nof the survey locations.

2.5 A projection-based method

The method proposed by Fang et al. [3] is based on the calculation of a projectionmatrix A to map the RSS measurements in a feature space of lower dimension wherethey are uncorrelated and then to take into account only the most discriminativeinformation.

More specifically, when AP selection techniques are applied to reduce the com-putational cost, an additional binary-decision vector v = [0, 1, 0, . . . 0]T ∈ ℝL isrequired to indicate which APs are retained. If the number of non-zero componentsis D, the dimension of the RSS measurement r is reduced from L to D.

Unlike the zero-one weighting (binary decision) in the selection of APs, theprojection-based system reduces dimension from L to D by combining APs witha discriminative projection A. The projection matrix A and the number L isdetermined by Multiple Discriminant Analysis (MDA).

The MDA criterion has widely been applied for the problem of multiple-classclassification. In our context, the classes can be viewed as the training measure-ments in the different reference locations in a fingerprinting problem. The objectiveof MDA is to find the components that are useful for discriminating between them.After the MDA projection, the generated components, which are named discrim-inative components (DCs), carry the most discriminative information and rank itby its information quantity. Assuming that r ∈ ℝL is the RSS measurement, theprojection-based system extracts the required DCs as follows:

q = AT r (2.5.1)

where q ∈ ℝD, AL×D is the MDA optimized projection matrix. The value ofD represents the number of required DCs for the location system and it can bedetermined by a system threshold according to different applications.

In classical MDA, two scatter matrices called between-class (SB) and within-class (SW ) matrices are defined to quantify the quality of the projection, as follows:

SW =

N∑i=1

M∑t=1

(ri(t)− ui)(ri(t)− ui)T (2.5.2)

SB =

N∑i=1

M(ui − u)(ui − u)T (2.5.3)

where ui = 1M

∑Mt=1 ri(t) is the mean of the training measurements in the ith

location and u = 1N ⋅M

∑Ni=1

∑Mt=1 ri(t) is the global mean of the all measurements.

SW measures the closeness of the samples within the locations, whereas SBmeasures the separation between locations. An optimal projection would maximize

Page 13: Wireless Positioning using Ellipsoidal Constraints

8 Problem Explanation and previous work Chapter 2

Figure 2.1. In this figure it is possible to observe an example of projected RSSmeasurement space for three different locations (three DCs).

the between-class measure and minimize the within-class measure. One way toachieve this result is to maximize the ratio as follows:

AMDA = arg maxA

∣ATSBA∣∣ATSWA∣

(2.5.4)

The numerator of (2.5.4) measures the separation among different locations thatis the RSS spatial separation (between-class), whereas the denominator measuresthe compactness of each location that is the RSS temporal variation (within-class).As a result, the optimal weighting matrix A satisfying (2.5.4) leads to the bestseparation between different reference locations, because the discrimination and thecompactness are maximized at the same time. This way, the generated DCs in theprojected space have low temporal variation but high spatial separation to providediscriminating information as much as possible. The dimension in the projectedspace (number of DCs) can be determined by a system threshold according todifferent applications.

Once obtained, the projection matrix A and the number of desired DCs, D, aprobabilistic approach is used to derive the weighting functions wi.

First, the observed RSS signal r and the fingerprint matrix F(pi) are projectedby the projection matrix A:

q = AT r (2.5.5)

F(pi) = [AT ⋅ ri(1), . . . ,AT ⋅ ri(M)] (2.5.6)

=

⎛⎜⎝ q1i (1) . . . q1

i (M)...

. . ....

qDi (1) . . . qDi (M)

⎞⎟⎠ (2.5.7)

Page 14: Wireless Positioning using Ellipsoidal Constraints

Section 2.5. A projection-based method 9

For i = 1, . . . , N , we have:

wi =P(q∣F(pi))∑Ni=1 P(q∣F(pi))

(2.5.8)

where P(q∣F(pi)) indicates the likelihood value of the location pi, given the ob-servation q = [q1, . . . , qD]T . The likelihood that the Gaussian model produces isformulated as:

P(q∣F(pi)) =

D∑d=1

1√2�si(d)

⋅ exp(− (qd − ui(d))2

2si(d)

)(2.5.9)

where ui(d) and si(d) are calculated in the following way:

ui(d) =1

M

M∑t=1

qdi (t) (2.5.10)

si(d) =1

M

M∑t=1

(qdi (t)− ui(d))2 (2.5.11)

The final position can then be estimated by:

p =

N∑i=1

wi ⋅ pi

=

N∑i=1

P(q∣F(pi))

P(∑Ni=1 q∣F(pi))

⋅ pi (2.5.12)

Page 15: Wireless Positioning using Ellipsoidal Constraints

Chapter 3

A NEW APPROACH

The way to calculate the weights wi using the Gaussian likelihood presented in theprevious chapter can be seen as a problem of statistical learning. In other words,given a number N of classes (in our specific case the N survey locations) and a newpoint x (in our context a new RSS measurement r), for each class i = 1, . . . , N thelikelihood that the new point x belongs to the class i is calculated. We then searchthe maximum of these and the class that realizes the maximum should be the classto which the new point x belongs. In this context, the method of the separatingellipsoids [4] might constitute an improving alternative.

3.1 Theory

Suppose that one has a number N of distinct classes and a number M of points(xi, ci), where ci denotes the class to which the i point belongs. Fixing a class k,with k = 1, . . . , N , one would like to include the points of this class in an ellipsoid,in order to obtain the best separation ratio from all the points of the other classes.A way to express this is to ask for two different separating ellipsoids that share thesame center and axis directions, but, the second one is larger by a factor �k, whichis subsequently called the separation ratio. The inner ellipsoid encloses all labeledpoints xi with ci = k, while, all the remaining points lie outside the external one.The higher the value of �k, the better the separation is. In Figure 3.1 it is possibleto observe 10 different classes randomly generated, each with 50 points. For theseclasses, the separating ellipsoids have been computed and the separation ratios �kwith k = 1, . . . , 10, have been maximized.

An ellipsoid in ℝd can be parametrized by its center � and a symmetric, positivesemidefinite matrix P that determines its shape and size

"d(�, P ) = {x ∈ ℝd∣(x− �)′P (x− �) ≤ 1}. (3.1.1)

where ’ denotes the transpose. The ellipsoid is degenerate if P is singular. A scaledconcentric ellipsoid with the same shape can be obtained by dividing the matrix Pwith a scalar � > 0 and the scaled ellipsoid has an equivalent representation as:

"d(�, P ) = {x ∈ ℝd∣(x− �)′P (x− �) ≤ �}, (3.1.2)

10

Page 16: Wireless Positioning using Ellipsoidal Constraints

Section 3.1. Theory 11

Figure 3.1. In this figure it is possile to observe 10 different classes randomlygenerated, each with 50 points. For these classes, the separating ellipsoids have beencomputed and the separation ratios �k with k = 1, . . . , 10 have been maximized.

where the ratio√� is the ratio between the lengths of the corresponding semimajor

axes of the two concentric ellipsoids. Suppose we are given the labeled training set{(xi, ci)}Mi=1. For each class k ∈ {1, . . . , N} the associated problem is to find theellipsoids "d(�k, Pk) and "d(�k,

Pk

�k) such that �k is maximized while satisfying the

constraints

xi ∈ "d (�k, Pk) , ∀i : ci = k

xi /∈ "d

(�k,

Pk�k

), ∀i : ci ∕= k. (3.1.3)

In other words, the problem is

maximize �k

subject to (xi − �k)′Pk(xi − �k) ≤ 1,

∀i : ci = k

(xi − �k)′Pk(xi − �k) ≥ �k,∀i : ci ∕= k,

Pk ર 0

�k ≥ 1, (3.1.4)

where the optimization variables are �k, Pk, �k and Pk ર 0 denotes the constraintthat Pk must be a positive semidefinite matrix. This problem is always feasible andthe patterns of class k are separable from all others using ellipsoids if and only ifthe optimal �k > 1.

Page 17: Wireless Positioning using Ellipsoidal Constraints

12 A new approach Chapter 3

To handle also the case when the patterns are not strictly separable using ellip-soids, the idea of soft margins is used, introducing slack variables �i for each of thepattern inclusion or exclusion constraints, and a weighted penalty term is added tothe objective function. The new problem is then formulated in the following way:

maximize �k − ∑i �i

subject to (xi − �k)′Pk(xi − �k) ≤ 1 + �i,

∀i : ci = k

(xi − �k)′Pk(xi − �k) ≥ �k − �i,∀i : ci ∕= k,

Pk ર 0, �i ≥ 0. (3.1.5)

Here, is a positive weighting parameter. Both the problems (3.1.4) and (3.1.5)are nonconvex but can be turned into convex optimization problems (being SDPs)using an homogeneous embedding technique.

3.2 Homogeneous Embedding

Any ellipsoid in ℝd can be viewed as the intersection of a homogeneous ellipsoid(one centered at the origin) in ℝd+1 and the hyperplane

H = {z ∈ ℝd+1∣z = (x, 1), x ∈ ℝd}. (3.2.1)

An homogeneous ellipsoid in ℝd+1 can be expressed as

"d+1(0,Φ) = {z ∈ ℝd+1∣z′Φz ≤ 1}, (3.2.2)

where Φ is a symmetric positive semidefinite matrix. To find the intersection of"d+1(0,Φ) with the hyperplane H, the matrix P is partitioned as follows:

Φ =

(P qq′ r

), (3.2.3)

where P ∈ ℝd×d, q ∈ ℝd, and r ∈ ℝ. If z = (x, 1), then

z′Φz ≤ 1⇔ x′Px+ 2q′x+ r ≤ 1. (3.2.4)

Now let

� = −P−1q

� = r − q′P−1q, (3.2.5)

then

z′Φz ≤ 1⇔ (x− �)′P (x− �) + � ≤ 1. (3.2.6)

Page 18: Wireless Positioning using Ellipsoidal Constraints

Section 3.3. SDP Formulations 13

Since P is positive semidefinite, we always have � ≤ 1. In addition, whenever Pis positive definite, we have 0 ≤ � < 1, and

"d+1(0,Φ) ∩H = "d

(�,

P

(1− �)

). (3.2.7)

In this case, "d+1(0,Φ) is called a homogeneous embedding of "d

(�, P

(1−�)

).

Given a nondegenerate ellipsoid "d(�, P ) its homogeneous embedding in ℝd+1 isnonunique, and can be parametrized as "d+1(0,Φ�), for 0 ≤ � < 1, where

Φ� =

((1− �)P −(1− �)P�)−(1− �)�′P (1− �)′�′P�+ �

)(3.2.8)

The special case � = 0, is called a canonical embedding and this case "d+1(0,Φ0)is a degenerate ellipsoid because the matrix Φ0 is singular.

3.3 SDP Formulations

In this section, the problem of separating patterns in ℝd using homogeneous ellip-soids in ℝd+1 is considered. At first only two classes: the inner points and the outerones. For this purpose, the M training data are divided into two sets {xi}M1

i=1 and

{yj}M2j=1, where the x′is are points belonging to a specific class, and y′js are all the

other points and M1 +M2 = M.First, the training data must be embedded in the hyperplane H by letting

ai =

(xi1

), i = 1, . . . ,M1, (3.3.1)

bj =

(yj1

)j = 1, . . . ,M2. (3.3.2)

The problem (3.1.5) using homogeneous embedding can be stated as

maximize �

subject to a′iΦai ≤ 1,

i = 1, . . . ,M1

b′jΦbj ≥ �,j = 1, . . . ,M2,

Φ ર 0, � ≥ 1 (3.3.3)

where the optimization variables are Φ and �. This is a convex optimization problem,more specifically an SDP. Once the problem (3.3.3) is solved, the parametrizationin ℝ can be recovered using the transformations in (3.2.4) and (3.2.5) The twoconcentric separating ellipsoids are

"d(�, P/(1− �)), "d(�, P/(�(1− �))). (3.3.4)

The next important properties are satisfied:

Page 19: Wireless Positioning using Ellipsoidal Constraints

14 A new approach Chapter 3

∙ If the patterns are separable, then the optimal solution to (3.3.3) is always acanonical embedding, i.e, � = 0.

∙ If the patterns are nonseparable, then the optimal solution to (3.3.3) alwayshas � = 1, and Φ is degenerate such that � = 1.

Similarly, the version with slack variables can be formulated as an SDP problem:

maximize �− (∑

i �i +∑j �j

)subject to a′iΦai ≤ 1 + �i,

i = 1, . . . ,M1

b′jΦbj ≥ �− �j ,j = 1, . . . ,M2,

(3.3.5)

where the optimization variables are Φ, �, and the slack variables �i and �j , while isa weighting parameter. Once the SDP problem (3.3.5) is solved, the transformations(3.2.4) and (3.2.5) can be also used to find the separating ellipsoids in ℝd.

Instead of using the weighting parameter , the problem (3.3.5) can be parametrizedusing the ratio �. Switching to notations that are explicit for multiclass problems,given any fixed � ≥ 1, for each class k ∈ {1, . . . , N}, the problem to solve is:

minimize∑ni=1 �ik

subject to z′iΦkzi ≤ 1 + �ik,

∀i : ci = k

z′iΦkzi ≥ �− �ik,∀i : ci ∕= k

Φk ર 0,

�ik ≥ 0, i = 1, . . . ,M, (3.3.6)

where zi = (xi, 1), and the optimization variables are Φk and �ik.In Figures 3.2 and 3.3 the problem (3.3.6) has been solved for ten classes ran-

domly generated, each consisting of 50 points, using respectively values of � equalto 1.5 and 2.

3.4 Classification Rule

After solving in the training phase the problem (3.3.6) for each class k ∈ {1, . . . , N},let Φ∗k, with k = 1, . . . , N , be the optimal obtained solution. Then, given a newdata point x ∈ ℝd, we first let z = (x, 1) ∈ ℝd+1 and compute

�k = z′Φ∗kz, k = 1, . . . , N, (3.4.1)

Page 20: Wireless Positioning using Ellipsoidal Constraints

Section 3.4. Classification Rule 15

Figure 3.2. In this figure the problem (3.3.6) has been solved for ten classesrandomly generated, each consisting of 50 points, using a value of � equal to 1.5.

Figure 3.3. In this figure the problem (3.3.6) has been solved for ten classesrandomly generated, each consisting of 50 points, using a value of � equal to 2.

then label the data with the class

k = argminkz′Φ∗kz

′. (3.4.2)

The quantity �k = z′Φkz for each k = 1, . . . , N can be seen as a distance (ellipsoid

distance) of the point z ∈ ℝd+1 from the class k. The class k that realizes theminimum of this distance is the class which mostly represents the point z.

Next chapters will deal with the application of this concept to the problem ofwireless positioning as an alternative to the Gaussian method.

Page 21: Wireless Positioning using Ellipsoidal Constraints

Chapter 4

DATA

4.1 Plotting the locations on the maps

The first hurdle to overcome concerns the plot of the survey locations on the map.Given the building map image, the GPS coordinates of both the top-left corner(NW) of the map and the bottom-right corner of the map (SE) and the GPS coor-dinates of the locations, we need to remap these coordinates to the ones to be usedon the display.

For each pair of GPS coordinates (latitude(⋅), longitude(⋅)) we set:

xGPS(⋅) = longitude(⋅) (4.1.1)

yGPS(⋅) = latitude(⋅) (4.1.2)

First, the GPS coordinates (xGPS(⋅), yGPS(⋅)) must be converted to a regular coor-dinate system where the x unit distance is no longer dependent on the y scale value.To perform this, it is necessary to fix a common latitude yCOM , that should be thesame for all the points that are to be used in calculation. The needed transformationis the following:

xUGPS = xGPS ⋅ cos

(2�

360⋅ yCOM

)(4.1.3)

yUGPS = yGPS (4.1.4)

Applying this transformation, the uniformed GPS coordinates of the NW and SEcorners are found.

Let now P be a survey location with uniformed GPS coordinates (xUGPS(P ), yUGPS(P )).By a translation, one put the origin in the SE corner and find the new coordinates

16

Page 22: Wireless Positioning using Ellipsoidal Constraints

Section 4.1. Plotting the locations on the maps 17

Figure 4.1. A rotation of angle �−� is needed so the rectangle becomes straight.

of the NW corner and of the location P as

xUGPSt(P ) = xUGPS(P )− xUGPS(SE) (4.1.5)

yUGPSt(P ) = yUGPS(P )− yUGPS(SE) (4.1.6)

xUGPSt(NW ) = xUGPS(NW )− xUGPS(SE) (4.1.7)

yUGPSt(NW ) = yUGPS(NW )− yUGPS(SE) (4.1.8)

xUGPSt(SE) = xUGPS(SE)− xUGPS(SE) (4.1.9)

yUGPSt(SE) = yUGPS(SE)− xUGPS(SE) (4.1.10)

(4.1.11)

The next steps are suggested by the scheme in Figure 4.1. An anticlockwise rotationof angle �−� is applied to the points NW and P so that the NE and SW cornerslie respectively on the y− axes and on the x− axes. It is possible then to use thesenew coordinates to plot the locations on the image of the map. The angle � iscomputed using the image of the map. In particular, denoting with w the widthand with ℎ the height of the image of the map in pixels, the length of the diagonald of the image in pixels is given by:

d =√w2 + ℎ2 (4.1.12)

Page 23: Wireless Positioning using Ellipsoidal Constraints

18 Data Chapter 4

Figure 4.2. After the rotation we are able to compute the new coordinates for theNE and SW corners.

The angle � is then given by:

� = arcsin(wd

)(4.1.13)

The angle � instead is given by:

� = arctan

(yUGPS(NW )− yUGPS(SE)

xUGPS(SE)− xUGPS(NW )

)(4.1.14)

An anticlockwise rotation is applied to the points P and NW using the followingmatrix:

A =

(cos(�− �) − sin(�− �)sin(�− �) cos(�− �)

)(4.1.15)

The new coordinates for the NW and for the SE corners are given then by:(xUGPStr(NW )yUGPStr(NW )

)= A ⋅

(xUGPSt(NW )yUGPSt(NW )

)(4.1.16)(

xUGPStr(P )yUGPStr(P )

)= A ⋅

(xUGPSt(P )yUGPSt(P )

)(4.1.17)

Page 24: Wireless Positioning using Ellipsoidal Constraints

Section 4.1. Plotting the locations on the maps 19

Figure 4.3. Change of coordinates of the location P to the domain [0, 1] × [0, 1].The new coordinates u(P ) and v(P ) represent respectively the ratio of the width wand of the height ℎ of the map image, where the corresponding pixel is.

In this new coordinate system it is easy now to find the coordinates of the NEcorner and of the SW corner as shown in Figure 4.2. In particular:(

xUGPSt(NE)yUGPSt(NE)

)=

(0

yUGPSt(NW )

)(4.1.18)(

xUGPSt(SW )yUGPSt(SW )

)=

(xUGPSt(NW )

0

)(4.1.19)

(4.1.20)

A final translation of the points is necessary to put the origin in the SWcorner and get new positive coordinates (xUGPStrt(⋅), yUGStrt(⋅)) for the cornersSE,NW ,NE and the point P .

At this point we calculate:

u(P ) =xUGPStrt(P )

xUGPStrt(SE)(4.1.21)

v(P ) =yUGPStrt(P )

yUGPStrt(NW )(4.1.22)

Page 25: Wireless Positioning using Ellipsoidal Constraints

20 Data Chapter 4

Basically, as shown in Figure 4.3, the initial domain is restricted to [0, 1]× [0, 1] andu(P ), v(P ) are the coordinates of the location P in the new domain and representrespectively the ratio of the width w and of the height ℎ of the map image wherethe corresponding pixel is. Then, in order to find the corresponding pixels (px, py)in the map:

px = round(w ⋅ u) (4.1.23)

py = round(ℎ ⋅ (1− v)) (4.1.24)

where round means rounding to the nearest integer.

Page 26: Wireless Positioning using Ellipsoidal Constraints

Section 4.2. Data 21

Figure 4.4. Map of the Entre shopping mall in Malmo with the 61 plotted loca-tions.

4.2 Data

The data used to carry on the preliminary analyses have been taken in the Entreshopping mall in Malmo. The dataset consists of:

∙ 70 access points (APs) for the Wireless signal.

∙ 13 access points (APs) for the GSM signal.

∙ 61 survey locations.

∙ 320 measurements of the wireless signal in each of the 61 locations.

∙ 240 measurements of the GSM signal in each of the 61 locations.

The GSM signal is treated in the same way of the Wifi signal. Since the finalresults for the GSM measurements are not as good as for the Wifi measurements,this report will treat only the Wifi signal.

The first step is to project the Wifi measurements in a lower dimensional spaceby a projection matrix A, as described in the Section 2.5 to reduce the number ofAPs from 70 to 13 DCs. Since, we will perform this step on all the datasets that wewill have to deal with, from now on, to simplify the notation, we use the wordingRSS measurements to denote the projected RSS measurements.

Furthermore, for each location i with i = 1, . . . , 61 the signature vectors, thusthe mean vector and the standard deviation value for the RSS measurements, havebeen calculated.

Page 27: Wireless Positioning using Ellipsoidal Constraints

22 Data Chapter 4

We initially attempt to apply the method of the separating ellipsoids to thetraining measurements for each survey location k . In other words, fixing a locationk we want to construct the ellipsoid that contains the RSS measurements of thelocation k and keeps outside all the measurements of the other sites different fromk. Given qi(1), . . . ,qi(M), the M RSS measurements at the location i and letting

zi(j) =

(qi(j)

1

)(4.2.1)

the SDP problem to solve is the following:

minimize �

subject to zk(i)′Φkzk(i) ≤ 1,

∀i = 1, . . . ,M

zl(j)′Φkzl(j) ≥ �,

∀l = 1, . . . , N l ∕= k

∀j = 1, . . . ,M

Φk ર 0,

� > 1, (4.2.2)

where the optimization variables are Φk and �. As expected the measurements arenot strictly separable and for this reason the version with all slack variables is used:

minimize∑i,j �ij

subject to zk(j)′Φkzk(j) ≤ 1 + �kj ,

∀j = 1, . . . ,M

zl(j)′Φkzl(j) ≥ �− �lj ,

∀l = 1, . . . , N l ∕= k

∀j = 1, . . . ,M

Φk ર 0,

�ik ≥ 0. (4.2.3)

where the optimization variables are Φk and all the slack variables �ij . Regrettably,due to the large number of variables required to solve this optimization problem,the solution requires a vast amount of computational power and memory allocation.

For this reason, in view of larger environments, alternative versions have beenformulated in order to decrease the number of variables and constraints to optimize.

4.3 Version with one slack for location

One may simplify the original problem by restricting the formulation to only allowfor one slack variable for each location. This approach will differ from the version

Page 28: Wireless Positioning using Ellipsoidal Constraints

Section 4.4. Iterative version 23

with all slack variables since the points of each location have all the same slackvariable. That is, let k be a fixed survey location. The formulation of the problemis:

minimize∑Nk=1 �k

subject to z′k(i)Φkzk(i) ≤ 1 + �k,

∀i = 1, . . . ,M

z′l(i)Φkzl(i) ≥ �− �l,∀l = 1, . . . , N l ∕= k

∀i = 1, . . . ,M (4.3.1)

Φk ર 0, (4.3.2)

�i ≥ 0, ∀i = 1, . . . , N, (4.3.3)

where the optimization variables are Φk and the N slack variables �k. The efficiencyin computing the ellipsoid has improved substantially since the number of variablesto optimize is N against N ⋅M of the version with all the slack variables. Themain drawback is when there is no separability in the classes. In fact, in this casethe ellipsoid, even if they contain the most part of the point of the respective class,overlap themselves critically and this can lead to a misclassification of the data.

4.4 Iterative version

As an alternative, instead of considering for each location k all the measurementsM , one may initially solve the optimization problem (4.2.3), taking into account alower number of measurements for each location. Then, during next iterations, onemay add the same number of new measurements and solve again the optimizationproblem, using for the old points the values of the slack variables computed at theprevious steps.

In particular, let n1 be an integer number such that n1 < M and M is a multipleof n1. At the first iteration, the version with all slack variables is applied but withonly n1 points. That is, let k be a fixed location, then:

minimize∑i,k �

(1)ki

subject to z′k(i)Φ(1)k zk(i) ≤ 1 + �

(1)ki ,

∀i = 1, . . . , n1

z′j(i)Φ(1)k zj(i) ≥ �− �(1)

ji ,

∀j = 1, . . . , N j ∕= k

∀i = 1, . . . , n1

Φ(1)k ર 0, (4.4.1)

�(1)ik ≥ 0, ∀i ∀k (4.4.2)

Page 29: Wireless Positioning using Ellipsoidal Constraints

24 Data Chapter 4

Figure 4.5. In this Figure, the iterative version has been solved for ten classesrandomly generated, each consisting of 50 points, using a value of � equal to 1.1and adding 25 points at each iteration.

where the optimization variables are Φ(1)k and the N ⋅ n1 slack variables �

(1)ij . From

the second iteration n1 points are added to each location. For the old points thevalues of the slack variables computed at the previous steps are used. That is, atiteration (l) with l ≥ 2

minimize∑i,k �

(l)ik

subject to z′k(i)Φ(l)k zk(i) ≤ 1 + �

(l−1)ik ,

∀i = 1, . . . , (l − 1) ⋅ n1

z′k(i)Φ(l)k zk(i) ≤ 1 + �

(l)ik ,

∀i = (l − 1) ⋅ n1 + 1, . . . , l ⋅ n1

∀j = 1, . . . , N, j ∕= k

z′j(i)Φ(l)k zj(i) ≥ �− �(l−1)

ij ,

∀i = 1, . . . , (l − 1) ⋅ n1

z′j(i)Φ(l)k zj(i) ≥ �− �(l)

ij ,

∀i = (l − 1) ⋅ n1 + 1, . . . , n1 ⋅ lΦ

(l)k ર 0,

�(l)ik ≥ 0, ∀i, ∀k, (4.4.3)

where �(l−1)ik are the slack variables optimized at the previous step while �

(l)ik are the

ones that correspond to the new added points and must be optimized. After thelast iteration the last slack variables might be used to recompute again the previous

Page 30: Wireless Positioning using Ellipsoidal Constraints

Section 4.5. Variance ellipsoids 25

ones.After testing this method on the simulated data in which each class consists of

50 points it has been noticed that if only two points are added at each iteration theellipsoid are inaccurate. They are moved with respect to the points that they shouldcontain, while increasing the number of points that we add at each iteration,theobtained ellipsoids are almost equal to the ones computed with the all slack version.In order to obtain accurate ellipsoids the number of points n1 should be major orequal to M

2 . However, such a solution will still suffer from the demanding memoryallocation similar to the original problem.

In the Figure 4.5, the iterative version has been solved for ten classes randomlygenerated, each consisting of 50 points, using a value of � equal to 1.1 and adding25 points at each iteration.

4.5 Variance ellipsoids

A third option consists of building, after fixing a location k, a normal oriented el-lipsoid (variance ellipsoid) that contains at least the most part of the measurementsof the survey site k. For all the remaining locations, it is possible then to check howmany measurements are inside this ellipsoid and take into account, when computingthe separating ellipsoid for the location k, only the locations i whose measurementsmostly overlap the measurements of the site k.

In particular, the equation of a normal oriented ellipsoid in an n-dimensionalspace is defined by the equation

xT ⋅A ⋅ x <= 1

where A is a n-dimensional diagonal matrix

A =

⎛⎜⎝�1 . . . 0...

. . ....

0 . . . �n

⎞⎟⎠where �i, for i = 1, . . . , n, are the eigenvalues of the matrix. The relation betweenthe equatorial radii rj for j = 1, . . . , n of the ellipsoids and the eigenvalues �j isgiven by

rj =1√�j

(4.5.1)

Since for each location i it is possible to calculate the mean vector of the RSSmeasurements and the vector of the standard deviations �(i) = [�1(i), . . . , �D(i)]T ,it is also possible to construct the ellipsoid that contains most of the points of thesite i. The matrix which defines the ellipsoid is given by:

B(i) = C ⋅

⎛⎜⎜⎝1

�21(i)

. . . 0

.... . .

...0 . . . 1

�2D(i)

⎞⎟⎟⎠ (4.5.2)

Page 31: Wireless Positioning using Ellipsoidal Constraints

26 Data Chapter 4

where C is a chosen constant and it depends on the number of DCs.Once computed the ellipsoids for each location we perform the following steps:

1. Fix a location k.

2. For each location j, with j = 1, . . . , N , count how many measurements of thislocation are inside the variance ellipsoid of the site k.

3. Repeat the two steps above for each location k with k = 1, . . . , N .

By doing this, it is possible to know, for each site k, which are the locations j,whose measurements mostly overlap the measurements of the site k. Finally, takinginto considerations only these locations j to compute the separating ellipsoid forthe location k, it is possible to reduce the number of constraints and variables tooptimize. Regrettably, it can happen that far away locations have many measure-ments that overlap, or many locations overlap each other. For this reason, largerbuildings will still necessitate prohibitive memory requirements.

Figure 4.6. In this Figure, it is possible to observe a set of 3-D points with thecorresponding variance ellipsoid, computed as described in the section 4.5. As it ispossible to observe, almost all the points lie inside the ellipsoid.

Page 32: Wireless Positioning using Ellipsoidal Constraints

Chapter 5

THE A* ALGORITHM

5.1 The A* algorithm

In computer science, A∗ is a widely used algorithm for path-finding and graphtraversal, the process of plotting an efficiently traversable path between points,called nodes. Noted for its performance and accuracy, the algorithm was first de-scribed by Peter Hart, Nils Nilsson and Bertram Raphael in 1968 [6]. It is anextension of Edger Dijkstra’s 1959 algorithm and it achieves better performance(with respect to time) by using heuristic distances.

A∗ uses a best-first search and finds the least cost-path from a given initial nodeto one goal node. To achieve this, it uses a distance-plus-cost heuristic function(usually denoted by f(x)) to determine the order in which the search visits nodesin the tree. The distance-plus-cost heuristic is a sum of two functions:

∙ the path-cost function, which is the cost from the starting node to the currentnode (usually denoted by g(x))

∙ and an admissible ”heuristic estimate” of the distance from each node to thegoal node (usually denoted by ℎ(x)).

In mathematical terms f(x) is then given by:

f(x) = g(x) + ℎ(x). (5.1.1)

The function ℎ(x) is a mathematical way of using previous knowledge in order toexpand the fewest possible nodes in searching for an optimal path and speed up thealgorithm. For example, inside a building, ℎ(x) might represent the straight-linedistance to the goal (without taking into account the walls), since that is physicallythe smallest possible distance between any two points or nodes. The adjective ”ad-missible” means that ℎ(x) must not overestimate the distance to the goal. Dijkstra’salgorithm is a particular case of the A∗ algorithm, then using ℎ(x) = 0.

5.1.1 How A* works

The A∗ algorithm requires a starting node s and a goal node d. The steps of thealgorithm are the followings:

27

Page 33: Wireless Positioning using Ellipsoidal Constraints

28 The A* algorithm Chapter 5

1. Add the starting node s to the ”open set”. The open set contains the nodesthat must be explored and they might be inserted in the optimal path towardsthe goal node s.

2. Repeat the following:

a) Look for the node in the open set which has the lowest f value. We referto this as the ”current node”.

b) Switch it to the ”closed set”.

c) For each of the nodes that are reachable from the current node:

∙ If it is in the closed list, ignore it. Otherwise do the following.

∙ If it is not on the open list, add it to the open list. Make the currentnode the parent of this node, and record the f , g and ℎ costs of thenode.

∙ If it is on the open list already, check to see if this path to that squarecosts less, using g cost as the measure. A lower g cost means that thisis a better path. If so, change the parent of the node to the currentnode and recalculate the g and f scores of the node.

d) Stop when:

∙ The target square is added to the closed list. In this case the path hasbeen found. Or,

∙ the target square has not been found, and the open list is empty. Inthis case there is no path.

3. Save the path. Working backwards from goal node d, go from each node toits parent node until the starting node s is reached.

5.2 Applied A* star

Since the buildings we have to deal with might have many walls or non-walkablezones, it would be useful to compute the shortest paths from each survey locationto the remaining ones. In fact, during the online phase, the RSS measurement istaken by the mobile client (MC) at least every two seconds. During this interval,the user is unlikely to move to a location which is a long way far from the pointin which he or she is. Then, by calculating the real distances (the lengths of theshortest paths taking into account possible obstacles) from one survey site to theother ones, we will be able to compute the ellipsoids considering only the locationsthat are most likely to reach.

More specifically, fixing a survey point k with k = 1, . . . , N , we compute thereal distance Dist(k, i) from the location k to the location i for every i = 1, . . . , N .Then, fixing a parameter DMAX, the locations j’s with j = 1, . . . , N such that

Dist(k, j) <= DMAX. (5.2.1)

Page 34: Wireless Positioning using Ellipsoidal Constraints

Section 5.2. Applied A* star 29

are selected. The ellipsoid for the location k is then computed, taking into accountonly the locations j’s that satisfy the inequality (5.2.1). This approach solves ina smart and intuitive way the memory problem since the number of variables andconstraints to optimize is always reasonable also for large environments.

The binary images (black and white) are stored in the computer as binary ma-trices where 0 represents the black color and 1 represents the white color. In thecase the image represents a map, the black color is used for the non walkable zonesand the white color for the walkable zones.

In order to be able to compute the real distances in meters from one point of thebuilding to another one, the binary map needs to be resized. To perform this, a smalldistance d is fixed, depending on the grade of accuracy that we want to keep afterthe resizing. Usually, d is chosen to be equal to the half of the minimum distancebetween all the locations. Given the GPS coordinates of the North-West angle andthe South-East angle of the map, it is possible to compute the GPS coordinatesof the other two angles (North-East and South-West) and the distances in metersbetween these four corners. Using this data, we build a grid of the image, in whicheach edge of a square represents a distance equal to d. Furthermore, the resizedbinary map is always a binary matrix, in which each element, 1 or 0, represents asquare of the grid.

The A∗ algorithm, implemented in MATLAB, takes as input the resized binaryimage, a starting node (is, js) in the image matrix and a destination node (id, jd)in the image matrix. The resulting path is a sequence of nodes in the image matrix(is, js), (i1, j1), . . . , (id, jd). An example can be observed in Figures 5.1 and 5.2.For the heuristic distance ℎ, it is reasonable to take the distance from the currentelement (i, j) to the destination element (id, jd) multiplied by d, that is:

ℎ(i, j) = d ⋅√

(id − i)2 + (jd − j)2 (5.2.2)

The transition costs are instead simply computed in the following way:

∙ cost of an horizontal movement = d,

∙ cost of a vertical movement = d,

∙ cost of a diagonal movement = d ⋅√

2.

The distance of the path is then computed by summing the costs of the madetransitions from the starting point (is, js) to the final point (id, jd). It is possiblethen to build the distance matrix Dist.

Page 35: Wireless Positioning using Ellipsoidal Constraints

30 The A* algorithm Chapter 5

⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

0 0 0 0 0 0 00 1 1 0 1 1 00 1 0 1 0 1 00 1 0 1 0 1 00 1 0 1 0 1 00 1 1 1 1 1 00 1 1 0 1 1 00 0 0 0 0 0 0

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠=⇒

Figure 5.1. An example of a binary matrix and the corresponding image

⎛⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

0 0 0 0 0 0 00 1⃝ 1⃝ 0 1 1 00 1⃝ 0 1 0 1 00 1⃝ 0 1 0 1⃝ 00 1⃝ 0 1 0 1⃝ 00 1⃝ 1⃝ 1⃝ 1⃝ 1⃝ 00 1 1 0 1 1 00 0 0 0 0 0 0

⎞⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠=⇒

Figure 5.2. Example of the shortest path from the starting node (2, 3)to the final node (4, 6). The resulting path is: (2, 3),(2, 2),(3, 2),(4.2),(5, 2),(6, 2),(6, 3),(6, 4),(6, 5),(6, 6),(5, 6),(4, 6), that corresponds to the red line inthe image.

Page 36: Wireless Positioning using Ellipsoidal Constraints

Chapter 6

ANALYSES

6.1 Computation of the distance matrix and of the ellipsoids

To evaluate the performance of the A∗ algorithm and of the ellipsoid method takinginto account the only reachable locations, two different datasets have been consid-ered. The first comes from the first floor of the Hansa Mall in Malmo and it consistsof 38 locations, with 160 Wifi measurements for the locations i with i = 1, . . . , 35and with 80 Wifi measurements for the locations i with i = 36, . . . , 38. The sec-ond comes from the ground floor of the Hansa Mall in Malmo and it consists of 30locations, each with 160 Wifi measurements.

In Figure 6.1 it is possible to observe the two maps, of the ground floor and ofthe first floor with the plotted locations.

(a) (b)

Figure 6.1. (a) First floor (b) Ground floor

After resizing the map, A∗ has been applied, in order to obtain the distancematrix Dist, where Dist(i, j) is the real distance between the location i and thelocation j taking into account the walls. In the Figures 6.2-6.4, it is possible to

31

Page 37: Wireless Positioning using Ellipsoidal Constraints

32 Analyses Chapter 6

observe a comparison between the distances computed from some locations j toother survey sites without taking into account the walls and the distances computedtaking into account the walls.

In Figure 6.5, it is clearly visible how the distance from the red location to theyellow one, if walls are taken into account, is much higher (44m) than the case inwhich walls are not taken into account (16m). After, for each location j only thosesites that are reachable are selected. Here, we set the parameter DMAX equal to12m, and form a vector PT (k) that contains only the locations j that has a distanceless than DMAX meters from the location k. The ellipsoids are then computedfor each location k taking into account only the sites j stored in the vector PT (k).More specifically, the problem to solve is the following:

minimize∑i,j �ij

subject to zk(j)′Φkzk(j) ≤ 1 + �jk,

∀j = 1, . . . ,M(k)

zl(j)′Φkzl(j) ≥ �− �jl,

∀l ∈ PT (k) l ∕= k

∀j = 1, . . . ,M(l)

Φk ર 0,

�ik ≥ 0. (6.1.1)

where the optimization variables are the slack variables �ij , Φk and with M(j) withj = 1, . . . , N we denote the number of measurements at the location k, typicallybeing different for every location. Here, the values of � used are: 1.075, 1.05, 1.025.

The main difference between the algorithm in (6.1.1) and the one in (4.2.2) isthat the number of the points that have to lie outside the ellipsoid for the locationk are notably less since we now consider only the locations that are reachable.On the other hand, as it is possible to observe, there are no constraints for thepoints of locations further than 12 meters. It can happen, then, that some RSSmeasurements of some location j would be classified in ellipsoids of far locations.However, this does not constitute a problem, since the far locations are already cutout by selecting the only reachable ones.

Page 38: Wireless Positioning using Ellipsoidal Constraints

Section 6.1. Computation of the distance matrix and of the ellipsoids 33

(a) (b)

Figure 6.2. (a) With no walls (b) With walls

(a) (b)

Figure 6.3. (a) With no walls (b) With walls

Page 39: Wireless Positioning using Ellipsoidal Constraints

34 Analyses Chapter 6

(a) (b)

Figure 6.4. (a) With no walls (b) With walls

(a) (b)

Figure 6.5. (a) With no walls (b) With walls. In this Figure, it is clearly visiblehow the distance from the red location to the yellow one, if walls are taken intoaccount, is much higher (44m) than the case in which walls are not taken intoaccount (16m).

Page 40: Wireless Positioning using Ellipsoidal Constraints

Section 6.2. Classification 35

6.2 Classification

The next step in the analysis is the classification. For each location k, we comparethe percentage of its measurements that are correctly mapped to site k when using:

∙ The Gaussian likelihood taking into account all the locations.

∙ The Gaussian likelihood taking into account only the reachable locations inPT (k).

∙ The ellipsoid distance taking into account only the reachable locations.

More specifically, setting the initial counters Rigℎt1(k) = 0, Rigℎt2(k) = 0 andRigℎt3(k) = 0, for all the measurements q = qk(i) at the location k, the followingquantities are computed:

∙ k1 = argmaxi=1,...,N P(q∣F(pi)).

∙ k2 = argmaxi∈PT (k) P(q∣F(pi)).

∙ k3 = argmini∈PT (k)(q 1) ⋅ Φi ⋅(

q1

)When k1 = k, k2 = k or k3 = k, we increment Rigℎt1(k), Rigℎt2(k) or Rigℎt3(k).We perform this for all the locations k with k = 1, . . . , N . Then, it is possibleto obtain the percentage of points, for each method, that are mapped in the rightlocation. The final results are available in the next tables, both for the ground floorand for the first floor.

∙ First column: number of the location.

∙ Second column: percentage of points mapped in the right location using theGaussian likelihood and taking into account all the locations.

∙ Third column: percentage of points mapped in the right location using theGaussian likelihood and taking into account only the reachable ones.

∙ Fourth column: percentage of points mapped in the right location using theEllipsoid distance and taking into account only the reachable ones.

The expectations for the ellipsoid method taking into account only the reachablelocations are pretty high. In fact, as it is possible to observe in all the tables, thepercentages of points that are mapped in the right survey site using this methodare much larger than using both the Gaussian method with all the locations andthe Gaussian method with only the reachable locations.

It is also worth to notice that the percentages of points mapped with the Gaus-sian method with only the reachable locations is higher than the percentages ofpoints mapped with the Gaussian method with all the locations, since we do notconsider far locations.

Page 41: Wireless Positioning using Ellipsoidal Constraints

36 Analyses Chapter 6

First floor with DMAX = 12 with rho = 1.075

Gaussian Method (All) Ell Method (Reach) Gaussian Method (Reach)

1 68.75 93.75 852 36.875 64.375 36.8753 8.75 73.75 8.754 31.875 71.25 34.3755 16.25 53.75 16.256 26.25 38.75 27.57 46.25 67.5 46.258 21.25 82.5 259 85 93.75 8510 36.25 78.125 36.2511 42.5 35.625 42.512 30 61.25 41.2513 51.25 55 51.2514 18.75 63.75 28.7515 28.75 51.25 3016 17.5 56.25 27.517 23.75 73.125 46.2518 54.375 78.125 60.62519 62.5 87.5 68.7520 43.75 66.25 5021 21.25 25 21.2522 37.5 71.25 4023 17.5 73.75 18.7524 52.5 70 57.525 12.5 40 12.526 21.25 66.25 21.2527 68.75 65 71.2528 37.5 68.75 4029 38.75 83.75 4530 60 76.25 6031 60 67.5 6032 59.375 95 60.62533 32.5 77.5 4534 63.75 86.25 6535 76.875 89.375 76.87536 40 50 4037 45 97.5 53.7538 70 85 70

Page 42: Wireless Positioning using Ellipsoidal Constraints

Section 6.2. Classification 37

First floor DMAX = 12 with rho = 1.05

Gaussian Method (All) Ell Method (Reach) Gaussian Method (Reach)

1 68.75 95 852 36.875 60.625 36.8753 8.75 73.75 8.754 31.875 71.25 34.3755 16.25 55 16.256 26.25 33.75 27.57 46.25 67.5 46.258 21.25 82.5 259 85 93.75 8510 36.25 78.125 36.2511 42.5 32.5 42.512 30 61.25 41.2513 51.25 55 51.2514 18.75 65 28.7515 28.75 51.25 3016 17.5 56.25 27.517 23.75 73.125 46.2518 54.375 79.375 60.62519 62.5 87.5 68.7520 43.75 66.25 5021 21.25 26.25 21.2522 37.5 71.25 4023 17.5 73.75 18.7524 52.5 70 57.525 12.5 40 12.526 21.25 66.25 21.2527 68.75 65 71.2528 37.5 68.75 4029 38.75 83.75 4530 60 76.25 6031 60 67.5 6032 59.375 93.75 60.62533 32.5 77.5 4534 63.75 85 6535 76.875 89.375 76.87536 40 50 4037 45 97.5 53.7538 70 90 70

Page 43: Wireless Positioning using Ellipsoidal Constraints

38 Analyses Chapter 6

First floor DMAX = 12 with rho = 1.025

Gaussian Method (All) Ell Method (Reach) Gaussian Method (Reach)

1 68.75 95 852 36.875 61.875 36.8753 8.75 73.75 8.754 31.875 70 34.3755 16.25 55 16.256 26.25 33.75 27.57 46.25 67.5 46.258 21.25 82.5 259 85 93.75 8510 36.25 78.125 36.2511 42.5 31.25 42.512 30 61.25 41.2513 51.25 55 51.2514 18.75 65 28.7515 28.75 51.25 3016 17.5 56.25 27.517 23.75 73.125 46.2518 54.375 79.375 60.62519 62.5 88.75 68.7520 43.75 67.5 5021 21.25 30 21.2522 37.5 71.25 4023 17.5 73.75 18.7524 52.5 68.75 57.525 12.5 38.75 12.526 21.25 66.25 21.2527 68.75 65 71.2528 37.5 68.75 4029 38.75 83.75 4530 60 76.25 6031 60 67.5 6032 59.375 93.75 60.62533 32.5 78.75 4534 63.75 85 6535 76.875 89.375 76.87536 40 50 4037 45 97.5 53.7538 70 87.5 70

Page 44: Wireless Positioning using Ellipsoidal Constraints

Section 6.2. Classification 39

Ground floor with DMAX = 12 m and rho = 1.075

Gaussian Method (All) Ell Method (Reach) Gaussian Method (Reach)

1 56 79.2 58.32 42 80 52.53 No Wifi measurements No Wifi measurements No Wifi measurements4 104 88.75 655 64 90 806 56 92.5 707 48 100 608 58 80 72.59 46 85 6010 12 100 1511 66 83.75 46.2512 44 92.5 62.513 46 95 57.514 38 95 47.515 48 95 6016 50 87.5 62.517 28 87.5 3518 34 95 42.519 70 100 87.520 24 72.5 3021 46 90 57.522 58 80 72.523 22 97.5 4024 52 97.5 6525 No Wifi measurements No Wifi measurements No Wifi measurements26 60 97.5 82.527 44 87.5 62.528 22 80 3029 40 87.5 52.530 38 87.5 55

Page 45: Wireless Positioning using Ellipsoidal Constraints

40 Analyses Chapter 6

Ground floor with DMAX = 12 m and rho = 1.05

Gaussian Method (All) Ell Method (Reach) Gaussian Method (Reach)

1 56 79.2 58.32 42 82.5 52.53 No Wifi measurements No Wifi measurements No Wifi measurements4 104 87.5 655 64 90 806 56 92.5 707 48 100 608 58 82.5 72.59 46 87.5 6010 12 100 1511 66 83.75 46.2512 44 92.5 62.513 46 97.5 57.514 38 97.5 47.515 48 95 6016 50 90 62.517 28 87.5 3518 34 95 42.519 70 100 87.520 24 72.5 3021 46 90 57.522 58 80 72.523 22 97.5 4024 52 97.5 6525 No Wifi measurements No Wifi measurements No Wifi measurements26 60 97.5 82.527 44 90 62.528 22 77.5 3029 40 87.5 52.530 38 87.5 55

Page 46: Wireless Positioning using Ellipsoidal Constraints

Section 6.2. Classification 41

Ground floor with DMAX = 12 m and rho = 1.05

Gaussian Method (All) Ell Method (Reach) Gaussian Method (Reach)

1 56 79.2 58.32 42 82.5 52.53 No Wifi measurements No Wifi measurements No Wifi measurements4 104 87.5 655 64 90 806 56 92.5 707 48 100 608 58 82.5 72.59 46 87.5 6010 12 100 1511 66 83.75 46.2512 44 92.5 62.513 46 97.5 57.514 38 97.5 47.515 48 95 6016 50 90 62.517 28 87.5 3518 34 95 42.519 70 100 87.520 24 72.5 3021 46 90 57.522 58 80 72.523 22 97.5 4024 52 97.5 6525 No Wifi measurements No Wifi measurements No Wifi measurements26 60 97.5 82.527 44 90 62.528 22 77.5 3029 40 87.5 52.530 38 87.5 55

Page 47: Wireless Positioning using Ellipsoidal Constraints

42 Analyses Chapter 6

6.3 Interpolation Step

The last step is the interpolation step. Let q = qk(j) be the jth training measure-ment in the location k and let pk be the vector of the GPS coordinates (latitudeand longitude) of the kth location. By using the measurement q and setting

C(i) =

⎧⎨⎩1 if 0 < Dist(i, k) < 5m

0.8 if 5 ≤ Dist(i, k) < 8m

0.6 if 8 ≤ Dist(i, k) ≤ 12m

(6.3.1)

the position

p =

N∑i=1

wi ⋅ pi (6.3.2)

is estimated by using the following weights:

∙ Gaussian Method taking into account all the locations

wi = P(q∣F(pi))N∑i=1

P(q∣F(pi))

for i = 1, . . . , N (6.3.3)

∙ Gaussian Method taking into account only the reachable locations

wi =

⎧⎨⎩C(i)⋅P(q∣F(pi))∑

i∈PT (k)

C(i) ⋅P(q∣F(pi))∀i ∈ PT (k)

0 otℎerwise

(6.3.4)

∙ Ellipsoid Method taking into account only the reachable locations

wi =

⎧⎨⎩∑

i∈PT (k)

C(i) ⋅ q′ ⋅ Φi ⋅ q

C(i)⋅q′⋅Φi⋅q ∀i ∈ PT (k)

0 otℎerwise

(6.3.5)

Page 48: Wireless Positioning using Ellipsoidal Constraints

Section 6.3. Interpolation Step 43

∙ Combined Method using only the reachable locations

w1i =P(q∣F(pi))∑

i∈PT (k)

P(q∣F(pi))

w2i =

∑i∈PT (k)

q′ ⋅ Φi ⋅ q

q′ ⋅ Φi ⋅ q

wi =

⎧⎨⎩C(i) ⋅ (w1i + w2i) ⋅

∑i∈PT (k)

1

C(i) ⋅ (w1i + w2i)∀i ∈ PT (k)

0 otℎerwise

(6.3.6)

Denoting with:

∙ pGA the estimated position with the Gaussian method taking into account allthe locations,

∙ pGR the estimated position with the Gaussian method taking into accountonly the reachable locations,

∙ pER the estimated position with the ellipsoid method,

∙ pC the estimated position with the combined method,

we calculate:

∙ ERRGA the distance in meters between pGA and p,

∙ ERRGR the distance in meters between pGR and p,

∙ ERRER the distance in meters between pER and p,

∙ ERRC the distance in meters between pC and p.

The same thing is done for all the measurements of the all locations. It is possiblethen to draw the histograms of the different errors, both for the first and the groundfloor.

Page 49: Wireless Positioning using Ellipsoidal Constraints

44 Analyses Chapter 6

6.4 Results for the first floor of the Hansa Mall

Figure 6.6. Histogram Errors of the Gaussian Method taking into account all thelocations.MEAN ERROR = 4.72m, MAXIMUM ERROR = 28.8m,MINIMUM ERROR = 0m, MEDIAN ERROR = 3.82m.

Figure 6.7. Histogram Errors of the Gaussian Method taking into account onlyreachable locations.MEAN ERROR = 3.18m, MAXIMUM ERROR = 12.25m,MINIMUM ERROR = 0m, MEDIAN ERROR = 2.63m.

Page 50: Wireless Positioning using Ellipsoidal Constraints

Section 6.4. Results for the first floor of the Hansa Mall 45

Figure 6.8. Histogram Errors of the Ellipsoid Method taking into account onlyReachable locations.MEAN ERROR = 2.34m, MAXIMUM ERROR = 4.84m,MINIMUM ERROR = 0m, MEDIAN ERROR = 2.37m.

Figure 6.9. Histogram Errors of the Combined Method.MEAN ERROR = 2.38m, MAXIMUM ERROR = 7.5m,MINIMUM ERROR = 0m, MEDIAN ERROR = 2.18m.

Page 51: Wireless Positioning using Ellipsoidal Constraints

46 Analyses Chapter 6

6.5 Results for the ground floor of the Hansa Mall

Figure 6.10. Histogram Errors of the Gaussian Method taking into account allthe locations.MEAN ERROR = 1.76m, MAXIMUM ERROR = 25.76m,MINIMUM ERROR = 0m, MEDIAN ERROR = 0m.

Figure 6.11. Histogram Errors of the Gaussian Method taking into account onlythe reachable locations.MEAN ERROR = 1.38m, MAXIMUM ERROR = 10.95m,MINIMUM ERROR = 0m, MEDIAN ERROR = 0m.

Page 52: Wireless Positioning using Ellipsoidal Constraints

Section 6.5. Results for the ground floor of the Hansa Mall 47

Figure 6.12. Histogram Errors of the Ellipsoid Method taking into account onlythe reachable locations.MEAN ERROR = 1.15m, MAXIMUM ERROR = 4.94m,MINIMUM ERROR = 0m, MEDIAN ERROR = 0.56m.

Figure 6.13. Histogram Errors of the Combined Method.MEAN ERROR = 1.15m, MAXIMUM ERROR = 7.06m,MINIMUM ERROR = 0m, MEDIAN ERROR = 0.45m.

Page 53: Wireless Positioning using Ellipsoidal Constraints

48 Analyses Chapter 6

As it is possible to observe from the histograms, the methods in which onlythe reachable locations are taken into account have lower maximum errors thanthe Gaussian method in which all the locations are taken into account, since thelocations that are too far are not considered.

Maximum Error for the different MethodsFirst floor Ground floor

Gaussian Method (All) 28.8 m 25.76 mGaussian Method (Reach) 12.25 m 10.95 mEllipsoid Method (Reach) 4.84 m 4.94 mCombined Method (Reach) 7.5 m 10.91 m

Also the mean errors are lower for the methods with the only reachable locationsthan the Gaussian method with all the locations.

Mean Error for the different MethodsFirst floor Ground floor

Gaussian Method (All) 4.72 m 1.76 mGaussian Method (Reach) 3.18 m 1.38 mEllipsoid Method (Reach) 2.34 m 1.15 mCombined Method (Reach) 2.38 m 1.3 m

Moreover, it is worth to notice that the mean errors for the Ellipsoid Method andfor the Combined Method are the lowest one, confirming the good results obtainedin the classification step.

Page 54: Wireless Positioning using Ellipsoidal Constraints

Chapter 7

CONCLUSIONS

The rising prominence of location-based services necessitates the development ofindoor positioning systems. Due to their ubiquity, WLANs provide a suitable andcost-effective infrastructure for devising such systems.

This thesis has examined the problem of WLAN positioning using RSS and hasstarted to explore a new algorithm based on separating ellipsoids.

The first step is to project the RSS from APs onto a discriminative signal space,in which the DCs are generated with quantified information. This way, the infor-mation is reorganized such that the information of all APs can be more efficientlyutilized. Instead of selecting important APs, this technique replaces the elements bya subset of DCs, thereby guaranteeing maximal discriminative information involvedin the positioning system.

Each survey location with its own training RSS measurements can be consideredas a class. We want then to build for each location i, the ellipsoid that contains allthe measurements of that class and keep outside all the other measurements. Thecomputation consists of solving a SDP optimization problem and due to prohibitivememory requirements, alternative formulations have been searched.

The best solution is given by the application of the A∗ algorithm, which permitto compute the distances between all the survey locations using a binary map ofthe environment, taking into account the walls and the obstacles. Setting a param-eter DMAX, for each ith location only the survey locations that has a distanceless than DMAX meters are considered and only these are used to compute thecorresponding ith ellipsoid. In this way, since only a restricted number of locationsare taken into account, the number of variables and constraints to optimize is stillreasonable, also when large buildings are treated, for example airports.

Finally, the proposed method was evaluated using real data from a mall envi-ronment in Malmo and shown to be effective, compared to the existing Gaussianapproach. Although, the ellipsoid method together with the A∗ algorithm seems tobe a promising solution to the wireless positioning problem, the algorithm is stillat early stages and many issues are still open.

Future research directions will include the dependence of the ellipsoids on thedistances between the survey locations and the implementation of the final algorithmon handheld devices, such as cellphones.

49

Page 55: Wireless Positioning using Ellipsoidal Constraints

BIBLIOGRAPHY

[1] Scanning Special Issue/Technology on Global Positioning System, vol. 87, Proc.IEEE, January 1999.

[2] A. Kushki, K. N.Plataniotis, and A. N. Venetsanopoulos, “Kernel-Based Position-ing in Wireless Local Area Networks,” IEEE Trans. on Mobile Computing, vol. 6,pp. 689 –705, June 2007.

[3] S.-H. Fang and T.-N. Lin, “Projection-Based Location System via Multiple Dis-criminant Analysis in Wireless Local Area Networks,” IEEE Trans on VehicularTechnology, vol. 58, pp. 5009–5019, Nov. 2009.

[4] L. Xiao and L. Deng, “A geometric perspective of large-margin training of gaus-sian models,” Signal Processing Magazine, IEEE, vol. 27, pp. 118 –123, Nov. 2010.

[5] P. Lester, “A* pathfinding for beginners.”http://www.policyalmanac.org/games/aStarTutorial.htm, July 2005.

[6] P. E. Hart, N. J. Nilsson, and B. Raphael, “A formal basis for the heuristicdetermination of minimum cost paths,” IEEE Transactions on Systems Scienceand Cybernetics, vol. 4, pp. 100 –107, July 1968.

50