Introduction
Two-sample testing is a fundamental problem in statistics and machine learning: given two sets of samples, the goal is to determine whether they originate from the same underlying probability distribution. This task is critical across diverse domains, from anomaly detection in cybersecurity to identifying biological markers in healthcare.
While the Wasserstein distance (also known as the Earth Mover's Distance) provides a mathematically elegant framework for comparing distributions by accounting for the underlying geometry of the space, it suffers from a significant limitation: the "curse of dimensionality." As the dimension ($d$) of the data increases, the amount of data required to accurately estimate the distance grows exponentially. Specifically, the convergence rate of the standard Wasserstein metric is approximately $n^{-1/d}$. In high-dimensional settings, the statistical noise inherent in finite sampling quickly overwhelms the actual differences between distributions, leading to a loss of testing power.
The Projected Wasserstein Distance
To circumvent the curse of dimensionality, this research introduces the Projected Wasserstein (PW) distance. The core intuition is that even when data exists in a high-dimensional space (e.g., hundreds of dimensions), the meaningful discrepancy between two distributions often resides within a low-dimensional linear subspace.
The PW distance is defined as the maximum 1-Wasserstein distance between two distributions after they have been projected onto a $k$-dimensional subspace, where $k$ is much smaller than $d$ (typically $k=1$ or $k=3$). By focusing on the "worst-case" projection—the one that highlights the greatest possible difference—the test can ignore high-dimensional noise that does not contribute to the structural differences between the groups.
Optimization and Implementation
Finding this optimal projection requires solving an optimization problem over the Stiefel manifold, the space of all orthogonal projection matrices. The authors employ a Riemannian gradient method to efficiently search for the projection matrix $A$ that maximizes the distance. To calculate $p$-values for the hypothesis test in practice, a permutation approach is used, shuffling labels to establish a baseline distribution of the PW distance under the null hypothesis.
Theoretical Framework
A key contribution of this work is the theoretical justification for why the PW distance succeeds where standard metrics fail. Using Rademacher complexity, the authors prove that the convergence rate of the PW distance depends on the projection dimension $k$ rather than the original ambient dimension $d$.
This shift is transformative: if a researcher projects 100-dimensional data down to a 1D subspace ($k=1$), the test converges at a fast $1/\sqrt{n}$ rate. This provides a rigorous guarantee that the test remains statistically powerful even with relatively small sample sizes in high-dimensional environments.
Empirical Results
The method was validated using several high-dimensional synthetic benchmarks, including mean-shifted Gaussians, covariance-shifted Gaussians, and comparisons between truncated Gaussians and uniform distributions.
Key Findings:
- Superior Testing Power: In experiments with 120-dimensional data, the PW test maintained high testing power (the ability to correctly reject the null hypothesis), whereas standard methods like Maximum Mean Discrepancy (MMD) saw their power decay toward zero as dimensionality increased.
- Data Efficiency: The PW distance converges to its true value significantly faster than the standard Wasserstein distance as the number of samples increases.
- Interpretability: Unlike "black-box" kernel methods, the optimal projection matrix $A$ is physically interpretable. It identifies the specific linear combinations of features that are most responsible for the difference between the two datasets, offering researchers insights into the underlying drivers of variation.
- Visual Clarity: The authors demonstrated that projecting 100D data to 1D or 2D using the PW method makes distributional differences clearly visible in simple density plots (KDE), whereas these differences remain hidden in the original high-dimensional space.
Conclusion and Future Work
The Projected Wasserstein distance offers a robust solution to high-dimensional two-sample testing by "zooming in" on the most relevant subspaces. While highly effective, the authors note some areas for future exploration. Currently, there is no formal "rule of thumb" for selecting the optimal projection dimension $k$. Additionally, because the method relies on linear projections, it may struggle to capture discrepancies that exist only in highly non-linear, manifold-like structures. Future research may focus on tighter performance guarantees and extending the framework to non-linear projection types.
Summary updated