Quantiles, Ranks and Signs in Metric Spaces

Hang Liu, Xueqin Wang, Zhu Jin, Zhang, HepingarXiv 2022 · DOI

Abstract

Non-Euclidean data become more prevalent in practice, necessitating the development of a framework for statistical inference analogous to that for Euclidean data. Quantile is one of the most important concepts in traditional statistical inference; we introduce the counterpart, both locally and globally, for data objects in metric spaces. This is realized by expanding upon the metric distribution function proposed by Wang et al. (2021). Rank and sign are defined at local and global levels as a natural consequence of the center-outward ordering of metric spaces brought about by the local and global quantiles. The theoretical properties are established, such as the root-$n$ consistency and uniform consistency of the local and global empirical quantiles and the distribution-freeness of ranks and signs. The empirical metric median, which is defined here as the 0th empirical global metric quantile, is proven to be resistant to contamination by means of both theoretical and numerical approaches. Quantiles have been shown to be valuable through extensive simulations in a number of metric spaces. Moreover, we introduce a family of fast rank-based independence tests for a generic metric space. Monte Carlo experiments show good finite-sample performance of the test.

Introduction

In classical statistics, the natural ordering of the real line allows for the definition of quantiles, ranks, and signs—the fundamental building blocks of nonparametric inference. However, modern data analysis frequently encounters non-Euclidean objects, such as symmetric positive definite (SPD) matrices in medical imaging, phylogenetic trees in biology, or directional data on a sphere. In these spaces, there is no canonical "left-to-right" ordering, making the definition of a median or a rank mathematically ambiguous.

While previous attempts to address this through "data depth" functions exist, they are often computationally prohibitive or restricted to specific geometries. This paper introduces a unified framework for any space where a distance (metric) can be defined, leveraging the Metric Distribution Function (MDF) to establish a robust, center-outward ordering.

The Metric Distribution Framework

The proposed framework relies on two primary constructs: local and global metric quantiles.

Local Metric Quantiles

For any fixed point $u$ within a metric space, a local quantile is defined based on the probability of other data points falling within a specific distance of $u$. This provides a measure of "outlyingness" relative to a specific reference point, allowing for a localized view of data density.

Global Metric Quantiles and the Metric Median

To achieve a comprehensive view of the dataset, the authors aggregate local information into a global quantile function. This is intuitively described as a "popularity" vote: the global quantile of a point $u$ represents its average ranking when evaluated by every other point in the space. The point that minimizes this function—the most central or "popular" point—is defined as the Metric Median.

This approach induces a center-outward ordering. Unlike the linear ordering of the real line, this ordering identifies how "deep" or "central" a point is relative to the entire distribution. The authors prove that these quantile regions are nested, ensuring that the mathematical structure of the ordering is consistent.

Ranks, Signs, and Independence Testing

Building on the center-outward ordering, the authors derive metric ranks and signs. A key theoretical contribution is the proof that these ranks are distribution-free. This means the rank of a data point depends solely on its relative position within the metric space, regardless of the underlying probability distribution.

Utilizing these ranks, the paper introduces a family of Spearman-like independence tests. These tests determine if two random variables residing in different metric spaces are independent. Because they are rank-based, they are inherently more robust to heavy-tailed distributions than traditional covariance-based methods.

Empirical Performance and Robustness

The framework was evaluated using Monte Carlo simulations across diverse spaces, including Euclidean space ($\mathbb{R}^d$), the unit sphere ($S^2$), Wasserstein space ($W_2$), SPD matrices, and Billera-Holmes-Vogtmann (BHV) phylogenetic trees.

Key Findings:

  • Robustness: The Empirical Metric Median (EMM) demonstrated superior resistance to outliers. In tests involving SPD matrices, the EMM achieved a breakdown point of approximately 0.47, significantly outperforming the Metric Halfspace Median (MHM), which failed at 0.21.
  • Computational Efficiency: The Empirical Global Metric Quantile (EGMQ) features a complexity of $O(n^2 \log n)$. While more intensive than simple Euclidean calculations, it is significantly faster than many competing depth-based methods that scale at $O(n^3)$.
  • Statistical Power: The rank-based independence test showed competitive or superior power compared to Ball Covariance (BCov) and Distance Covariance (DCov), particularly in the presence of heavy-tailed Cauchy distributions.
  • Consistency: The authors established root-$n$ consistency, providing a theoretical guarantee that empirical quantiles converge rapidly to true population quantiles as sample sizes increase.

Conclusion

This work provides a versatile and mathematically rigorous foundation for nonparametric statistics in metric spaces. By defining quantiles and ranks through the Metric Distribution Function, the authors enable robust inference for complex data types that lack a natural linear order. Future research directions include the development of a full framework for quantile regression in metric spaces and optimizing computational scaling for extremely large datasets.

Summary updated

BibTeX
@misc{liu2022quantiles,
  author = {Hang Liu and Xueqin Wang and Zhu Jin and Zhang, Heping},
  title = {{Quantiles, Ranks and Signs in Metric Spaces}},
  year = {2022},
  eprint = {2209.04090},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2209.04090},
}
Figure