Power properties of the two-sample test based on the nearest neighbors graph
Rahul Raphael Kanekar
TL;DR
This work advances nonparametric two-sample testing in multivariate settings by analyzing graph-based tests built on K-nearest neighbor graphs with growing K_N. It derives CLTs for the Poissonized statistic under both null and general alternatives, establishing detection thresholds and local power in parametric families, and demonstrates that a 2-sided version eliminates an exponent gap present in the traditional 1-sided approach. A phase transition in detectable dimensionality persists when K_N grows, with higher dimensions improving power for the 2-sided test and bringing its performance closer to the likelihood-ratio test. The paper also proves consistency via Henze-Penrose dissimilarities and validates the theory through simulations, including higher-dimensional scenarios. Overall, increasing the graph density (larger k_N) enhances power and the 2-sided test provides more robust, dimension-friendly performance.
Abstract
In this paper, we study the problem of testing the equality of two multivariate distributions. One class of tests used for this purpose utilizes geometric graphs constructed using inter-point distances. So far, the asymptotic theory of these tests applies only to graphs which fall under the stabilizing graphs framework of \citet{penroseyukich2003weaklaws}. We study the case of the $K$-nearest neighbors graph where $K=k_N$ increases with the sample size, which does not fall under the stabilizing graphs framework. Our main result gives detection thresholds for this test in parametrized families when $k_N = o(N^{1/4})$, thus extending the family of graphs where the theoretical behavior is known. We propose a 2-sided version of the test which removes an exponent gap that plagues the 1-sided test. Our result also shows that increasing the number of nearest neighbors boosts the power of the test. This provides theoretical justification for using denser graphs in testing equality of two distributions.
