On Ranking-based Tests of Independence

Myrto Limnios, Stéphan Clémençon · DOI

TL;DR

This paper introduces a novel nonparametric framework for testing the independence of two random variables by reframing the problem as a bipartite ranking task. By leveraging Receiver Operating Characteristic (ROC) analysis, the authors show that independence can be detected by measuring how much an optimal scoring function's ROC curve deviates from the main diagonal, providing a high-dimensional test with strong nonasymptotic theoretical guarantees.

What Problem Does This Paper Address?

Testing whether two variables, $\mathbf{X}$ and $\mathbf{Y}$, are independent is a fundamental challenge in statistics. While classic methods like Pearson’s correlation work for linear relationships, they fail to capture complex, non-monotonic dependencies. Modern nonparametric approaches—such as the Hilbert-Schmidt Independence Criterion (HSIC) or Distance Correlation (dCor)—are more flexible but often struggle in high-dimensional settings or rely on asymptotic distributions that can be "misspecified" (inaccurate) for finite samples.

The authors aim to create a test that is:

  1. Nonparametric: Makes no assumptions about the underlying distributions.
  2. Distribution-free under the null: The test threshold can be calculated exactly without knowing the marginal distributions.
  3. Robust in high dimensions: Avoiding the "curse of dimensionality" that often degrades the power of kernel-based or distance-based tests.

Methods

The core "aha!" moment of the paper is treating independence testing as a classification problem between the actual joint distribution $F$ and the product of the marginals $H \otimes G$ (which represents the state of independence).

The authors propose a three-step procedure using a 2-split trick:

  1. Splitting and Shuffling: The dataset is split into two parts. In the first part, the authors create a "synthetic" independent sample by randomly shuffling the indices of $\mathbf{Y}$ relative to $\mathbf{X}$.
  2. Bipartite Ranking: A ranking algorithm (like a Ranking Forest) is trained on this first part to learn a scoring function $\hat{s}(x, y)$ that attempts to distinguish the real pairs from the shuffled (independent) pairs.
  3. Rank Statistic Calculation: This learned scorer is applied to the second (unseen) part of the data. The authors then compute a rank statistic (similar to the Mann-Whitney Wilcoxon statistic or AUC).

If $\mathbf{X}$ and $\mathbf{Y}$ are independent, the scorer shouldn't be able to distinguish them better than random guessing, and the ROC curve will stay near the diagonal. If they are dependent, the ROC curve will "bulge" above the diagonal, triggering a rejection of the null hypothesis.

Datasets

The authors evaluated their method using:

  • Synthetic Gaussian Models (GL): Multivariate Gaussians with varying dimensions and correlation levels.
  • Non-monotonic Models (M1): Complex dependencies (e.g., circular or trigonometric relationships) where $X$ and $Y$ are dependent but have zero linear correlation.
  • High-Dimensional Sparse/Dense Models: Extensions of the above models into hundreds of dimensions to test the "curse of dimensionality."
  • Bank Account Fraud (BAF) Dataset: A real-world suite used to test for statistical parity (fairness), checking if model predictions are independent of protected attributes like age or similarity of personal details.

Key Insights and Ideas

  • Independence as Geometry: By moving the problem into the ROC space, independence becomes a geometric property (alignment with the diagonal). This allows the use of a wide class of "rank statistics" to detect different types of departures from independence.
  • Dimension Independence: Remarkably, the theoretical error rate of the test is independent of the dimensions of $\mathbf{X}$ and $\mathbf{Y}$. The dimension only affects the ranking algorithm's ability to learn, not the statistical validity of the test itself.
  • Distribution-Free Thresholds: Because the test relies on ranks in the second stage, the null distribution of the test statistic is known and can be tabulated, allowing for exact control of Type-I error (false positives) regardless of the data's distribution.

Key Results

  • Superior Power in High Dimensions: In experiments with up to 250 dimensions, the Ranking-based Test (RTB) significantly outperformed HSIC and dCor, especially in sparse settings where only a few features drive the dependency.
  • Detection of Small Departures: The method showed a "remarkable ability" to detect very small correlations ($\rho = 0.05$ or $0.1$) in high-dimensional Gaussian settings where other methods stayed at baseline power.
  • Fairness Application: On the BAF dataset, the test successfully verified statistical parity, showing that the predicted probability of fraud was independent of protected client attributes at a 0.05 significance level.

Limitations and Future Work

  • Computational Complexity: Bipartite ranking algorithms like Ranking Forests are more computationally intensive than simple kernel calculations used in HSIC.
  • Sample Efficiency: The 2-split trick requires a large enough sample size to both train a good ranker and perform a high-power test.
  • Algorithm Choice: The power of the test is inherently tied to the choice of the bipartite ranking algorithm. While the authors used Ranking Forests, they suggest that exploring other deep learning-based rankers could be a promising future direction for even more complex data types (like images or text).

Summary updated

BibTeX
@inproceedings{limnios2024ranking,
  author = {Myrto Limnios and Stéphan Clémençon},
  title = {{On Ranking-based Tests of Independence}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2024},
}
Figure