[Paper Review] The Exact Equivalence of Independence Testing and Two-Sample Testing
This paper establishes the exact equivalence between two-sample testing and independence testing by treating group labels as an auxiliary variable, proving that distance correlation and the energy statistic are mathematically identical in population, sample, and permutation-based p-values. The result enables universal use of independence tests for distribution equality, improving interpretability and efficiency.
Testing independence and testing equality of distributions are two tightly related statistical hypotheses. Several distance and kernel-based statistics are recently proposed to achieve universally consistent testing for either hypothesis. On the distance side, the distance correlation is proposed for independence testing, and the energy statistic is proposed for two-sample testing. On the kernel side, the Hilbert-Schmidt independence criterion is proposed for independence testing and the maximum mean discrepancy is proposed for two-sample testing. In this paper, we show that two-sample testing are special cases of independence testing via an auxiliary label vector, and prove that distance correlation is exactly equivalent to the energy statistic in terms of the population statistic, the sample statistic, and the testing p-value via permutation test. The equivalence can be further generalized to K-sample testing and extended to the kernel regime. As a consequence, it suffices to always use an independence statistic to test equality of distributions, which enables better interpretability of the test statistic and more efficient testing.
Motivation & Objective
- To resolve the conceptual and methodological gap between two-sample testing and independence testing.
- To demonstrate that two-sample testing is a special case of independence testing using an auxiliary label vector.
- To unify distance-based and kernel-based statistics for distribution equality testing.
- To show that distance correlation and the energy statistic are exactly equivalent in all statistical aspects.
- To enable more interpretable and efficient testing by reducing all distribution equality problems to independence testing.
Proposed method
- Introduce an auxiliary label vector to transform two-sample testing into an independence testing problem.
- Prove that the population-level distance correlation statistic equals the energy statistic under the null hypothesis.
- Establish equivalence of sample-level test statistics between distance correlation and the energy statistic.
- Demonstrate that permutation-based p-values are identical for both statistics.
- Extend the equivalence to K-sample testing and to kernel-based methods like HSIC and MMD.
- Use theoretical analysis to show that independence testing subsumes two-sample testing without loss of generality.
Experimental results
Research questions
- RQ1Is two-sample testing a special case of independence testing under a specific transformation?
- RQ2Do the distance correlation and energy statistic yield identical population and sample statistics?
- RQ3Are the p-values from permutation tests for distance correlation and the energy statistic exactly the same?
- RQ4Can the equivalence between distance-based statistics be extended to kernel-based methods like HSIC and MMD?
- RQ5Does the equivalence allow for a unified framework that improves interpretability and efficiency in distribution equality testing?
Key findings
- Two-sample testing is formally equivalent to independence testing when an auxiliary label vector is introduced to distinguish the two samples.
- The population-level distance correlation statistic is mathematically identical to the energy statistic.
- The sample-level test statistics of distance correlation and the energy statistic are exactly equal.
- Permutation-based p-values for both statistics are identical, confirming equivalence in practice.
- The equivalence extends to K-sample testing, unifying multiple-sample distribution equality testing under the independence framework.
- The kernel-based counterparts—HSIC and MMD—also exhibit the same equivalence, enabling a unified approach across distance and kernel methods.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.