Optimal Algorithms and Lower Bounds for Testing Closeness of Structured Distributions

Ilias Diakonikolas, Daniel M. Kane, Vladimir Nikishkin

Abstract

Testing whether two unknown probability distributions are identical or significantly different is a cornerstone of statistical inference. While testing arbitrary distributions over a support of size $n$ requires $\Theta(n^{2/3})$ samples, real-world data often exhibits structural properties that can be exploited. This paper introduces a unified, sample-optimal framework for closeness testing under the $A_k$-distance metric. The authors establish a sample complexity of $\Theta(k^{4/5})$, providing the first sub-linear ($o(k)$) algorithms for a wide range of structured distribution families, including log-concave, $t$-modal, and piecewise constant distributions.

Introduction

In the field of property testing, "closeness testing" asks: given independent samples from two unknown distributions $p$ and $q$, can we distinguish between the case where $p = q$ and the case where they are $\epsilon$-far? For unstructured distributions, the complexity is well-understood. However, many practical distributions—such as bell curves or histograms—possess inherent structure. This paper investigates whether this structure can be leveraged to reduce sample requirements.

The authors focus on the $A_k$-distance metric, which measures the maximum difference between two distributions across any partition of the domain into at most $k$ intervals. This metric serves as a robust proxy for the standard $L_1$ (total variation) distance when dealing with structured data.

The Algorithmic Framework

The proposed "General Tester" employs a two-stage approach to detect discrepancies between distributions.

1. The $Z$-Statistic (Order-Based Testing)

The core of the algorithm is a novel $Z$-statistic based on the relative ordering of samples. By merging and sorting samples from both $p$ and $q$, the tester calculates the difference between the number of adjacent pairs from the same distribution and those from different distributions. If $p=q$, the samples should be well-interleaved, resulting in a small $Z$ value. Conversely, if the distributions differ, samples tend to "clump," significantly increasing the $Z$-statistic.

2. The Flatness Tester

While the $Z$-statistic is powerful, it can be insensitive if the difference between $p$ and $q$ is concentrated in very high-mass regions. To address this, the algorithm includes a "Flatness Tester." This stage uses samples to partition the distributions into "bins" of roughly equal mass and applies a secondary identity tester based on $L_2$ distance to these bins.

Key Results and Comparative Analysis

A major theoretical contribution of this work is the discovery of the $\Theta(k^{4/5})$ sample complexity for $A_k$-closeness testing. This result was unexpected, as many researchers anticipated a complexity of $\Theta(k^{2/3})$, mirroring $L_1$ testing on a discrete support of size $k$. This gap indicates that testing under the $A_k$ metric is fundamentally more difficult than testing on a discrete support.

By using $A_k$-distance as a unified proxy, the authors provide improved bounds for several important distribution families.

Table 1: Comparison of sample complexity upper bounds between this work and previous state-of-the-art results for various structured distribution families.

As shown in the table above, the new framework achieves sub-linear sample complexity for families where previous methods required linear samples relative to the structure parameter (e.g., $t$ for piecewise constant distributions).

Information-Theoretic Lower Bounds

To prove the optimality of their $\Theta(k^{4/5})$ bound, the authors employ a sophisticated reduction using Ramsey Theory. They demonstrate that for any general closeness tester, there exists a subset of the domain where the tester's decision is solely dependent on the relative ordering of the samples rather than their specific values. This confirms that the interleaving pattern is the fundamental source of information for closeness testing in continuous or highly structured settings.

Conclusion

This work provides a definitive answer to the sample complexity of $A_k$-closeness testing and offers a powerful, unified tool for testing structured distributions. While currently focused on univariate distributions, the framework sets a new standard for efficiency in property testing and opens the door for future extensions into multivariate domains and more complex structural constraints.

Summary updated

BibTeX
@inproceedings{diakonikolas2015optimal,
  author = {Ilias Diakonikolas and Daniel M. Kane and Vladimir Nikishkin},
  title = {{Optimal Algorithms and Lower Bounds for Testing Closeness of Structured Distributions}},
  booktitle = {FOCS},
  year = {2015},
  url = {https://openreview.net/forum?id=AvDr6J6AmZ},
}
Figure