This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Hyperplane Distance Depththanks: This work is funded in part by the Natural Sciences and Engineering Research Council of Canada (NSERC).

Stephane Durocher Department of Computer Science, University of Manitoba, {stephane.durocher,amirhossein.mashghdoust}@umanitoba.ca    Amirhossein Mashghdoust22footnotemark: 2
Abstract

Depth measures quantify central tendency in the analysis of statistical and geometric data. Selecting a depth measure that is simple and efficiently computable is often important, e.g., when calculating depth for multiple query points or when applied to large sets of data. In this work, we introduce Hyperplane Distance Depth (HDD), which measures the centrality of a query point qq relative to a given set PP of nn points in d\mathbb{R}^{d}, defined as the sum of the distances from qq to all (nd)\binom{n}{d} hyperplanes determined by points in PP. We present algorithms for calculating the HDD of an arbitrary query point qq relative to PP in O(dlogn)O(d\log n) time after preprocessing PP, and for finding a median point of PP in O(dnd2logn)O(dn^{d^{2}}\log n) time. We study various properties of hyperplane distance depth, and show that it is convex, symmetric, and vanishing at infinity.

1 Introduction

Depth measures describe central tendency in statistical and geometric data. A median of a set of univariate data is a point that partitions the set into two halves of equal cardinality, with smaller values in one part, and larger values in the other. Various definitions of medians exist in higher dimensions (multivariate data), seeking to generalize the one-dimensional notion of median (e.g., [6]). For geometric data and sets of geometric objects, applications of median-finding include calculating a centroid, determining a balance point in physical objects, and defining cluster centers in facility location problems [7]. A median is frequently used in statistics to describe the central tendency of a data set. It is particularly useful when dealing with skewed distributions or datasets that contain outliers. By using a median, analysts can obtain a representative value that is less affected by extreme values and outliers [10].

In 1975, Tukey introduced the concept of data depth for evaluating centrality in bivariate data sets [12]. The depth of a particular query point qq in relation to a given set PP gauges the extent to which qq is situated within the overall distribution of PP; i.e., when qq’s depth is large, qq tends to be near the center of PP. Since the introduction of Tukey depth (also called half-space depth), many more depth functions have been proposed.

Data depth functions should ideally satisfy specific properties, such as convexity, stability (small perturbations in the data do not result in large changes in depth values), robustness (depth is not heavily influenced by outliers or extreme values in the data), affine invariance (the depth function remains consistent under linear transformations of the data, such as translation, scaling, and rotation), maximality at the center (points closer to the geometric center of the data set have higher depth values), and vanishing at infinity (depth values approach zero as a query point moves away from the data set) [14].

2 Related Work

Tukey [12] first introduced the concept of location depth. In 2\mathbb{R}^{2}, the Tukey depth of a point qR2q\in{R}^{2} relative to a set PP of nn points in 2\mathbb{R}^{2} is defined as the smallest number of points of PP on one side of a line passing through qq. This concept can also be generalized to higher dimensions.

Definition 1 (Tukey Depth [12])

The Tukey depth of a point qdq\in\mathbb{R}^{d} relative to a set PP of points in d\mathbb{R}^{d}, is the minimum number of points of PP in any closed half-space that contains qq.

In univariate space, e.g., in \mathbb{R}, the Tukey depth of qq is determined by considering the minimum of the count of points piPp_{i}\in P where pi<qp_{i}<q, and the count of points piPp_{i}\in P where pi>qp_{i}>q.
A Tukey median of a set PP in d\mathbb{R}^{d} corresponds to a point (or points) with maximum Tukey depth among all points in d\mathbb{R}^{d}.

Since Tukey’s introduction of Tukey depth, several other important depth functions have been defined to measure the centrality of qq relative to PP.

Definition 2 (Mahalanobis Depth [9])

The Mahalanobis depth of a point qdq\in\mathbb{R}^{d} relative to a set P{P} in d\mathbb{R}^{d} is defined as [1+(qq¯)TPd1(qq¯)]1{[1+{(q-\bar{q})}^{T}{P_{d}}^{-1}(q-\bar{q})]}^{-1}, where q¯\bar{q} and PdP_{d} are the mean vector and dispersion matrix of PP.

This function lacks robustness, as it relies on non-robust measures like the mean and the dispersion matrix. Another possible disadvantage of Mahalanobis depth is its reliance on the existence of second moments [9].

Definition 3 (Convex Hull Peeling Depth [2])

The convex hull peeling depth of a point qdq\in\mathbb{R}^{d} relative to a set P{P} in d\mathbb{R}^{d} is the level of the convex layer to which qq belongs.

A convex layer is established by recursively removing points on the convex hull boundary of PP until qq is outside the hull. Begin by constructing the convex hull of PP. Points of PP on the boundary of the hull constitute the initial convex layer and are removed. Then, form the convex hull anew with the remaining points of PP. The points along this new hull’s boundary constitute the second convex layer. This iterative process continues, generating a sequence of nested convex layers. The deeper a query point qq resides within PP, the deeper the layer it belongs to. However, the method of convex hull peeling depth possesses certain drawbacks. It fails to exhibit robustness in the presence of outliers or noise. Additionally, it’s unfeasible to associate this measure with a theoretical distribution.

Definition 4 (Oja Depth [11])

The Oja depth of a point qdq\in\mathbb{R}^{d} relative to a set P{P} in d\mathbb{R}^{d} is defined as the sum of the volumes of every closed simplex having one vertex at qq and its remaining vertices at any points of PP.

In 2\mathbb{R}^{2}, the Oja depth of a point qq is the sum of the areas of all triangles formed by the vertices qq,pip_{i}, and pjp_{j}, where {pi,pj}P\{p_{i},p_{j}\}\subseteq P.

Definition 5 (Simplicial Depth [8])

The simplicial Depth of a point qdq\in\mathbb{R}^{d} relative to a set P{P} in d\mathbb{R}^{d} is defined as the number of closed simplices containing qq and having d+1d+1 vertices in PP.

The simplicial depth of a point q2q\in\mathbb{R}^{2} is the number of triangles with vertices in PP and containing qq. This is a common measure of data depth.

Definition 6 (L1L_{1} Depth [13])

The L1L_{1} depth of a point qdq\in\mathbb{R}^{d} relative to a set P{P} in d\mathbb{R}^{d} is defined as piPpiq1\sum_{p_{i}\in P}{||p_{i}-q||}_{1}.

The L1L_{1} Median is the point that minimizes the sum of the absolute distances (also known as the L1L_{1} norm or Manhattan distance) to all other points in PP. The key advantage of the L1L_{1} Median is its robustness to outliers. It is less sensitive to extreme values in the dataset compared to the L2L_{2} Median, which minimizes the sum of squared distances. As a result, the L1L_{1} Median can provide a more accurate estimate of central tendency in datasets with outliers or heavy-tailed distributions. The L1L_{1} Median is used in various fields, including finance, image processing, and robust statistics, whenever there is a need for a robust estimate of the central location of a dataset that may contain atypical values.

Definition 7 (L2L_{2} Depth [14])

The L2L_{2} depth (mean) of a point qdq\in\mathbb{R}^{d} relative to a set P{P} in d\mathbb{R}^{d} is defined as piPpiq2\sum_{p_{i}\in P}{||p_{i}-q||}^{2}.

The L2L_{2} Median is the point that minimizes the sum of the squared Euclidean distances. The mean is a widely used measure of central tendency in statistics and data analysis. The mean is not robust to outliers; a single outlier can pull the mean arbitrarily far.

Definition 8 (Fermat-Weber Depth [4])

The Fermat-Weber depth (Geometric depth) of a point qdq\in\mathbb{R}^{d} relative to a set P{P} in d\mathbb{R}^{d} is defined as piPpiq\sum_{p_{i}\in P}{||p_{i}-q||}.

A deepest point (median) with respect to Fermat-Weber depth cannot be calculated exactly in general when d2d\geq 2 and |P|5|P|\geq 5 [1].

There is no single depth function that universally outperforms all others. The choice of a particular depth function often depends on its suitability for a specific dataset or its ease of computation. Nevertheless, there are several desirable properties that all data depth functions should ideally possess. In Section 3, we introduce a new depth measure, and we examine which of these properties it satisfies.

3 Results

In this section, we will introduce the Hyperplane Distance Depth (HDD) measure and study its properties.

3.1 Defintion

Definition 9 (Hyperplane distance depth)

The Hyperplane distance depth (HDD) of a point qdq\in\mathbb{R}^{d} relative to a set P{P} in d\mathbb{R}^{d} is defined as

DP(q)=hiHPdist(q,hi),D_{P}(q)=\sum_{h_{i}\in H_{P}}\operatorname{dist}(q,h_{i}), (1)

where HPH_{P} is the set of all (nd)\binom{n}{d} (d1)(d-1)-dimensional hyperplanes determined by points in PP, and dist(q,hi)\operatorname{dist}(q,h_{i}) denotes the Euclidean (L2L_{2}) distance from the point qq to the hyperplane hih_{i}.

Both Fermat-Weber depth and hyperplane distance depth are defined as sums of Euclidean (L2L_{2}) distances. Unlike Fermat-Weber depth, for which the location of a median cannot be computed exactly in general when d2d\geq 2 [1], as we show in Section 4, the location of a HDD median can be computed exactly.

3.2 Properties

Theorem 3.1.

In \mathbb{R}, the HDD median relative to the set P{P} coincides with the usual univariate definition of median.

Proof 3.2.

By Definition 9, the median is a point that minimizes the sum of the distances to all possible points passing through each point in PP. Therefore, HP=PH_{P}=P. Consequently, the HDD median is equivalent to the usual definition of median in a one-dimensional space.

Theorem 3.3.

The HDD function DP(q)D_{P}(q) relative to the set P{P} is convex over qdq\in\mathbb{R}^{d}.

Proof 3.4.

The distance function dhi(q){d_{h_{i}}(q)} from a query point qq to the hyperplane hih_{i} is convex. Any non-negative linear combination of convex functions is convex. Therefore, the HDD function hiHPdhi(q)=DP(q)\sum_{h_{i}\in H_{P}}{d_{h_{i}}(q)}=D_{P}(q) is convex over qq.

Theorem 3.5.

The HDD median point relative to the set P{P} of points in d\mathbb{R}^{d} is always on one of the intersection points between dd hyperplanes in HPH_{P}.

Proof 3.6.

The distance from the point qdq\in\mathbb{R}^{d} to a hyperplane hih_{i} is equal to dhi(q)=|wi.q+bi|wi{d_{h_{i}}(q)}=\frac{|{w_{i}}.q+{b_{i}}|}{\|{w_{i}}\|} where wiw_{i} and bib_{i} are the hyperplane’s normal vector and the offset respectively. Therefore, the HDD of the point qq is equal to

DP(q)=hiHPdhi(q)=hiHP|wi.q+bi|wiD_{P}(q)=\sum_{h_{i}\in H_{P}}{d_{h_{i}}(q)}=\sum_{h_{i}\in H_{P}}\frac{|{w_{i}}.q+{b_{i}}|}{\|{w_{i}}\|} (2)

Depending on the position of qq with respect to hih_{i}, dhi(q)=|wi.q+bi|wi{d_{h_{i}}(q)}=\frac{|{w_{i}}.q+{b_{i}}|}{\|{w_{i}}\|} can be equal to +wi.q+biwi+\frac{{w_{i}}.q+{b_{i}}}{\|{w_{i}}\|} (above the hyperplane) ,wi.q+biwi-\frac{{w_{i}}.q+{b_{i}}}{\|{w_{i}}\|} (below the hyperplane), or 0 (on the hyperplane). Therefore, for any point qq we have

hiHPdhi(q)=hiHPgi,qwi.q+biwigi,q={+1,if q is above hi1,if q is below hi0,if q is on hi\begin{split}&\sum_{h_{i}\in H_{P}}{d_{h_{i}}(q)}=\sum_{h_{i}\in H_{P}}g_{i,q}\frac{{w_{i}}.q+{b_{i}}}{\|{w_{i}}\|}\\ &g_{i,q}=\begin{cases}+1,&\text{if $q$ is above $h_{i}$}\\ -1,&\text{if $q$ is below $h_{i}$}\\ 0,&\text{if $q$ is on $h_{i}$}\\ \end{cases}\end{split} (3)

It is worth noting that the derivative of the equation (3) exists if qq is not on any of the hyperplanes in HPH_{P} (gi,q0g_{i,q}\neq 0). Now to find the HDD median with the minimum HDD measure, we should compute the derivative with respect to qq and see where it will be equal to 0. For any query point qq inside a region bounded by some HPH_{P} hyperplanes and not on any HPH_{P} hyperplanes (Figure 1) we have

ddqDP(q)=ddqhiHPgi,qwi.q+biwi=hiHPgi,qwiwi\begin{split}\frac{d}{dq}D_{P}(q)&=\frac{d}{dq}\sum_{h_{i}\in H_{P}}g_{i,q}\frac{{w_{i}}.q+{b_{i}}}{\|{w_{i}}\|}\\ &=\sum_{h_{i}\in H_{P}}g_{i,q}\frac{{w_{i}}}{\|{w_{i}}\|}\end{split} (4)
Refer to caption
Figure 1: Example of HDD in two dimensions: P={P0,P1,P2,P3}P=\{P_{0},P_{1},P_{2},P_{3}\} is the set of input points, I={I0,I1,I2}I=\{I_{0},I_{1},I_{2}\} is the set of intersection points, and qq is the query point.

Equation (4) above cannot be equal to 0 in general since there are no variables (4). This means the assumption we made about the query point not being on the hyperplanes in HPH_{P} was incorrect. Therefore, we can say the median is surely on one of the hyperplanes. If qq is on hjh_{j}, wj.q+bj{w_{j}}.q+{b_{j}} will be equal to 0. Therefore, we can say

ddqDP(q)\displaystyle\frac{d}{dq}D_{P}(q) =ddqhiHP{hj}gi,qwi.q+biwi\displaystyle=\frac{d}{dq}\sum_{h_{i}\in H_{P}-\{h_{j}\}}g_{i,q}\frac{{w_{i}}.q+{b_{i}}}{\|{w_{i}}\|}
=hiHP{hj}gi,qwiwi.\displaystyle=\sum_{h_{i}\in H_{P}-\{h_{j}\}}g_{i,q}\frac{{w_{i}}}{\|{w_{i}}\|}. (5)

Using the same logic we can conclude that the median point should be on another hyperplane in addition to hjh_{j}. We can repeat these steps dd times and after that, it will be proved that the median should be on the intersection point of dd hyperplane (that will be a single point), thus the median will be on one of the intersection points.

Theorem 3.7.

The HDD median point relative to the set P{P} in d\mathbb{R}^{d} is always in the convex hull of the input points PP.

Proof 3.8.

Let Dpi(q)D^{\prime}_{p_{i}}(q) be the sum of the distances to all the hyperplanes in HPH_{P} passing through the point pip_{i}. The minimum of this convex function is always on the point pip_{i} where the HDD is equal to 0. On the other hand, since each hyperplane includes dd input points from PP, we have DP(q)=dpiPDpi(q)D_{P}(q)=d\sum_{p_{i}\in P}{D^{\prime}_{p_{i}}(q)}.
Now consider a point qoq_{o} outside of the convex hull. by computing the gradient of DP(qo)D_{P}(q_{o}), we will show that by moving qoq_{o} closer to the convex hull, the HDD gets smaller. Using the equation above we have HP(qo)=dpiPDpi(qo)-\nabla H_{P}(q_{o})=-d\sum_{p_{i}\in P}\nabla{D^{\prime}_{p_{i}}(q_{o})}. Since the minimum of the function Dpi(q)D^{\prime}_{p_{i}}(q) is on pip_{i}, Dpi(q)-\nabla D^{\prime}_{p_{i}}(q) is a vector pointing to pip_{i} for piPp_{i}\in P. Therefore we can conclude that for every point qoq_{o} outside of the convex hull, HP(qo)-\nabla H_{P}(q_{o}) points to the convex hull that means by moving toward that direction, the HDD decreases. Therefore the HDD median is always in the convex hull of PP.

Theorem 3.9.

The HDD median point relative to the set P{P} in d\mathbb{R}^{d} is always at the center of symmetry.

Proof 3.10.

Let pMp_{M} be the median of the PP s.t. PP is symmetric. If pMp_{M} is not on the center of symmetry, consider pM{p^{\prime}}_{M}, the reflection of pMp_{M} across the center of symmetry. Because of the symmetry, it is trivial that the HDD measure of both points is equal. Since the median point has the minimum depth measure among the other points and the depth measure function is convex, all the points on the line segment pmpMp_{m}{p^{\prime}}_{M} should have a depth measure equal to the median. Therefore, the median is always at the center of symmetry.

Theorem 3.11.

The HDD measure relative to the set P{P} in d\mathbb{R}^{d} vanishes as we move the query point to infinity.

Proof 3.12.

As we move the query point qq to infinity, it is straightforward that there exists a hyperplane hiHPh_{i}\in H_{P} that gets further from qq. Since we can move qq arbitrarily far from hih_{i}, and the distance from qq to the remaining hyperplanes in HPH_{P} is non-negative, therefore HDD vanishes at infinity.

Note that some measures of depth are defined such that deep points have high depth values and outliers have low depth values, whereas this property is reversed for other depth measures. HDD is of the latter type, with central points having a low sum of distances to hyperplanes in HPH_{P}, whereas this sum approaches infinity as qq moves away from PP. Consequently, for HDD, “vanishing at infinity” means that depth approaches \infty as opposed to 0.

Theorem 3.13.

The HDD measure relative to the set P{P} in d\mathbb{R}^{d} is not robust.

Proof 3.14.

We will prove this fact using a counter-example in a 2-dimensional space (Figure 2). We can move the HDD median by changing the location of 2 points which means the HDD is not robust. The median is always on one of the intersection points and we can place the points in a way that I0I_{0} is always the median (Figure 2). We will compute the depth measures for the points I0I_{0} (5) and IiI_{i} (7), where IiI_{i} is an arbitrary intersection point except I0I_{0}.

Refer to caption
Figure 2: A counter-example that shows the HDD is not robust
DP(I0)\displaystyle D_{P}(I_{0}) =i[3,n]dlP1Pi(I0)+i[3,n]dlP2Pi(I0)\displaystyle=\sum_{i\in[3,n]}{d_{l_{P_{1}P_{i}}}(I_{0})}+\sum_{i\in[3,n]}{d_{l_{P_{2}P_{i}}}(I_{0})} (6)
DP(Ii)\displaystyle D_{P}(I_{i}) =i[3,n]dlP1Pi(Ii)+i[3,n]dlP2Pi(Ii)\displaystyle=\sum_{i\in[3,n]}{d_{l_{P_{1}P_{i}}}(I_{i})}+\sum_{i\in[3,n]}{d_{l_{P_{2}P_{i}}}(I_{i})}
+(n22)dlP3Pn(Ii)+dlP1P2(Ii)\displaystyle+\binom{n-2}{2}d_{l_{P_{3}P_{n}}}(I_{i})+d_{l_{P_{1}P_{2}}}(I_{i}) (7)

Regardless of the I0I_{0} position, we know that I0Hi<I0P2I_{0}H_{i}<I_{0}P_{2} and I0Hi<I0P1I_{0}H^{\prime}_{i}<I_{0}P_{1}. Therefore, we have (Equation (6)):

DP(I0)<(n2)I0P2+(n2)I0P1=(n2)P1P2D_{P}(I_{0})<(n-2)I_{0}P_{2}+(n-2)I_{0}P_{1}=(n-2)P_{1}P_{2} (8)

On the other hand, using Equation (7) we have:

DP(Ii)>dlP1P2(Ii)D_{P}(I_{i})>d_{l_{P_{1}P_{2}}}(I_{i}) (9)

Now by moving the points P1P_{1} and P2P_{2} far enough, let dlP1P2(Ii)=(n2)P1P2+md_{l_{P_{1}P_{2}}}(I_{i})=(n-2)P_{1}P_{2}+m, where mm is a positive number. Therefore, we have (inequality 9):

DP(Ii)>(n2)P1P2+mD_{P}(I_{i})>(n-2)P_{1}P_{2}+m (10)

Combining the inequality 8 and 10 we have DP(Ii)>DP(I0)D_{P}(I_{i})>D_{P}(I_{0}).

Consequently, I0I_{0} is the median. By increasing mm, the median I0I_{0} gets as far as we want. This means by moving P1P_{1} and P2P_{2}, we can move the median point as much as we want.

Definition 3.15 (kk-stability [5]).

A depth measure DD is kk-stable if for all points qq in d\mathbb{R}^{d}, all sets PP in d\mathbb{R}^{d}, all ϵ>0\epsilon>0, and all functions fϵ:ddf_{\epsilon}:\mathbb{R}^{d}\to\mathbb{R}^{d} such that p\forall p, dist(p,f(p))ϵ\operatorname{dist}(p,f(p))\leq\epsilon,

k|D(q,P)D(fϵ(q),fϵ(P)|ϵ,k\cdot|D(q,P)-D(f_{\epsilon}(q),f_{\epsilon}(P)|\leq\epsilon, (11)

where fϵ(P)={fϵ(p)pP}f_{\epsilon}(P)=\{f_{\epsilon}(p)\mid p\in P\}.

That is, for any ϵ\epsilon-perturbation of PP and qq, the depth of qq relative to PP changes by at most kϵk\epsilon.

Theorem 3.16.

The HDD measure relative to the set P{P} in d\mathbb{R}^{d} is not kk-stable for any constant kk.

Proof 3.17.

Choose any k>0k>0 and let n=max{1,1/k+1}n=\max\{1,\lceil 1/k\rceil+1\}. Let PP be a set of nn points in \mathbb{R} and let qq\in\mathbb{R} lie to the left of PP. By moving all points of PP one unit to the right (ϵ=1\epsilon=1), the hyperplane depth of qq relative to PP increases by a factor of nn, regardless of kk. Thus HDD is not kk-stable.

Theorem 3.18.

The HDD function DP(q)D_{P}(q) relative to the set P{P} in d\mathbb{R}^{d} is not equivariant under affine transformations.

Proof 3.19.

We will prove this theorem using a counter-example. Consider the set of points P={p0(0,0),p1(4,0),p2(2,1)}P=\{p_{0}(0,0),p_{1}(4,0),p_{2}(2,1)\}. Using Theorem 3.5 we can show that the median is on point p2(2,1)p_{2}(2,1). Now consider the set P={p0(0,0),p1(4,0),p2(2,5)}P^{\prime}=\{p^{\prime}_{0}(0,0),p^{\prime}_{1}(4,0),p^{\prime}_{2}(2,5)\} that is PP under the non-uniform affine transformation matrix [1005]\begin{bmatrix}1&0\\ 0&5\end{bmatrix}. Using theorem 3.5 and 3.9 It can be shown that the median is on the line p0p1p^{\prime}_{0}p^{\prime}_{1} now. This means that the HDD median is not equivariant under affine transformation.

As we now show, HDD is equivariant under similarity transformations, including translation, rotation, reflection and uniform scaling, since these preserve the shape of PP.

Theorem 3.20.

The HDD function DP(q)D_{P}(q) relative to the set P{P} in d\mathbb{R}^{d} is equivariant under the similarity transformations.

Proof 3.21.

For any rotation, reflection, or translation transformation ff, the distance from the query point qq to any hyperplane hih_{i} remains unchanged. That is, for any point qq and any hyperplane hih_{i}, dist(q,hi)=dist(f(q),f(hi))\operatorname{dist}(q,h_{i})=\operatorname{dist}(f(q),f(h_{i})).

For any uniform scaling transformation ff with a scaling factor of kk, distances between each pair of points will be multiplied by kk after the transformation. Therefore it is easy to show that, for any query point qq, the HDD will be multiplied by kk after uniform transformation. Therefore, the median is equivariant under the uniform scaling transformation.

4 Algorithms

In this section, we provide three algorithms: a) to compute HDD depth queries in O(dlogn)O(d\log n) time after O(n2d2+2d)O(n^{2d^{2}+2d}) preprocessing time, b) to find an HDD median point in O(dnd2logn)O(dn^{d^{2}}\log n) time, and c) to find an approximate HDD median. Let PP be a set of nn points in d\mathbb{R}^{d}, and let HPH_{P} be the set of (nd)\binom{n}{d} hyperplanes determined by dd point in PP.

4.1 HDD Query Algorithm

The hyperplane distance depth of a query point qq relative to PP can be computed by directly evaluating Equation (2) in O((nd))=O(nd)O\left(\binom{n}{d}\right)=O(n^{d}) time. We will present an algorithm that can calculate HDD in logarithmic time after preprocessing. First, to measure the HDD of qq, we need to store some coefficients belonging to each polytope formed by hyperplanes in HPH_{P}.

Consider Equation (3). Let SPS_{P} be the set of all minimal polytopes determined by the arrangement of hyperplanes in HPH_{P}. For a query point qkq_{k} in a polytope skSPs_{k}\in S_{P}, the coefficients gi,qg_{i,q} for hiHPh_{i}\in H_{P} are the same. Therefore, for any points qkq_{k} in sks_{k}, we can simplify the summation in (3) in O(nd)O(n^{d}) time and find the 22 coefficients aka_{k} and bkb_{k} such that

DP(qk)=hiHPgi,qkwi.qk+biwi=akqk+bkD_{P}(q_{k})=\sum_{h_{i}\in H_{P}}g_{i,q_{k}}\frac{{w_{i}}.q_{k}+{b_{i}}}{\|{w_{i}}\|}=a_{k}q_{k}+b_{k} (12)

Using Euler’s characteristic theorem we know that there are O(nd2)O(n^{d^{2}}) polytopes formed by the hyperplanes in HH e.g. in Figure 1 there are 1818 polytopes (faces) formed by the 66 hyperplanes (lines). Therefore we will need O(2nd2)O(nd2)O(2n^{d^{2}})\in O(n^{d^{2}}) space and O(nd2nd)O(nd2+d)O(n^{d^{2}}n^{d})\in O(n^{d^{2}+d}) time to preprocess.

Using the mentioned data structure we can calculate the HDD measure in O(1)O(1) time if we know to which polytope the query point belongs.

Given nn hyperplanes in dd-dimensional space and a query point qq, it takes O(logn)O(\log n) time to find the qq location with a data structure of size O(nd)O(n^{d}) and a preprocessing time of O(n2d+2)O(n^{2d+2})[3]. In our problem, there are (nd)O(nd)\binom{n}{d}\in O(n^{d}) hyperplanes. Therefore, with a preprocessing time of (nd)2d+2O(n2d2+2d){\binom{n}{d}}^{2d+2}\in O(n^{2d^{2}+2d}) and a space of O(nd2)O(n^{d^{2}}), we can find the location of qq in O(log(nd))O(dlogn)O\left(\log\binom{n}{d}\right)\in O(d\log n) time.

Now after finding the qq’s location in O(dlogn)O(d\log n), we can calculate the HDD measure DP(qk)D_{P}(q_{k}) in O(1)O(1) using Equation (12).

Therefore, after O(nd2+d+n2d2+2d)O(n2d2+2d)O(n^{d^{2}+d}+n^{2d^{2}+2d})\subseteq O(n^{2d^{2}+2d}) preprocessing time using O(nd2)O(n^{d^{2}}) space, we can find the HDD of an arbitrary query point in O(dlogn)O(d\log n) time. This proves the following theorem.

Theorem 4.1.

We can preprocess any given set PP of nn points in d\mathbb{R}^{d} in O(n2d2+2d)O(n^{2d^{2}+2d}) time, such that given any point qdq\in\mathbb{R}^{d}, we can compute DP(q)D_{P}(q) in O(dlogn)O(d\log n) time.

4.2 Finding a HDD Median

By Theorem 3.5, a straightforward algorithm for finding an HDD median of PP is to check all points of intersection between dd hyperplanes in HPH_{P} using an exhaustive search. There are (nd)\binom{n}{d} hyperplanes in HPH_{P} and therefore ((nd)d)O(nd2)\binom{\binom{n}{d}}{d}\in O(n^{d^{2}}) intersection points between hyperplanes in HPH_{P}. Since it takes O(nd)O(n^{d}) to compute the Equation (2) directly, a HDD median of PP can be found in O(nd2+d)O(n^{d^{2}+d}) time by this brute-force algorithm.

Next, we will introduce an algorithm that finds the HHD median in O(dnd2logn)O(dn^{d^{2}}\log n) time. When d=2d=2, this second algorithm runs in O(n4logn)O(n^{4}\log n) time, compared to O(n6)O(n^{6}) time for the brute-force algorithm. First, we will show that we can find the point with the smallest HDD on a line in O(dndlogn)O(dn^{d}\log n) time. Consider the intersection of d1d-1 hyperplanes in HPH_{P} that determine a line \ell. Since every hyperplane in HPH_{P} has exactly one point of intersection with \ell, HPH_{P}\cap\ell is a set of O(nd)O(n^{d}) points of intersection. By Theorem 3.3, we can conclude that the hyperplane depth of points on \ell is a convex function. Since HPH_{P}\cap\ell is discrete, using binary search and calculating HDD in O(nd)O(n^{d}) time using Equation (2), we can find the intersection point with the minimum HDD in O(ndlog(nd))=O(dndlogn)O(n^{d}\log(n^{d}))=O(dn^{d}\log n) time.

We can use the algorithm above to find the minimum point for each intersection line among hyperplanes in HPH_{P} to find an HDD median. Since each d1d-1 hyperplanes in HPH_{P} form a line, there are ((nd)d1)O(nd2d)\binom{\binom{n}{d}}{d-1}\in O(n^{d^{2}-d}) lines and thus we can find the median in O(dnd2logn)O(dn^{d^{2}}\log n) time. This proves the following theorem.

Theorem 4.2.

Given a set PP of nn points in d\mathbb{R}^{d}, we can find an HDD median of PP in O(dnd2logn)O(dn^{d^{2}}\log n) time.

4.3 Finding an Approximate HDD Median in 𝟐\mathbb{R}^{2}

In this section, we will present an approximation algorithm to find an HDD median of PP with an error of a22m2+1\frac{a\sqrt{2}}{2^{\frac{m}{2}+1}} in O(mn2logn)O(mn^{2}\log n) time, for any fixed m+m\in\mathbb{Z}^{+}, where aa is the diameter of PP.

Theorem 4.3.

Given a set PP of nn points in 2\mathbb{R}^{2}, in O(mn2logn)O(mn^{2}\log n) time we can find a point xx^{\prime} in 2\mathbb{R}^{2} such that dist(x,x)a22m2+1\operatorname{dist}(x^{\prime},x)\leq\frac{a\sqrt{2}}{2^{\frac{m}{2}+1}}, for any fixed m+m\in\mathbb{Z}^{+}, where xx denotes an HDD median of PP and a=maxp,qPdist(p,q)a=\max_{p,q\in P}\operatorname{dist}(p,q).

Proof 4.4.

Let lal_{a} be an arbitrary line among the lines in HPH_{P} (see Figure 3). There are (n2)n\choose 2 lines in HPH_{P} and, consequently, O(n2)O(n^{2}) points of intersection between lal_{a} and lines in HPH_{P}. Using an analogous argument as in the proof of Theorem 3.5, the point with minimum HDD on lal_{a} lies at an intersection of lal_{a} and a line in HPH_{P}. Therefore, using the same algorithm described in Section 4.2, we can find the point imini_{\min} on lal_{a} with minimum HDD in O(n2logn)O(n^{2}\log n) time; let hminh_{\min} denote the line in HPH_{P} such that imin=hminlai_{\min}=h_{\min}\cap l_{a}. Next, we find the closest points of intersection in HPH_{P} to imini_{\min} on the line hminh_{\min} in each direction, say IuI_{u} and IdI_{d}. We compute the HDD for all the three points imini_{\min}, IdI_{d}, and IuI_{u}. Since imini_{\min} has minimum HDD on the line lal_{a}, if DP(imin)<min{DP(Iu),DP(Id)}D_{P}(i_{\min})<\min\{D_{P}(I_{u}),D_{P}(I_{d})\}, then imini_{\min} is the HDD median (by Theorem 3.3). By Theorem 3.3 again, DP(imin)<DP(Iu)D_{P}(i_{\min})<D_{P}(I_{u}) or DP(imin)<DP(Id)D_{P}(i_{\min})<D_{P}(I_{d}). Furthermore, DP(imin)>DP(Iu)D_{P}(i_{\min})>D_{P}(I_{u}) or DP(imin)>DP(Id)D_{P}(i_{\min})>D_{P}(I_{d}). Without loss of generality, suppose DP(Id)<DP(imin)<DP(Iu)D_{P}(I_{d})<D_{P}(i_{\min})<D_{P}(I_{u}). We claim that all points in the half-plane bounded by hminh_{\min} that contains IuI_{u} have HDD that exceeds DP(imin)D_{P}(i_{\min}); we prove this by contradiction. Suppose there exists a point AA in this half-plane such that DP(A)<DP(imin)D_{P}(A)<D_{P}(i_{\min}). Let BB be the intersection point of the line lal_{a} and the line segment AId¯\overline{AI_{d}}. Since imini_{\min} has minimum HDD on the line lal_{a}, therefore, DP(imin)<DP(B)D_{P}(i_{\min})<D_{P}(B). Furthermore, DP(A)<DP(B)D_{P}(A)<D_{P}(B). On the other hand, we assumed DP(Id)<DP(imin)<DP(Iu)D_{P}(I_{d})<D_{P}(i_{\min})<D_{P}(I_{u}) and we know DP(imin)<DP(B)D_{P}(i_{\min})<D_{P}(B). Consequently, DP(Id)<DP(B)D_{P}(I_{d})<D_{P}(B). Combining the two resulting inequalities above, we have DP(A)<DP(B)D_{P}(A)<D_{P}(B) and DP(Id)<DP(B)D_{P}(I_{d})<D_{P}(B), which is impossible since the three points are on the same line and the HDD function is convex. Therefore, no such point AA can exist.

Refer to caption
Figure 3: An algorithm to eliminate the points belonging to a half-space. The blue line lal_{a} is an arbitrary line dividing the space into 2 halves. The dotted gray lines are the lines in HPH_{P}.

Therefore, no point of intersection in HPH_{P} in this half-plane can be an HDD median of PP; in O(n2logn+3n2)O(n2logn)O(n^{2}\log n+3n^{2})\subseteq O(n^{2}\log n) time we can remove these points from consideration in our search for a median.

Now we will use this property to approximate the median point. Firstly, we will find the diameter aa of the input points in O(n)O(n) time and consider an a×aa\times a square that contains PP (see Figure 4). By Theorem 3.7, we know that the median lies inside this square. At each step, we draw the two lines ONON and OMOM that partition the square into four similar smaller squares, each with dimensions a2×a2\frac{a}{2}\times\frac{a}{2}, and we apply the above algorithm to eliminate two half-planes in O(ndlogn)O(n^{d}\log n) time. After mm steps we have a square of dimensions a2m×a2m\frac{a}{2^{m}}\times\frac{a}{2^{m}} and we return its center as an approximation of the HDD median. Since the HDD median is a point inside this square, the error is at most a22m+1\frac{a\sqrt{2}}{2^{m+1}}. The total time complexity of the algorithm is O(mn2logn)O(mn^{2}\log n).

Refer to caption
Figure 4: Illustration in support of Theorem 4.3

This strategy can be generalized to higher dimensions by finding the minimum HDD on an arbitrary hyperplane hah_{a} (analogous to the line lal_{a} in the proof of Theorem 4.3) to eliminate a half-space, but the time complexity of finding the minimum HDD point on hah_{a} is high.

5 Discussion and Possible Directions for Future Research

Our algorithm for computing HDD queries presented in Section 4.1 requires O(nd2)O(n^{d^{2}}) space and O(n2d2+2d)O(n^{2d^{2}+2d}) preprocessing time. One natural possible direction for future research is to identify algorithms with improved preprocessing time or space.

Our algorithm for finding an HDD median presented in Section 4.2 requires O(dnd2logn)O(dn^{d^{2}}\log n) time. In addition to seeking to identify lower bounds on the worst-case running time required to find an HDD median, we could attempt to reduce the running time using techniques such as gradient descent or linear programming.

Our analysis of our algorithm for finding an approximate HDD median presented in Section 4.3 does not capitalize on the fact that the number of candidate points decreases on each step; we charge O(n2logn)O(n^{2}\log n) time per step. If it could be shown that a constant fraction of the remaining points are eliminated on each step, then the bound on the algorithm’s time complexity would be significantly improved.

Finally, we could consider alternative definitions for depth using similar notions to those in Definition 1. E.g., one can define a “line distance depth” that evaluates the distances to all possible lines passing through each pair of points in the set of input points. This definition coincides with Definition 1 when d2d\leq 2, but differs in higher dimensions, for d3d\geq 3.

References

  • [1] C. Bajaj. The algebraic degree of geometric optimization problems. Discrete and Computational Geometry, 3:177–191, 1988.
  • [2] V. Barnett. The ordering of multivariate data. Journal of the Royal Statistical Society: Series A (General), 139(3):318–344, 1976.
  • [3] B. Chazelle and J. Friedman. Point location among hyperplanes and unidirectional ray-shooting. Computational Geometry, 4(2):53–62, 1994.
  • [4] R. Durier and C. Michelot. Geometrical properties of the Fermat-Weber problem. European Journal of Operational Research, 20(3):332–343, 1985.
  • [5] S. Durocher and D. Kirkpatrick. The projection median of a set of points. Computational Geometry: Theory and Applications, 42(5):364–375, 2009.
  • [6] S. Durocher, A. Leblanc, and M. Skala. The projection median as a weighted average. Journal of Computational Geometry, 8(1):78–104, 2017.
  • [7] R. Z. Farahani, M. SteadieSeifi, and N. Asgari. Multiple criteria facility location problems: A survey. Applied mathematical modelling, 34(7):1689–1709, 2010.
  • [8] R. Y. Liu. On a notion of data depth based on random simplices. The Annals of Statistics, pages 405–414, 1990.
  • [9] P. C. Mahalanobis. On the generalized distance in statistics. Sankhyā: The Indian Journal of Statistics, Series A (2008-), 80:S1–S7, 2018.
  • [10] A. T. Murray and V. Estivill-Castro. Cluster discovery techniques for exploratory spatial data analysis. International journal of geographical information science, 12(5):431–443, 1998.
  • [11] H. Oja. Descriptive statistics for multivariate distributions. Statistics & Probability Letters, 1(6):327–332, 1983.
  • [12] J. Tukey. Mathematics and the picturing of data. In Proc. Int. Cong. Math., pages 523–531, 1957.
  • [13] Y. Vardi and C.-H. Zhang. The multivariate l1l_{1}-median and associated data depth. Proceedings of the National Academy of Sciences, 97(4):1423–1426, 2000.
  • [14] Y. Zuo and R. Serfling. General notions of statistical depth function. Annals of statistics, 28(2):461–482, 2000.