On Ranking-based Tests of Independence

Myrto Limnios, Stéphan Clémençon

Introduction

Testing the independence between random variables is a fundamental task in statistics, with critical implications for feature selection, causal inference, and algorithmic fairness. Traditional methods, such as the chi-square test or linear correlation, are often restricted to specific data types or simple linear relationships. While modern nonparametric approaches like the Hilbert-Schmidt Independence Criterion (HSIC) and Distance Correlation (dCor) offer greater flexibility, they frequently struggle with the "curse of dimensionality," losing statistical power as the number of features increases. Furthermore, many existing tests rely on asymptotic approximations that may not hold for finite sample sizes.

This paper introduces a novel nonparametric framework, the Ranking-based Test of Independence (RTB), which reformulates the independence testing problem as a bipartite ranking task. By leveraging machine learning to distinguish between observed data and shuffled counterparts, RTB provides a robust, high-dimensional test with strong nonasymptotic theoretical guarantees.

Methodology: Independence as a Ranking Problem

The RTB procedure consists of three primary stages:

  1. Data Splitting and Shuffling: The dataset is partitioned into two halves. The first half is used to generate a "positive" class (the original observed pairs) and a "negative" class (created by randomly shuffling the pairs to simulate the null hypothesis of independence).
  2. Bipartite Ranking: A machine learning model—specifically a "Ranking Forest"—is trained on the first half to learn a scoring function that ranks original pairs higher than shuffled ones.
  3. Rank Statistic Calculation: The learned scoring function is applied to the second half of the data. The resulting scores are used to compute a univariate rank statistic, akin to a weighted Mann-Whitney-Wilcoxon test.

The core intuition behind this approach is that if two variables are independent, no model can distinguish between real and shuffled pairs better than random chance. In such a case, the optimal Receiver Operating Characteristic (ROC) curve would be the diagonal. Any significant deviation from this diagonal indicates dependence.

Optimal ROC curves for varying correlation levels (ρ). As dependence increases, the ROC curve moves further from the diagonal, indicating higher test power.

Theoretical and Practical Advantages

The RTB framework offers several key advantages over traditional kernel-based methods:

  • Dimensionality Reduction: By mapping high-dimensional pairs to a single scalar score, the final statistical test remains univariate, effectively bypassing the curse of dimensionality.
  • Distribution-Free Null Hypothesis: Under the null hypothesis of independence, the test's behavior is entirely predictable and independent of the underlying data distribution. This allows for exact control over Type-I error rates.
  • Nonasymptotic Guarantees: Unlike methods that rely on large-sample approximations, RTB provides explicit mathematical bounds on error rates for any finite sample size.

Empirical Results

The researchers evaluated RTB against state-of-the-art methods using both synthetic and real-world datasets. In high-dimensional synthetic models (ranging from 50 to 500 dimensions), RTB significantly outperformed HSIC and Distance Correlation, particularly in detecting "sparse" dependencies where only a subset of variables are related.

The method was also applied to the Bank Account Fraud (BAF) dataset to audit "statistical parity." RTB successfully verified that a fraud-prediction model's outputs were independent of protected attributes like age, demonstrating its utility in fairness auditing.

Conclusion

The Ranking-based Test of Independence provides a flexible and theoretically grounded approach to a classic statistical problem. While its power is inherently tied to the capacity of the underlying ranking algorithm, its ability to handle high-dimensional data and provide nonasymptotic guarantees makes it a valuable tool for modern data science. Future work may explore the integration of more complex learners and extensions to functional or graph-structured data.

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