Tutorials › Multivariate Statistics (Graduate) › Simplicial Depth Ranks and Group Separation

Ranks and Nonparametric Methods · Tutorial 767 of 975

Simplicial Depth Ranks and Group Separation

Learn to compute simplicial depth and pooled depth ranks, then interpret their use in comparing multivariate groups.

Advanced 12 min read

What You'll Learn

  • Define simplicial depth as the probability a random simplex contains a specified point.
  • Compute sample simplicial depth by counting containing simplices.
  • Derive the one-dimensional depth formula for continuous distributions.
  • Construct centrality-oriented midranks from sample depth values.
  • Compare groups using depths computed relative to their pooled sample.
  • Recognize how ties, group sizes, and pooled reference geometry affect interpretation.

Why Simplicial Depth Uses Simplexes

In one dimension, an interval gives a natural way to ask whether a point lies among typical observations. In higher dimensions, a simplex—the triangle in two dimensions, or its higher-dimensional analogue—provides a corresponding geometric reference. Simplicial depth measures how often a point is captured by a simplex whose vertices are random observations. A point contained in many such simplexes is relatively central with respect to the distribution; a point contained in few is relatively peripheral.

Unlike a rank based on a single coordinate, simplicial depth uses the joint geometry of the observations. The direction and shape of a cloud therefore matter. Depth is an ordering device, not a complete description of a distribution: different points can have the same depth, and a depth value alone does not identify a unique location or group difference.

Definition: Let \(P\) be a probability distribution on \(\mathbb{R}^d\), and let \(X_1,\ldots,X_{d+1}\) be independent random vectors, each with distribution \(P\). The population simplicial depth of \(x\in\mathbb{R}^d\) is $$ D_S(x;P)=P\{x\in\operatorname{conv}(X_1,\ldots,X_{d+1})\}, $$ where \(\operatorname{conv}\) denotes the convex hull. For a sample \(X_1,\ldots,X_n\), with \(n\ge d+1\), the sample simplicial depth of \(x\) is $$ D_{S,n}(x)=\frac{1}{\binom{n}{d+1}} \sum_{1\le i_1<\cdots<i_{d+1}\le n} \mathbf{1}\{x\in\operatorname{conv}(X_{i_1},\ldots,X_{i_{d+1}})\}. $$ The sample definition uses each subset of \(d+1\) distinct observations once. The convex hull is taken to include its boundary.

The probability definition permits repeated values among independent draws if \(P\) has atoms. The sample definition, in contrast, selects distinct observation indices; tied observation values can still occur, and degenerate simplexes are allowed. These conventions make the definition usable without imposing a general-position condition. Such a condition may simplify geometric computations, but it is not needed to define depth.

Depth and Ranks in One Dimension

When \(d=1\), a simplex formed from two observations is the interval between them. If \(P\) is continuous with distribution function \(F\), the population depth has a simple expression. The interval contains \(x\) exactly when one draw is at or below \(x\) and the other is at or above \(x\). Continuity gives \(P(X_i=x)=0\), so

$$ D_S(x;P)=1-F(x)^2-\{1-F(x)\}^2 =2F(x)\{1-F(x)\}. $$

This formula is largest at \(F(x)=1/2\), where the depth is \(1/2\), and decreases toward either tail. For a sample of distinct ordered values \(X_{(1)}<\cdots<X_{(n)}\), the sample depth at \(X_{(k)}\) can also be counted directly. Of the \(\binom{n}{2}\) pairs, a pair fails to span \(X_{(k)}\) only if both observations lie strictly below it or both lie strictly above it. Thus

$$ D_{S,n}(X_{(k)})= \frac{\binom{n}{2}-\binom{k-1}{2}-\binom{n-k}{2}} {\binom{n}{2}}. $$

Worked Example: Computing a One-Dimensional Sample Depth

Suppose the ordered sample is \(2,5,8,11,14\). There are \(\binom{5}{2}=10\) pairs. For the observation \(8=X_{(3)}\), a pair fails to contain 8 only if both values are below 8 or both are above 8. There is one pair below, \((2,5)\), and one pair above, \((11,14)\). Therefore eight pairs contain 8:

$$ D_{S,5}(8)=\frac{10-1-1}{10}=\frac{8}{10}=0.8. $$

At the smallest observation, 2, every containing pair must include 2, so there are four such pairs and \(D_{S,5}(2)=4/10=0.4\). The middle observation is deeper than the endpoint in this sample. The calculation depends on the pair spanning the point, not on the numerical distance between the observations.

For multivariate samples, the same principle applies, but the counted objects are \((d+1)\)-vertex simplexes. To turn depth values into ranks, compute each observation's depth relative to a specified reference sample. A convenient convention gives larger scores to deeper observations and handles tied depths by midranks.

Definition: Given depth values \(d_i\) for \(i=1,\ldots,n\), define the normalized centrality midrank of observation \(i\) as $$ R_i=\frac{\#\{j:d_j<d_i\}+\tfrac12\#\{j:d_j=d_i\}}{n}. $$ Thus larger depth gives a larger centrality rank; observations tied in depth receive the same midrank. If all depths are equal, each score is \(1/2\). A rank comparison is meaningful only after specifying which sample was used to calculate the depths.

Worked Example: Counting Triangles in a Planar Sample

Take four sample points forming a square: \(A=(0,0)\), \(B=(1,0)\), \(C=(1,1)\), and \(D=(0,1)\). There are \(\binom{4}{3}=4\) triangles. Find the sample simplicial depth of \(x=(0.4,0.5)\).

The four triangles are formed by omitting one square vertex at a time. If \(A\) is omitted, the triangle lies on the side \(u+v\ge 1\) of the diagonal from \(B\) to \(D\). Since \(0.4+0.5=0.9<1\), it does not contain \(x\). If \(B\) is omitted, the triangle has vertices \(A,C,D\); \(x\) lies inside it because \(0.4\le 0.5\), placing it on the \(u\le v\) side of the diagonal from \(A\) to \(C\). If \(C\) is omitted, the triangle \(A,B,D\) contains \(x\), since \(0.4+0.5=0.9\le1\). If \(D\) is omitted, the triangle lies on the \(v\le u\) side of the diagonal from \(A\) to \(C\), which \(x\) does not satisfy. Exactly two of the four triangles contain \(x\), so

$$ D_{S,4}(x)=\frac{2}{4}=0.5. $$

This example uses the boundary-inclusive convention, though \(x\) is not on any of the relevant boundaries. In other configurations a query point may lie on a triangle edge; that triangle counts as containing it.

Two Properties That Support Interpretation

The sample depth is a direct empirical version of the population probability. Under independent sampling, its expectation equals the population depth. This statement needs no density assumption or general-position condition.

Result: If \(X_1,\ldots,X_n\) are independent and identically distributed from \(P\), and \(n\ge d+1\), then for every fixed \(x\in\mathbb{R}^d\), $$ E[D_{S,n}(x)]=D_S(x;P). $$

Proof. Write \(h_x(X_{i_1},\ldots,X_{i_{d+1}})\) for the indicator that the simplex formed by the indexed observations contains \(x\). By the definition of sample depth and linearity of expectation,

$$ E[D_{S,n}(x)] =\frac{1}{\binom{n}{d+1}} \sum_{i_1<\cdots<i_{d+1}} E[h_x(X_{i_1},\ldots,X_{i_{d+1}})]. $$

For every subset of \(d+1\) distinct indices, the corresponding observations are independent with common distribution \(P\). Each expectation in the sum is therefore \(P\{x\in\operatorname{conv}(X_1,\ldots,X_{d+1})\}=D_S(x;P)\). There are exactly \(\binom{n}{d+1}\) terms, so their average is \(D_S(x;P)\). \(\square\)

Simplicial depth also respects changes of coordinates that are invertible affine transformations. This matters because the definition is geometric rather than tied to a particular origin or coordinate system.

Result: Let \(T(z)=Az+b\), where \(A\) is a nonsingular \(d\times d\) matrix and \(b\in\mathbb{R}^d\). If \(P_T\) is the distribution of \(T(X)\) for \(X\sim P\), then $$ D_S(Tx;P_T)=D_S(x;P). $$ For a transformed sample, the corresponding sample depths are also equal.

Proof. For any points \(z_1,\ldots,z_{d+1}\), an affine map sends their convex hull to the convex hull of their images: \(T\{\operatorname{conv}(z_1,\ldots,z_{d+1})\} =\operatorname{conv}(Tz_1,\ldots,Tz_{d+1})\). Because \(T\) is one-to-one, \(x\) belongs to the first convex hull if and only if \(Tx\) belongs to the second. Applying this equivalence to independent observations from \(P\) and their transformed versions gives equal probabilities. Applying it to every subset of a fixed sample gives equal sample depths as well. \(\square\)

Using Pooled Depth Ranks to Compare Groups

For a descriptive comparison of groups, calculate each observation's depth relative to the pooled observations, then compare the resulting depth distributions or group summaries. This uses a common geometric reference: a high pooled depth rank means that an observation is relatively central among the combined sample. A group with generally lower pooled depths lies more often toward the periphery of that pooled configuration.

The comparison concerns centrality relative to the pooled data, not a universal notion of separation. In particular, lower pooled depth does not by itself establish a statistically significant group difference. The inferential procedures for testing depth-based group differences require additional design and calibration considerations.

Worked Example: Comparing Pooled Centrality in Two Groups

Consider eight distinct one-dimensional observations in increasing order. The first three belong to group A, and the last five to group B. Because there are \(\binom{8}{2}=28\) pairs, the sample depths at ordered positions \(k=1,\ldots,8\), using the earlier counting formula, are

$$ \left(\frac{7}{28},\frac{13}{28},\frac{18}{28}, \frac{22}{28},\frac{22}{28},\frac{18}{28}, \frac{13}{28},\frac{7}{28}\right). $$

For example, at \(k=3\), \(28-\binom{2}{2}-\binom{5}{2}=28-1-10=17\) would appear to be the count, so check the formula carefully: the number below position 3 is 2 and the number above is 5, hence the count is \(28-1-10=17\). The full correct sequence is therefore

$$ \left(\frac{7}{28},\frac{13}{28},\frac{17}{28}, \frac{19}{28},\frac{19}{28},\frac{17}{28}, \frac{13}{28},\frac{7}{28}\right). $$

The group A depth counts are \(7,13,17\), with mean \(37/3\) pairs out of 28. Group B counts are \(19,19,17,13,7\), with mean \(75/5=15\) pairs out of 28. Thus the average pooled depth is \(37/84\approx0.440\) in group A and \(15/28\approx0.536\) in group B. Under the stated centrality-rank convention, the observations at positions 4 and 5 are tied at the maximum depth, and the midranks likewise assign tied observations the same score. Group B is more central on average in this pooled reference, although both groups include peripheral observations. This is a descriptive comparison; the different group sizes and the particular pooled arrangement are part of its interpretation.

Common Pitfalls and Practical Meaning

A tempting but incorrect shortcut is to treat the depth of a point as the proportion of sample observations near it. Simplicial depth is not a nearest-neighbor count: it is a proportion of \((d+1)\)-observation simplexes that contain the point. A point can be close to many observations yet lie outside most of the simplexes they form, or be farther from individual observations but still lie in many convex hulls. The correction is to follow the definition and count containing simplexes.

Another mistake is to calculate group A depths relative to group A and group B depths relative to group B, then compare the values as if they shared a reference. Those calculations answer different geometric questions. For a pooled centrality comparison, calculate both groups' depths relative to the same pooled sample. Also state how ties are handled: equal depths do not justify an arbitrary ordering, and midranks preserve their equality.

Simplicial depth ranks are useful when a multivariate ordering is needed without reducing observations to one coordinate. They can summarize which group tends to occupy more central positions in a pooled cloud and which tends toward its outskirts. But a rank summary discards geometric detail: two groups may have similar depth ranks while differing in orientation, spread, or shape. Interpret ranks alongside the data configuration and the question being asked, rather than treating them as a complete account of group separation.

Key takeaway: Simplicial depth is a probability or sample proportion of simplexes containing a point. For a group comparison based on centrality ranks, calculate all depths against a common pooled reference, report the tie convention, and interpret the result as a geometric summary rather than an automatic test of separation.

Check Your Understanding

Answer each question using the definitions and counting arguments above.

  1. In \(\mathbb{R}^d\), how many independently drawn vertices define a simplex in the population simplicial depth?
  2. Why does the sample simplicial depth divide by \(\binom{n}{d+1}\), rather than by the number of all ordered selections of vertices?
  3. For a continuous one-dimensional distribution, what is the population simplicial depth at a point with \(F(x)=0.25\)?
  4. What does affine invariance say about depth after an invertible change of coordinates?
  5. Why should both groups use the pooled sample as the reference when their pooled centrality ranks are compared?
Clinical Biostats