Skip to main content
QUICK REVIEW

[Paper Review] B-tests: Low Variance Kernel Two-Sample Tests

Wojciech Zaremba, Arthur Gretton|arXiv (Cornell University)|Jul 8, 2013
Statistical Methods and InferenceMathematics19 references6 citations
TL;DR

This paper introduces B-tests, a family of low-variance kernel two-sample tests that compute the maximum mean discrepancy (MMD) on small, non-overlapping blocks of data and average the results. By tuning the block size B, B-tests achieve a balance between computational efficiency and statistical power, offering asymptotically normal null distributions for fast p-value computation and outperforming both linear-time MMD_l and quadratic-time MMD_u in sample efficiency and speed.

ABSTRACT

A family of maximum mean discrepancy (MMD) kernel two-sample tests is introduced. Members of the test family are called Block-tests or B-tests, since the test statistic is an average over MMDs computed on subsets of the samples. The choice of block size allows control over the tradeoff between test power and computation time. In this respect, the $B$-test family combines favorable properties of previously proposed MMD two-sample tests: B-tests are more powerful than a linear time test where blocks are just pairs of samples, yet they are more computationally efficient than a quadratic time test where a single large block incorporating all the samples is used to compute a U-statistic. A further important advantage of the B-tests is their asymptotically Normal null distribution: this is by contrast with the U-statistic, which is degenerate under the null hypothesis, and for which estimates of the null distribution are computationally demanding. Recent results on kernel selection for hypothesis testing transfer seamlessly to the B-tests, yielding a means to optimize test power via kernel choice.

Motivation & Objective

  • To address the computational and statistical inefficiencies of existing MMD-based two-sample tests, particularly the high cost of null distribution estimation for U-statistics and the high variance of linear-time estimators.
  • To develop a test family that retains the asymptotic normality of linear-time MMD_l for fast p-value computation, while reducing variance through block averaging.
  • To enable efficient kernel selection for hypothesis testing by leveraging the asymptotically normal null distribution, which facilitates optimization of test power.
  • To provide a computationally efficient alternative to bootstrap and eigendecomposition-based null distribution estimation for MMD_u, which scale poorly with sample size.

Proposed method

  • The B-test computes the U-statistic MMD on non-overlapping blocks of size B, then averages the block statistics to form the final test statistic.
  • The block size B is chosen such that n/B → ∞ as n increases, ensuring asymptotic normality of the test statistic under both H₀ and Hₐ via the central limit theorem.
  • The null distribution is approximated as normal with mean zero and variance derived from the block-level MMD variances, enabling fast p-value computation at O(n) cost.
  • Kernel selection for B-tests is performed using existing methods optimized for MMD_l, such as median heuristic or spectrum-based kernel choice, due to the shared asymptotic normality.
  • The method avoids degeneracy issues of the full U-statistic by breaking the sample into blocks, circumventing the need for expensive eigendecompositions or bootstrapping.
  • The test is consistent and achieves high statistical power, especially for moderate to large block sizes, due to reduced variance compared to MMD_l.

Experimental results

Research questions

  • RQ1Can a two-sample test be designed that combines the low variance of the full U-statistic MMD_u with the computational efficiency and simple null distribution of the linear-time MMD_l?
  • RQ2Does averaging MMD statistics computed on small, non-overlapping blocks yield a test with an asymptotically normal null distribution, enabling fast p-value computation?
  • RQ3Can B-tests achieve higher statistical power than MMD_l at comparable computational cost, particularly in finite-sample regimes?
  • RQ4How does kernel selection for B-tests compare to existing methods, and can it be optimized efficiently due to the normal null distribution?
  • RQ5What is the trade-off between block size B and test performance in terms of Type I and Type II error rates across synthetic and real-world data?

Key findings

  • B-tests achieve significantly lower Type II error rates than MMD_l across all tested kernel selection strategies, demonstrating superior sample efficiency.
  • For the music dataset, the B-test with multiple kernels and B=√(n/2) achieved a Type II error of 0.012 with a computation time of 18.285 seconds, outperforming MMD_l in power with only moderate cost increase.
  • The B-test with B=2000 and σ=1 achieved zero Type I and Type II errors in 1000 repetitions, indicating strong performance despite conservative null distribution estimates.
  • The B-test with B=√n and median kernel achieved a Type I error of 0.006 and Type II error of 0.597, showing improved power over MMD_l while remaining computationally feasible.
  • The B-test is up to an order of magnitude faster than bootstrap and eigendecomposition-based null distribution estimation for MMD_u, which require O(n³) and O(n²) time, respectively.
  • Empirical results show that the null distribution is conservative (Type I error < 5%) across all settings, yet the B-test maintains strong power, indicating robustness and reliability.

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.