A unified framework for multivariate two-sample and k-sample kernel-based quadratic distance goodness-of-fit tests
Marianthi Markatou, Giovanni Saraceno
TL;DR
This work introduces a unified matrix-distance framework for multivariate two-sample and $k$-sample goodness-of-fit tests based on kernel-based quadratic distances (KBQD). By centering kernels with respect to a pooled or weighted reference distribution and formulating a $k\times k$ matrix distance, the authors derive the asymptotic behavior of the test statistics under the null via infinite sums of Wishart variables and provide two concrete statistics (trace and $T_n$) whose two-sample case aligns with the MMD. The paper details numerical aspects, including diffusion kernels with bandwidth $h$, nonparametric centering, and resampling-based critical values (bootstrap, permutation, subsampling), and proposes a grid-search method to select $h$. Through extensive simulations and a real-data penguin example, KBQD demonstrates competitive or superior power to existing methods, particularly for asymmetric, heavy-tailed, and high-dimensional scenarios, and the methods are implemented in QuadratiK for R and Python. Overall, the framework offers a scalable, versatile toolkit for distributional goodness-of-fit in multivariate settings.
Abstract
In the statistical literature, as well as in artificial intelligence and machine learning, measures of discrepancy between two probability distributions are largely used to develop measures of goodness-of-fit. We concentrate on quadratic distances, which depend on a non-negative definite kernel. We propose a unified framework for the study of two-sample and k-sample goodness of fit tests based on the concept of matrix distance. We provide a succinct review of the goodness of fit literature related to the use of distance measures, and specifically to quadratic distances. We show that the quadratic distance kernel-based two-sample test has the same functional form with the maximum mean discrepancy test. We develop tests for the $k$-sample scenario, where the two-sample problem is a special case. We derive their asymptotic distribution under the null hypothesis and discuss computational aspects of the test procedures. We assess their performance, in terms of level and power, via extensive simulations and a real data example. The proposed framework is implemented in the QuadratiK package, available in both R and Python environments.
