[Paper Review] An Efficient and Distribution-Free Two-Sample Test Based on Energy Statistics and Random Projections
This paper proposes Randomly Projected Energy Statistics (RPES), a computationally efficient, distribution-free two-sample test that reduces the O(N²) complexity of traditional energy statistics to O(KN log N) using random projections. The method maintains nearly identical statistical power to energy statistics while enabling scalable testing for large or high-dimensional data.
A common disadvantage in existing distribution-free two-sample testing approaches is that the computational complexity could be high. Specifically, if the sample size is $N$, the computational complexity of those two-sample tests is at least $O(N^2)$. In this paper, we develop an efficient algorithm with complexity $O(N \log N)$ for computing energy statistics in univariate cases. For multivariate cases, we introduce a two-sample test based on energy statistics and random projections, which enjoys the $O(K N \log N)$ computational complexity, where $K$ is the number of random projections. We name our method for multivariate cases as Randomly Projected Energy Statistics (RPES). We can show RPES achieves nearly the same test power with energy statistics both theoretically and empirically. Numerical experiments also demonstrate the efficiency of the proposed method over the competitors.
Motivation & Objective
- Address the high computational complexity (O(N²)) of existing distribution-free two-sample tests, especially for large or high-dimensional data.
- Develop an efficient algorithm for univariate energy statistics with O(N log N) complexity using sorting and rearrangement.
- Extend the method to multivariate data via random projections, preserving statistical power while reducing computational cost.
- Provide theoretical justification for the asymptotic equivalence in efficiency between RPES and standard energy statistics.
- Demonstrate the method's computational and statistical efficiency through extensive numerical experiments on simulated data.
Proposed method
- Propose a fast algorithm for univariate energy statistics based on sorting and rearrangement, reducing complexity from O(N²) to O(N log N).
- Apply random projections to reduce multivariate data to multiple univariate projections along random directions.
- Compute energy statistics on each projected univariate dataset using the fast algorithm, then average the results.
- Define the RPES test statistic as the average of energy statistics across K random projections, ensuring consistency and power.
- Use the asymptotic distribution of the test statistic under the null hypothesis to derive critical values for hypothesis testing.
- Leverage theoretical results showing RPES has asymptotic variance nearly identical to standard energy statistics, implying equivalent power.
Experimental results
Research questions
- RQ1Can the computational complexity of energy-based two-sample tests be reduced from O(N²) to O(N log N) in univariate settings?
- RQ2Does using random projections preserve the statistical power of energy statistics in multivariate two-sample testing?
- RQ3How does the performance of RPES compare to energy statistics and MMD in terms of test power and computational efficiency?
- RQ4What is the impact of the number of random projections (K) on the statistical power and computational cost of RPES?
- RQ5Can RPES maintain high power under various distributional assumptions, including heavy-tailed and high-dimensional distributions?
Key findings
- The proposed fast algorithm for univariate energy statistics achieves O(N log N) complexity, significantly reducing computation time compared to the O(N²) standard approach.
- RPES maintains nearly identical test power to energy statistics, with theoretical and empirical evidence showing asymptotic equivalence in variance.
- In simulations with multivariate t-distributions, RPES outperformed MMD and matched or slightly trailed energy statistics, especially at moderate to large sample sizes.
- For high-dimensional uniform distributions, RPES and MMD showed comparable performance, with RPES slightly underperforming only when dimension and sample size were both low.
- The method scales efficiently: with K=10, RPES achieved near-optimal power while maintaining O(KN log N) complexity, making it feasible for large-scale data.
- Numerical experiments confirmed that RPES is computationally superior to energy statistics and MMD, especially as sample size increases beyond 1,000.
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.