Skip to main content
QUICK REVIEW

[Paper Review] MMD Aggregated Two-Sample Test

Antonin Schrab, Ilmun Kim|arXiv (Cornell University)|Oct 28, 2021
Radiomics and Machine Learning in Medical ImagingMedicine48 references11 citations
TL;DR

This paper proposes MMDAgg, a novel nonparametric two-sample test based on the Maximum Mean Discrepancy (MMD) that adaptively aggregates multiple kernel bandwidths without requiring held-out data or heuristic choices. It achieves non-asymptotic type I error control and minimax optimality over Sobolev balls up to an iterated logarithmic term, outperforming state-of-the-art MMD-based tests on synthetic and real-world image data.

ABSTRACT

We propose two novel nonparametric two-sample kernel tests based on the Maximum Mean Discrepancy (MMD). First, for a fixed kernel, we construct an MMD test using either permutations or a wild bootstrap, two popular numerical procedures to determine the test threshold. We prove that this test controls the probability of type I error non-asymptotically. Hence, it can be used reliably even in settings with small sample sizes as it remains well-calibrated, which differs from previous MMD tests which only guarantee correct test level asymptotically. When the difference in densities lies in a Sobolev ball, we prove minimax optimality of our MMD test with a specific kernel depending on the smoothness parameter of the Sobolev ball. In practice, this parameter is unknown and, hence, the optimal MMD test with this particular kernel cannot be used. To overcome this issue, we construct an aggregated test, called MMDAgg, which is adaptive to the smoothness parameter. The test power is maximised over the collection of kernels used, without requiring held-out data for kernel selection (which results in a loss of test power), or arbitrary kernel choices such as the median heuristic. We prove that MMDAgg still controls the level non-asymptotically, and achieves the minimax rate over Sobolev balls, up to an iterated logarithmic term. Our guarantees are not restricted to a specific type of kernel, but hold for any product of one-dimensional translation invariant characteristic kernels. We provide a user-friendly parameter-free implementation of MMDAgg using an adaptive collection of bandwidths. We demonstrate that MMDAgg significantly outperforms alternative state-of-the-art MMD-based two-sample tests on synthetic data satisfying the Sobolev smoothness assumption, and that, on real-world image data, MMDAgg closely matches the power of tests leveraging the use of models such as neural networks.

Motivation & Objective

  • To address the lack of non-asymptotic type I error control in existing MMD-based two-sample tests, especially in small-sample settings.
  • To develop a test that adapts to unknown smoothness parameters in Sobolev balls without requiring held-out data for kernel selection.
  • To achieve minimax optimality over Sobolev balls while maintaining finite-sample validity and robustness.
  • To provide a practical, user-friendly implementation of an adaptive MMD test using an automatic bandwidth collection.

Proposed method

  • Proposes a non-asymptotic MMD test using permutations or wild bootstrap for threshold calibration, ensuring exact type I error control at finite sample sizes.
  • Introduces a single MMD test with a fixed bandwidth that achieves minimax optimality for a known smoothness parameter s in Sobolev balls.
  • Constructs MMDAgg by aggregating MMD statistics across a data-driven collection of bandwidths using adaptive weights to maximize test power.
  • Employs a parameter-free bandwidth collection based on dyadic scaling (λ ∈ {2^{-ℓ} : ℓ = 0,…,ℓ*}) with ℓ* chosen to balance bias and variance.
  • Uses a weighted combination of MMD statistics with weights derived from the inverse of the expected variance under the null, ensuring robust aggregation.
  • Proves that MMDAgg controls the type I error rate non-asymptotically and achieves minimax separation rate over Sobolev balls up to an iterated logarithmic factor.

Experimental results

Research questions

  • RQ1Can a nonparametric two-sample test based on MMD maintain exact type I error control at finite sample sizes?
  • RQ2Is it possible to construct an adaptive MMD test that achieves minimax optimality over Sobolev balls without knowing the smoothness parameter s?
  • RQ3Can the test avoid the power loss from held-out data for kernel selection or arbitrary choices like the median heuristic?
  • RQ4Does the aggregated MMD test maintain non-asymptotic level control while achieving near-optimal detection rates?
  • RQ5How does the performance of MMDAgg compare to model-based methods like neural networks on real-world image data?

Key findings

  • The proposed MMDAgg test controls the type I error rate non-asymptotically, ensuring reliable calibration even with small sample sizes.
  • For a known smoothness parameter s, the single MMD test with optimal bandwidth achieves minimax optimality over Sobolev balls.
  • MMDAgg achieves the minimax separation rate over Sobolev balls up to a factor of (ln ln(m+n))^{-2s/(4s+d)}, which is optimal up to logarithmic terms.
  • The test is minimax adaptive over the class of Sobolev balls {S_d^s(R) : s > 0, R > 0}, without requiring knowledge of s or R.
  • On synthetic data under Sobolev smoothness, MMDAgg significantly outperforms existing MMD-based tests in terms of power.
  • On the MNIST dataset, MMDAgg achieves power comparable to deep learning-based two-sample tests, demonstrating strong empirical performance on real-world image shift detection.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.