Introduction Analyzing "compositional" data—datasets representing parts of a whole, such as the relative abundance of bacteria in a microbiome or asset weights in a financial portfolio—presents unique statistical challenges. Presented at ICML 2026, this paper introduces a novel, fully nonparametric two-sample test for compositional and directional data. By leveraging the mathematics of spherical harmonics and a technique called studentization, the authors provide a flexible, computationally efficient framework that overcomes the limitations of traditional log-ratio methods.
The Challenge with Compositional Data Compositional data inherently lives on a simplex, as the components must sum to one. Traditionally, researchers have relied on log-ratio transformations to analyze such data. However, log-ratios suffer from a critical flaw: they cannot handle zero values. In fields like microbiome research, zeros are ubiquitous, forcing practitioners to add arbitrary "pseudocounts" that can severely bias the results.
Furthermore, most existing two-sample tests are limited to detecting differences in the mean between groups. They often fail to identify cases where two groups share the same average but exhibit different variances or higher-order distributional shapes. Finally, conducting statistical tests on non-Euclidean spaces (like a simplex or a sphere) typically requires permutation tests or bootstrap procedures. These methods are computationally expensive and scale poorly with massive modern datasets.
A Unified Spherical Framework To address these issues, the authors bridge the gap between compositional data and directional statistics by mapping simplex data onto the unit sphere $S^d$. Their approach relies on several core mathematical innovations:
- Spherical Harmonics: The authors utilize spherical harmonics—essentially the "Fourier transform" for spheres—to decompose the function space of the sphere into a series of finite-dimensional Reproducing Kernel Hilbert Spaces (RKHS).
- Kernel Energy Distance (KED): Using these spherical kernels, they construct a robust distance metric to measure the discrepancy between two probability distributions.
- Studentization: The key breakthrough of the paper is the application of studentization. By dividing the test statistic by a carefully derived estimate of its own variance (grounded in U-statistics theory), the authors prove that the resulting statistic converges to a standard normal distribution ($N(0,1)$) under the null hypothesis.
- Asymptotic Normality: Because the test statistic follows a known $Z$-test style distribution, researchers can calculate $p$-values instantly, entirely bypassing the need for thousands of slow random permutations.
Key Insights and Advantages This spherical framework offers several distinct advantages over existing methods:
- Handling Zeros Naturally: By treating the data as points on a sphere rather than applying logarithmic transformations, the "boundary" where zeros reside is no longer a mathematical singularity. Zeros are simply treated as valid points on the sphere.
- Beyond the Mean: The test is highly sensitive to higher-order moments. In simulations where two groups shared the exact same mean direction but differed in "tightness" (concentration), the proposed test successfully flagged the distributions as different, whereas mean-based tests failed.
- Bandwidth-Free: Unlike popular alternatives like the vMF-MMD test, which require users to guess or tune a "bandwidth" parameter, this spherical harmonics approach is essentially bandwidth-free.
- Linearizing the Manifold: Instead of relying on messy local charts common in manifold learning, the authors linearize the global geometry of the sphere by analyzing its function spaces.
Empirical Results The authors rigorously evaluated their method across simulated and real-world datasets:
- Simulations: Using Dirichlet-Multinomial models (for compositional data with varying sparsity) and von Mises-Fisher models (for directional data with concentration differences), the proposed test demonstrated superior statistical power. For instance, in microbiome simulations, the proposed test (SPH-L2-p4) achieved 100% power in detecting differences in abundant taxa, compared to a mere 5% power from traditional centered log-ratio (CLR) methods. The test also maintained its accuracy and power even with significant proportions of zeros.
- Real-World Validation: The authors applied their framework to a throat microbiome dataset comparing 28 smokers and 32 nonsmokers across 856 taxonomic units. The test successfully identified significant differences between the two groups ($p < 0.01$) across various levels of data filtering, matching the accuracy of permutation tests but computing in a fraction of the time.
Limitations and Future Directions While powerful, the current theoretical framework assumes a fixed dimension $d$ as the sample size $N$ grows. In the "High-Dimensional Low Sample Size" (HDLSS) regime—where the number of categories drastically exceeds the number of samples—the test may require different theoretical grounding. Additionally, for very high-dimensional spheres, the minimum sample size required to satisfy the asymptotic growth conditions can be quite large (exceeding $2^d$).
Moving forward, the authors plan to extend this framework to handle scenarios where the underlying spaces themselves vary, such as comparing datasets originating from spheres of different dimensions.
Summary updated