Testing Shape Restrictions of Discrete Distributions

Clément L. Canonne, Ilias Diakonikolas, Themis Gouleakis, Ronitt Rubinfeld

Introduction

Inferring information about the probability distribution that underlies a data sample is an essential question in Statistics, and one that has ramifications in every field of the natural sciences and quantitative research. In many situations, it is natural to assume that this data exhibits some simple structure because of known properties of the origin of the data, and in fact these assumptions are crucial in making the problem tractable. Such assumptions translate as constraints on the probability distribution – e.g., it is supposed to be Gaussian, or to meet a smoothness or “fat tail” condition (see e.g., [Man63, Hou86, TLSM95]).

As a result, the problem of deciding whether a distribution possesses such a structural property has been widely investigated both in theory and practice, in the context of shape restricted inference [BDBB72, SS01] and model selection [MP07]. Here, it is guaranteed or thought that the unknown distribution satisfies a shape constraint, such as having a monotone or log-concave probability density function [SN99, BB05, Wal09, Dia16]. From a different perspective, a recent line of work in Theoretical Computer Science, originating from the papers of Batu et al. [BFR+00, BFF+01, GR00] has also been tackling similar questions in the setting of property testing (see [Ron08, Ron10, Rub12, Can15] for surveys on this field). This very active area has seen a spate of results and breakthroughs over the past decade, culminating in very efficient (both sample and time-wise) algorithms for a wide range of distribution testing problems [BDKR05, GMV06, AAK+07, DDS+13, CDVV14, AD15, DKN15b]. In many cases, this led to a tight characterization of the number of samples required for these tasks as well as the development of new tools and techniques, drawing connections to learning and information theory [VV10, VV11a, VV14].

In this paper, we focus on the following general property testing problem: given a class (property) of distributions P\mathcal{P} and sample access to an arbitrary distribution DD, one must distinguish between the case that (a) D∈PD\in\mathcal{P}, versus (b) ∥D−D′∥1>ε{\lVert D-D^{\prime}{\rVert}}_{1}>\varepsilon for all D′∈PD^{\prime}\in\mathcal{P} (i.e., DD is either in the class, or far from it). While many of the previous works have focused on the testing of specific properties of distributions or obtained algorithms and lower bounds on a case-by-case basis, an emerging trend in distribution testing is to design general frameworks that can be applied to several property testing problems [Val11, VV11a, DKN15b, DKN15a]. This direction, the testing analog of a similar movement in distribution learning [CDSS13, CDSS14b, CDSS14a, ADLS15], aims at abstracting the minimal assumptions that are shared by a large variety of problems, and giving algorithms that can be used for any of these problems. In this work, we make significant progress in this direction by providing a unified framework for the question of testing various properties of probability distributions. More specifically, we describe a generic technique to obtain upper bounds on the sample complexity of this question, which applies to a broad range of structured classes. Our technique yields sample near-optimal and computationally efficient testers for a wide range of distribution families. Conversely, we also develop a general approach to prove lower bounds on these sample complexities, and use it to derive tight or nearly tight bounds for many of these classes.

Moreover, for the specific problems of identity and closeness testing,Recall that the identity testing problem asks, given the explicit description of a distribution D∗D^{\ast} and sample access to an unknown distribution DD, to decide whether DD is equal to D∗D^{\ast} or far from it; while in closeness testing both distributions to compare are unknown. recent results of [DKN15b, DKN15a] describe a general algorithm which applies to a large range of shape or structural constraints, and yields optimal identity testers for classes of distributions that satisfy them. We observe that while the question they answer can be cast as a specialized instance of membership testing, our results are incomparable to theirs, both because of the distinction above (testing with versus testing for structure) and as the structural assumptions they rely on are fundamentally different from ours.

1 Results and Techniques

We then instantiate this result to obtain “out-of-the-box” computationally efficient testers for several classes of distributions, by showing that they satisfy the premise of our theorem (the definition of these classes is given in Section 2.1):

We remark that the aforementioned sample upper bounds are information-theoretically near-optimal in the domain size nn (up to logarithmic factors). See Table 1 and the following subsection for the corresponding lower bounds. We did not attempt to optimize the dependence on the parameter ε\varepsilon, though a more careful analysis can lead to such improvements.

To complement our upper bounds, we give a generic framework for proving lower bounds against testing classes of distributions. In more detail, we describe how to reduce – under a mild assumption on the property C\mathcal{C} – the problem of testing membership to C\mathcal{C} (“does D∈CD\in\mathcal{C}?”) to testing identity to D∗D^{\ast} (“does D=D∗D=D^{\ast}?”), for any explicit distribution D∗D^{\ast} in C\mathcal{C}. While these two problems need not in general be related,As a simple example, consider the class C\mathcal{C} of all distributions, for which testing membership is trivial. we show that our reduction-based approach applies to a large number of natural properties, and obtain lower bounds that nearly match our upper bounds for all of them. Moreover, this lets us derive a simple proof of the lower bound of [AD15] on testing the class of PBDs. The reader is referred to Theorem 6.1 for the formal statement of our reduction-based lower bound theorem. In this section, we state the concrete corollaries we obtain for specific structured distribution families:

Testing log-concavity, convexity, concavity, MHR, unimodality, tt-modality, tt-histograms, and tt-piecewise degree-dd distributions each require Ω(n/ε2){\Omega\left({\sqrt{n}}/{\varepsilon^{2}}\right)} samples (the last three for t=o(n)t=o(\sqrt{n}) and t(d+1)=o(n)t(d+1)=o(\sqrt{n}), respectively), for any ε≥1/nO(1)\varepsilon\geq 1/n^{O(1)}.

Testing the classes of Binomial and Poisson Binomial Distributions each require Ω(n1/4/ε2){\Omega\left({n^{1/4}}/{\varepsilon^{2}}\right)} samples, for any ε≥1/nO(1)\varepsilon\geq 1/n^{O(1)}.

There exist absolute constants c>0c>0 and ε0>0\varepsilon_{0}>0 such that testing the class of kk-SIIRV distributions requires \Omega\big{(}k^{1/2}n^{1/4}\big{)} samples, for any k=o(nc)k={o\left(n^{c}\right)} and ε≤ε0\varepsilon\leq\varepsilon_{0}.

Tolerant testing of log-concavity, convexity, concavity, MHR, unimodality, and tt-modality can be performed with O\big{(}\frac{1}{(\varepsilon_{2}-\varepsilon_{1})^{2}}\frac{n}{\log n}\big{)} samples, for ε2≥Cε1\varepsilon_{2}\geq C\varepsilon_{1} (where C>2C>2 is an absolute constant).

Tolerant testing of the classes of Binomial and Poisson Binomial Distributions can be performed with O\big{(}\frac{1}{(\varepsilon_{2}-\varepsilon_{1})^{2}}\frac{\sqrt{n\log({1}/{\varepsilon_{1}})}}{\log n}\big{)} samples, for ε2≥Cε1\varepsilon_{2}\geq C\varepsilon_{1} (where C>2C>2 is an absolute constant).

Tolerant testing of log-concavity, convexity, concavity, MHR, unimodality, and tt-modality each require Ω(1(ε2−ε1)nlog⁡n){\Omega\left(\frac{1}{(\varepsilon_{2}-\varepsilon_{1})}\frac{n}{\log n}\right)} samples (the latter for t=o(n)t=o(n)).

Tolerant testing of the classes of Binomial and Poisson Binomial Distributions each require Ω(1(ε2−ε1)nlog⁡n){\Omega\left(\frac{1}{(\varepsilon_{2}-\varepsilon_{1})}\frac{\sqrt{n}}{\log n}\right)} samples.

We point out that our main theorem is likely to apply to many other classes of structured distributions, due to the mild structural assumptions it requires. However, we did not attempt here to be comprehensive; but rather to illustrate the generality of our approach. Moreover, for all properties considered in this paper the generic upper and lower bounds we derive through our methods turn out to be optimal up to at most polylogarithmic factors (with regard to the support size). The reader is referred to Table 1 for a summary of our results and related work.

2 Organization of the Paper

We start by giving the necessary background and definitions in Section 2, before turning to our main result, the proof of Theorem 1.1 (our general testing algorithm) in Section 3. In Section 4, we establish the necessary structural theorems for each classes of distributions considered, enabling us to derive the upper bounds of Table 1. Section 5 introduces a slight modification of our algorithm which yields stronger testing results for classes of distributions with small effective support, and use it to derive Section 1.1, our upper bound for Poisson Binomial distributions. Second, Section 6 contains the details of our lower bound methodology, and of its applications to the classes of Table 1. Finally, Section 6.2 is concerned with the extension of this methodology to tolerant testing, of which Section 7 describes a generic upper bound counterpart.

Notation and Preliminaries

We give here the formal descriptions of the classes of distributions involved in this work. Recall that a distribution DD over [n][n] is monotone (non-increasing) if its probability mass function (pmf) satisfies D(1)≥D(2)≥…D(n)D(1)\geq D(2)\geq\dots D(n). A natural generalization of the class M\mathcal{M} of monotone distributions is the set of tt-modal distributions, i.e. distributions whose pmf can go “up and down” or “down and up” up to tt times:Note that this slightly deviates from the Statistics literature, where only the peaks are counted as modes (so that what is usually referred to as a bimodal distribution is, according to our definition, 33-modal).

Fix any distribution DD over [n][n], and integer tt. DD is said to have tt modes if there exists a sequence i0<⋯<it+1i_{0}<\dots<i_{t+1} such that either (−1)jD(ij)<(−1)jD(ij+1)(-1)^{j}D(i_{j})<(-1)^{j}D(i_{j+1}) for all 0≤j≤t0\leq j\leq t, or (−1)jD(ij)>(−1)jD(ij+1)(-1)^{j}D(i_{j})>(-1)^{j}D(i_{j+1}) for all 0≤j≤t0\leq j\leq t. We call DD tt-modal if it has at most tt modes, and write Mt\mathcal{M}_{t} for the class of all tt-modal distributions (omitting the dependence on nn). The particular case of t=1t=1 corresponds to the set M1\mathcal{M}_{1} of unimodal distributions.

A distribution DD over [n][n] is said to be log-concave if it satisfies the following conditions: (i) for any 1≤i<j<k≤n1\leq i<j<k\leq n such that D(i)D(k)>0D(i)D(k)>0, D(j)>0D(j)>0; and (ii) for all 1<k<n1<k<n, D(k)2≥D(k−1)D(k+1)D(k)^{2}\geq D(k-1)D(k+1). We write L\mathcal{L} for the class of all log-concave distributions (omitting the dependence on nn).

A distribution DD over [n][n] is said to be concave if it satisfies the following conditions: (i) for any 1≤i<j<k≤n1\leq i<j<k\leq n such that D(i)D(k)>0D(i)D(k)>0, D(j)>0D(j)>0; and (ii) for all 1<k<n1<k<n such that D(k−1)D(k+1)>0D(k-1)D(k+1)>0, 2D(k)≥D(k−1)+D(k+1)2D(k)\geq D(k-1)+D(k+1); it is convex if the reverse inequality holds in (ii). We write K−\mathcal{K}^{-} (resp. K+\mathcal{K}^{+}) for the class of all concave (resp. convex) distributions (omitting the dependence on nn).

It is not hard to see that convex and concave distributions are unimodal; moreover, every concave distribution is also log-concave, i.e. K−⊆L\mathcal{K}^{-}\subseteq\mathcal{L}. Note that in both Section 2.1 and Section 2.1, condition (i) is equivalent to enforcing that the distribution be supported on an interval.

A distribution DD over [n][n] is said to have monotone hazard rate (MHR) if its hazard rate H(i)=defD(i)∑j=inD(j)H(i)\stackrel{{\scriptstyle\rm def}}{{=}}\frac{D(i)}{\sum_{j=i}^{n}D(j)} is a non-decreasing function. We write MHR\mathcal{MHR} for the class of all MHR distributions (omitting the dependence on nn).

It is known that every log-concave distribution is both unimodal and MHR (see e.g. [An96, Proposition 10]), and that monotone distributions are MHR. Two other classes of distributions have elicited significant interest in the context of density estimation, that of histograms (piecewise constant) and piecewise polynomial densities:

A distribution DD over [n][n] is said to be a tt-piecewise degree-dd distribution if there is a partition of [n][n] into tt disjoint intervals I1,…,ItI_{1},\dots,I_{t} such that D(i)=pj(i)D(i)=p_{j}(i) for all i∈Iji\in I_{j}, where each p1,…ptp_{1},\dots p_{t} is a univariate polynomial of degree at most dd. We write Pt,d\mathcal{P}_{t,d} for the class of all tt-piecewise degree-dd distributions (omitting the dependence on nn). (We note that tt-piecewise degree- distributions are also commonly referred to as tt-histograms, and write Ht\mathcal{H}_{t} for Pt,0\mathcal{P}_{t,0}.)

Finally, we recall the definition of the two following classes, which both extend the family of Binomial distributions BINn\mathcal{BIN}_{n}: the first, by removing the need for each of the independent Bernoulli summands to share the same bias parameter.

It is not hard to show that Poisson Binomial Distributions are in particular log-concave. One can generalize even further, by allowing each random variable of the summation to be integer-valued:

2 Tools from previous work

Let DD be a distribution on a domain SS. (a) If max⁡i∈SD(i)≤(1+ε)min⁡i∈SD(i)\max_{i\in S}D(i)\leq(1+\varepsilon)\min_{i\in S}D(i), then ∥D∥22≤(1+ε2)/∣S∣{\lVert D{\rVert}}_{2}^{2}\leq(1+\varepsilon^{2})/\left\lvert S\right\rvert. (b) If ∥D∥22≤(1+ε2)/∣S∣{\lVert D{\rVert}}_{2}^{2}\leq(1+\varepsilon^{2})/\left\lvert S\right\rvert, then ∥D−US∥1≤ε{\lVert D-\mathcal{U}_{S}{\rVert}}_{1}\leq\varepsilon.

To check condition (b) above we shall rely on the following, which one can derive from the techniques in [DKN15b] and whose proof we defer to Appendix A:

If ∥D−UI∥2>ε/∣I∣{\lVert D-\mathcal{U}_{I}{\rVert}}_{2}>{\varepsilon}/{\sqrt{\left\lvert I\right\rvert}}, then the algorithm outputs no with probability at least 1−δ1-\delta;

If ∥D−UI∥2≤ε/2∣I∣{\lVert D-\mathcal{U}_{I}{\rVert}}_{2}\leq{\varepsilon}/{2\sqrt{\left\lvert I\right\rvert}}, then the algorithm outputs yes with probability at least 1−δ1-\delta.

Finally, we will also rely on a classical result from Probability, the Dvoretzky–Kiefer–Wolfowitz (DKW) inequality, restated below:

Let DD be a distribution over [n][n]. Given mm independent samples x1,…,xmx_{1},\dots,x_{m} from DD, define the empirical distribution D^\hat{D} as follows:

In particular, this implies that O(1/ε2){O\left(1/\varepsilon^{2}\right)} samples suffice to learn a distribution up to ε\varepsilon in Kolmogorov distance.

The General Algorithm

In this section, we obtain our main result, restated below: See 1.1

Turning to the proof, we start by defining formally the “structural criterion” we shall rely on, before describing the algorithm at the heart of our result in Section 3.1. (We note that a modification of this algorithm will be described in Section 5, and will allow us to derive Section 1.1.)

max⁡i∈IjD(i)≤(1+γ)⋅min⁡i∈IjD(i)\displaystyle\max_{i\in I_{j}}D(i)\leq(1+\gamma)\cdot\min_{i\in I_{j}}D(i).

Further, if I(γ,D)\mathcal{I}(\gamma,D) is dyadic (i.e., each IkI_{k} is of the form [j⋅2i+1,(j+1)⋅2i][j\cdot 2^{i}+1,(j+1)\cdot 2^{i}] for some integers i,ji,j, corresponding to the leaves of a recursive bisection of [n][n]), then C\mathcal{C} is said to be (γ,L)(\gamma,L)-splittable.

If C\mathcal{C} is (γ,L)(\gamma,L)-decomposable, then it is (γ,O(Llog⁡n))(\gamma,{O\left(L\log n\right)})-splittable.

In order to complete the proof of the lemma, notice that the two conditions in Section 3 are closed under taking subsets. ∎

1 The algorithm

Theorem 1.1, and with it Section 1.1 and Section 1.1 will follow from the theorem below, combined with the structural theorems from Section 4:

Let C\mathcal{C} be a class of distributions over [n][n] for which the following holds.

C\mathcal{C} is (γ,L(γ,n))(\gamma,L(\gamma,n))-splittable;

Then, the algorithm TestSplittable (Algorithm 1) is a O(max⁡(nLlog⁡n/ε3,L/ε2)){O\left(\max\left({\sqrt{nL}}\log n/{\varepsilon^{3}},L/{\varepsilon^{2}}\right)\right)}-sample tester for C\mathcal{C}, for L=L(ε,n)L=L(\varepsilon,n). (Moreover, if \textscProjectionDistC\textsc{ProjectionDist}_{\mathcal{C}} is computationally efficient, then so is TestSplittable.)

2 Proof of Theorem 3.1

We now give the proof of our main result (Theorem 3.1), first analyzing the sample complexity of Algorithm 1 before arguing its correctness. For the latter, we will need the following simple lemma from [ILR12], restated below:

Let DD be a distribution over [n][n], and δ∈(0,1]\delta\in(0,1]. Given m≥C⋅log⁡nδηm\geq C\cdot\frac{\log\frac{n}{\delta}}{\eta} independent samples from DD (for some absolute constant C>0C>0), with probability at least 1−δ1-\delta we have that, for every interval I⊆[n]I\subseteq[n]:

if D(I)≥η4D(I)\geq\frac{\eta}{4}, then D(I)2≤mIm≤3D(I)2\frac{D(I)}{2}\leq\frac{m_{I}}{m}\leq\frac{3D(I)}{2};

if mIm≥η2\frac{m_{I}}{m}\geq\frac{\eta}{2}, then D(I)>η4D(I)>\frac{\eta}{4};

if mIm<η2\frac{m_{I}}{m}<\frac{\eta}{2}, then D(I)<ηD(I)<\eta;

where mI=def∣{  j∈[m]   ⁣:  xj∈I  }∣m_{I}\stackrel{{\scriptstyle\rm def}}{{=}}\left\lvert\left\{\;j\in[m]\;\colon\;x_{j}\in I\;\right\}\right\rvert is the number of the samples falling into II.

3 Sample complexity.

The sample complexity is immediate, and comes from Steps 6 and 22. The total number of samples is

4 Correctness.

Say an interval II considered during the execution of the “Decomposition” step is heavy if mIm_{I} is big enough on Step 9, and light otherwise; and let H\mathscr{H} and L\mathscr{L} denote the sets of heavy and light intervals respectively. By choice of mm and a union bound over all ∣I∣2\left\lvert I\right\rvert^{2} possible intervals, we can assume on one hand that with probability at least 9/109/10 the guarantees of 3.2 hold simultaneously for all intervals considered. We hereafter condition on this event.

We first argue that if the algorithm does not reject in Step 15, then with probability at least 9/109/10 we have ∥D−Φ(D,I)∥1≤ε/20{\lVert D-\Phi(D,\mathcal{I}){\rVert}}_{1}\leq\varepsilon/20. Indeed, we can write

If I′∈HI^{\prime}\in\mathscr{H}, then by our choice of threshold we can apply Section 2.2 with δ=110L\delta=\frac{1}{10L}; conditioning on all of the (at most LL) events happening, which overall fails with probability at most 1/101/10 by a union bound, we get

If I′∈LI^{\prime}\in\mathscr{L}, then we claim that D(I′)≤max⁡(κ,2c⋅∣I′∣mε2log⁡1δ)D(I^{\prime})\leq\max(\kappa,2c\cdot\frac{\sqrt{\left\lvert I^{\prime}\right\rvert}}{m\varepsilon^{2}}\log\frac{1}{\delta}). Clearly, this is true if D(I′)≤κD(I^{\prime})\leq\kappa, so it only remains to show that D(I′)≤2c⋅∣I′∣mε2log⁡1δD(I^{\prime})\leq 2c\cdot\frac{\sqrt{\left\lvert I^{\prime}\right\rvert}}{m\varepsilon^{2}}\log\frac{1}{\delta}. But this follows from 3.2 i, as if we had D(I′)>2c⋅∣I′∣mε2log⁡1δD(I^{\prime})>2c\cdot\frac{\sqrt{\left\lvert I^{\prime}\right\rvert}}{m\varepsilon^{2}}\log\frac{1}{\delta} then mI′m_{I^{\prime}} would have been big enough, and I′∉LI^{\prime}\notin\mathscr{L}. Overall,

for a sufficiently big choice of constant C>0C>0 in the definition of mm; where we first used that ∣L∣≤L\left\lvert\mathscr{L}\right\rvert\leq L, and then that ∑I′∈L∣I′∣∣I∣≤L\sum_{I^{\prime}\in\mathscr{L}}\sqrt{\frac{\left\lvert I^{\prime}\right\rvert}{\left\lvert I\right\rvert}}\leq\sqrt{L} by Jensen’s inequality.

Overall, this happens except with probability at most 1/10+1/10+1/10<1/31/10+1/10+1/10<1/3.

Assume D∈CD\in\mathcal{C}. Then the choice of of γ\gamma and LL ensures the existence of a good dyadic partition I(γ,D)\mathcal{I}(\gamma,D) in the sense of Section 3. For any II in this partition for which i holds (D(I)≤γL<κ2D(I)\leq\frac{\gamma}{L}<\frac{\kappa}{2}), II will have mIm<κ\frac{m_{I}}{m}<\kappa and be kept as a “light leaf” (this by contrapositive of 3.2 ii). For the other ones, ii holds: let II be one of these (at most LL) intervals.

If mIm_{I} is too small on Step 9, then II is kept as “light leaf.”

Structural Theorems

In this section, we show that a wide range of natural distribution families are succinctly decomposable, and provide efficient projection algorithms for each class.

For all γ>0\gamma>0, the class M\mathcal{M} of monotone distributions on [n][n] is (γ,L)(\gamma,L)-splittable for L=defO(log⁡2nγ)L\stackrel{{\scriptstyle\rm def}}{{=}}{O\left(\frac{\log^{2}n}{\gamma}\right)}.

Note that this proof can already be found in [BKR04, Theorem 10], interwoven with the analysis of their algorithm. For the sake of being self-contained, we reproduce the structural part of their argument, removing its algorithmic aspects:

if D(Ii(j))≤γLD(I^{(j)}_{i})\leq\frac{\gamma}{L}, then Ii(j)I^{(j)}_{i} is added as element of I(j+1)\mathcal{I}^{(j+1)} (“marked as leaf”);

else, if D(bi(j))≤(1+γ)D(ai(j))D(b^{(j)}_{i})\leq(1+\gamma)D(a^{(j)}_{i}), then Ii(j)I^{(j)}_{i} is added as element of I(j+1)\mathcal{I}^{(j+1)} (“marked as leaf”);

otherwise, bisect I(j)I^{(j)} in IL(j)I^{(j)}_{\rm L}, IR(j)I^{(j)}_{\rm R} (with ∣IL(j)∣=⌈∣I(j)∣/2⌉\left\lvert I^{(j)}_{\rm L}\right\rvert=\left\lceil\left\lvert I^{(j)}\right\rvert/2\right\rceil) and add both IL(j)I^{(j)}_{\rm L} and IR(j)I^{(j)}_{\rm R} as elements of I(j+1)\mathcal{I}^{(j+1)}.

The recursion above defines a complete binary tree (with the leaves being the intervals satisfying a or b, and the internal nodes the other ones). Let tt be the number of recursion steps the process goes through before converging to I\mathcal{I} (height of the tree); as mentioned above, we have t≤log⁡nt\leq\log n (as we start with an interval of size nn, and the length is halved at each step.). Observe further that if at any point an interval Ii(j)=[ai(j),bi(j)]I^{(j)}_{i}=[a^{(j)}_{i},b^{(j)}_{i}] has D(ai(j))≤γnLD(a^{(j)}_{i})\leq\frac{\gamma}{nL}, then it immediately (as well as all the Ik(j)I^{(j)}_{k}’s for k≥ik\geq i by monotonicity) satisfies a and is no longer split (“becomes a leaf”). So at any j≤tj\leq t, the number of intervals iji_{j} for which neither a nor b holds must satisfy

where aka_{k} denotes the beginning of the kk-th interval (again we use monotonicity to argue that the extrema were reached at the ends of each interval), so that ij≤1+log⁡nLγlog⁡(1+γ)i_{j}\leq 1+\frac{\log\frac{nL}{\gamma}}{\log(1+\gamma)}. In particular, the total number of internal nodes is then

For all γ>0\gamma>0, the class M1\mathcal{M}_{1} of unimodal distributions on [n][n] is (γ,L)(\gamma,L)-decomposable for L=defO(log⁡2nγ)L\stackrel{{\scriptstyle\rm def}}{{=}}{O\left(\frac{\log^{2}n}{\gamma}\right)}.

For any D∈M1D\in\mathcal{M}_{1}, [n][n] can be partitioned in two intervals II, JJ such that DID_{I}, DJD_{J} are either monotone non-increasing or non-decreasing. Applying Theorem 4.1 to DID_{I} and DJD_{J} and taking the union of both partitions yields a (no longer necessarily dyadic) partition of [n][n]. ∎

The same argument yields an analogue statement for tt-modal distributions:

For any t≥1t\geq 1 and all γ>0\gamma>0, the class Mt\mathcal{M}_{t} of tt-modal distributions on [n][n] is (γ,L)(\gamma,L)-decomposable for L=defO(tlog⁡2nγ)L\stackrel{{\scriptstyle\rm def}}{{=}}{O\left(\frac{t\log^{2}n}{\gamma}\right)}.

For all γ>0\gamma>0, the classes L\mathcal{L}, K−\mathcal{K}^{-} and K+\mathcal{K}^{+} of log-concave, concave and convex distributions on [n][n] are (γ,L)(\gamma,L)-decomposable for L=defO(log⁡2nγ)L\stackrel{{\scriptstyle\rm def}}{{=}}{O\left(\frac{\log^{2}n}{\gamma}\right)}.

This is directly implied by Section 4.1, recalling that log-concave, concave and convex distributions are unimodal. ∎

For all γ>0\gamma>0, the class MHR\mathcal{MHR} of MHR distributions on [n][n] is (γ,L)(\gamma,L)-decomposable for L=defO(log⁡nγ)L\stackrel{{\scriptstyle\rm def}}{{=}}{O\left(\frac{\log n}{\gamma}\right)}.

For all γ>0\gamma>0, t,d≥0t,d\geq 0, the class Pt,d\mathcal{P}_{t,d} of tt-piecewise degree-dd distributions on [n][n] is (γ,L)(\gamma,L)-decomposable for L=defO(t(d+1)γlog⁡2n)L\stackrel{{\scriptstyle\rm def}}{{=}}{O\left(\frac{t(d+1)}{\gamma}\log^{2}n\right)}. (Moreover, for the class of tt-histograms Ht\mathcal{H}_{t} (d=0d=0) one can take L=tL=t.)

The last part of the statement is obvious, so we focus on the first claim. Observing that each of the tt pieces of a distribution D∈Pt,dD\in\mathcal{P}_{t,d} can be subdivided in at most d+1d+1 intervals on which DD is monotone (being degree-dd polynomial on each such pieces), we obtain a partition of [n][n] into at most t(d+1)t(d+1) intervals. DD being monotone on each of them, we can apply an argument almost identical to that of Theorem 4.1 to argue that each interval can be further split into O(log⁡2n/γ)O(\log^{2}n/\gamma) subintervals, yielding a good decomposition with O(t(d+1)log⁡2n/γ)O(t(d+1)\log^{2}n/\gamma) pieces. ∎

2 Projection Step: computing the distances

We focus in this section on achieving the sample complexities stated in Section 1.1, Section 1.1, and Section 1.1. While almost all the distance estimation procedures we give in this section are efficient, running in time polynomial in all the parameters or even with only a polylogarithmic dependence on nn, there are two exceptions – namely, the procedures for monotone hazard rate (Section 4.2) and log-concave (Section 4.2) distributions. We do describe computationally efficient procedures for these two cases as well in Section 4.2.1, at a modest additive cost in the sample complexity.

We here give a naive algorithm for these two problems, based on an exhaustive search over a (huge) ε\varepsilon-cover S\mathcal{S} of distributions over [n][n]. Essentially, S\mathcal{S} contains all possible distributions whose probabilities p1,…,pnp_{1},\dots,p_{n} are of the form jε/nj\varepsilon/n, for j∈{0,…,n/ε}j\in\{0,\dots,n/\varepsilon\} (so that ∣S∣=O((n/ε)n)\left\lvert\mathcal{S}\right\rvert={O\left((n/\varepsilon)^{n}\right)}). It is not hard to see that this indeed defines an ε\varepsilon-cover of the set of all distributions, and moreover that it can be computed in time poly⁡(∣S∣)\operatorname*{poly}(\left\lvert\mathcal{S}\right\rvert). To approximate the distance from an explicit distribution DD to the class C\mathcal{C} (either MHR\mathcal{MHR} or L\mathcal{L}), it is enough to go over every element SS of S\mathcal{S}, checking (this time, efficiently) if ∥S−D∥1≤ε{\lVert S-D{\rVert}}_{1}\leq\varepsilon and if there is a distribution P∈CP\in\mathcal{C} close to SS (this time, pointwise, that is ∣P(i)−S(i)∣≤ε/n\left\lvert P(i)-S(i)\right\rvert\leq\varepsilon/n for all ii) – which also implies ∥S−P∥1≤ε{\lVert S-P{\rVert}}_{1}\leq\varepsilon and thus ∥P−D∥1≤2ε{\lVert P-D{\rVert}}_{1}\leq 2\varepsilon. The test for pointwise closeness can be done by checking feasibility of a linear program with variables corresponding to the logarithm of probabilities, i.e. xi≡ln⁡P(i)x_{i}\equiv\ln P(i). Indeed, this formulation allows to rephrase the log-concave and MHR constraints as linear constraints, and pointwise approximation is simply enforcing that ln⁡(S(i)−ε/n)≤xi≤ln⁡(S(i)+ε/n)\ln(S(i)-\varepsilon/n)\leq x_{i}\leq\ln(S(i)+\varepsilon/n) for all ii. At the end of this enumeration, the procedure accepts if and only if for some SS both ∥S−D∥1≤ε{\lVert S-D{\rVert}}_{1}\leq\varepsilon and the corresponding linear program was feasible. ∎

Before proving it, we describe how this will enable us to get the desired time complexity for \textscProjectionDistHt\textsc{ProjectionDist}_{\mathcal{H}_{t}}. Phrased differently, the claim above allows us to run our dynamic program using the O(1/η){O\left(1/\eta\right)} endpoints of the O(1/η){O\left(1/\eta\right)} instead of the nn points of the domain, paying only an additive error O(tη)O(t\eta). Setting η=ε4t\eta=\frac{\varepsilon}{4t}, the guarantee for \textscProjectionDistHt\textsc{ProjectionDist}_{\mathcal{H}_{t}} follows.

Turning now to \textscProjectionDistPt,d\textsc{ProjectionDist}_{\mathcal{P}_{t,d}}, we apply the same initial dynamic programming approach, which will result on a running time of O(n2t⋅T){O\left(n^{2}t\cdot T\right)}, where TT is the time required to estimate (to sufficient accuracy) the distance of a given (sub)distribution over an interval II onto the space Pd\mathcal{P}_{d} of degree-dd polynomials. Specifically, we will invoke the following result, adapted from [CDSS14a] to our setting:

Combining these ideas yield the following distance estimation lemmas:

If there is P∈MHRP\in\mathcal{MHR} such that ∥D−P∥1≤ε{\lVert D-P{\rVert}}_{1}\leq\varepsilon and ∥D′−P∥Kol≤ε3{\lVert D^{\prime}-P{\rVert}_{\rm Kol}}\leq\varepsilon^{3}, then the procedure returns yes;

If there is P∈LP\in\mathcal{L} such that ∥D−P∥1≤ε{\lVert D-P{\rVert}}_{1}\leq\varepsilon and ∥D′−P∥Kol≤ε2log⁡2(1/ε){\lVert D^{\prime}-P{\rVert}_{\rm Kol}}\leq\frac{\varepsilon^{2}}{\log^{2}(1/\varepsilon)}, then the procedure returns yes;

Going Further: Reducing the Support Size

Given ε>0\varepsilon>0, the ε\varepsilon-effective support of a distribution DD is the smallest interval II such that D(I)≥1−εD(I)\geq 1-\varepsilon.

The last definition we shall require is of the conditioned distributions of a class C\mathcal{C}:

For any class of distributions C\mathcal{C} over [n][n], define the set of conditioned distributions of C\mathcal{C} (with respect to ε>0\varepsilon>0 and interval I⊆[n]I\subseteq[n]) as Cε,I=def{  DI   ⁣:  D∈C,D(I)≥1−ε  }\mathcal{C}^{\varepsilon,I}\stackrel{{\scriptstyle\rm def}}{{=}}\left\{\;D_{I}\;\colon\;D\in\mathcal{C},D(I)\geq 1-\varepsilon\;\right\}.

Finally, we will require the following simple result:

Let DD be a distribution over [n][n], and I⊆[n]I\subseteq[n] an interval such that D(I)≥1−ε10D(I)\geq 1-\frac{\varepsilon}{10}. Then,

If D∈CD\in\mathcal{C}, then DI∈Cε10,ID_{I}\in\mathcal{C}^{\frac{\varepsilon}{10},I};

The first item is obvious. As for the second, let P∈CP\in\mathcal{C} be any distribution with P(I)≥1−ε10P(I)\geq 1-\frac{\varepsilon}{10}. By assumption, ∥D−P∥1>ε{\lVert D-P{\rVert}}_{1}>\varepsilon: but we have, writing α=1/10\alpha=1/10,

We now proceed to state and prove our result – namely, efficient testing of structured classes of distributions with nice concentration properties.

Let C\mathcal{C} be a class of distributions over [n][n] for which the following holds.

there is a function M(⋅,⋅)M(\cdot,\cdot) such that each D∈CD\in\mathcal{C} has ε\varepsilon-effective support of size at most M(n,ε)M(n,\varepsilon);

for every ε∈\varepsilon\in and interval I⊆[n]I\subseteq[n], Cε,I\mathcal{C}^{\varepsilon,I} is (γ,L)(\gamma,L)-splittable;

By the choice of mm and the DKW inequality, with probability at least 23/2423/24 the estimate D^\hat{D} satisfies ∥D−D^∥Kol≤ε60{\lVert D-\hat{D}{\rVert}_{\rm Kol}}\leq\frac{\varepsilon}{60}. Conditioning on that from now on, we get that D(I)≥D^(I)−ε30≥1−ε10D(I)\geq\hat{D}(I)-\frac{\varepsilon}{30}\geq 1-\frac{\varepsilon}{10}. Furthermore, denoting by jj and kk the two inner endpoints of JJ and KK in Steps 6 and 7, we have D(J∪{j+1})≥D^(J∪{j+1})−ε60>ε60D(J\cup\{j+1\})\geq\hat{D}(J\cup\{j+1\})-\frac{\varepsilon}{60}>\frac{\varepsilon}{60} (similarly for D(K∪{k−1})D(K\cup\{k-1\})), so that II has size at most σ+1\sigma+1, where σ\sigma is the ε60\frac{\varepsilon}{60}-effective support size of DD.

Finally, note that since D(I)=Ω(1)D(I)={\Omega\left(1\right)} by our conditioning, the simulation of samples by rejection sampling will succeed with probability at least 23/2423/24 and the algorithm will not output FAIL.

If D∈CD\in\mathcal{C}, then by the setting of τ\tau (set to be an upper bound on the ε60\frac{\varepsilon}{60}-effective support size of any distribution in C\mathcal{C}) the algorithm will go beyond Step 8. The call to TestSplittable will then end up in the algorithm returning ACCEPT in Step 14, with probability at least 2/32/3 by Section 5, Theorem 1.1 and our choice of parameters.

Similarly, if DD is ε\varepsilon-far from C\mathcal{C}, then either its effective support is too large (and then the test on Step 8 fails), or the main tester will detect that its conditional distribution on II is 7ε10\frac{7\varepsilon}{10}-far from C\mathcal{C} and output REJECT in Step 14.

Overall, in either case the algorithm is correct except with probability at most 1/24+1/24+1/3=5/121/24+1/24+1/3=5/12 (by a union bound). Repeating constantly many times and outputting the majority vote brings the probability of failure down to 1/31/3. ∎

2 Application: Testing Poisson Binomial Distributions

In this section, we illustrate the use of our generic two-stage approach to test the class of Poisson Binomial Distributions. Specifically, we prove the following result:

This is a direct consequence of Theorem 5.1 and the lemmas below. The first one states that, indeed, PBDs have small effective support:

For any ε>0\varepsilon>0, a PBD has ε\varepsilon-effective support of size O(nlog⁡(1/ε)){O\left(\sqrt{n\log(1/\varepsilon)}\right)}.

It is clear that if D∈PBDnD\in\mathcal{PBD}_{n} (and therefore is unimodal), then for any interval I⊆[n]I\subseteq[n] the conditional distribution DID_{I} is still unimodal, and thus the class of conditioned PBDs PBDnε,I=def{  DI   ⁣:  D∈PBDn,D(I)≥1−ε  }\mathcal{PBD}_{n}^{\varepsilon,I}\stackrel{{\scriptstyle\rm def}}{{=}}\left\{\;D_{I}\;\colon\;D\in\mathcal{PBD}_{n},D(I)\geq 1-\varepsilon\;\right\} falls under Section 4.1. The last piece we need to apply our generic testing framework is the existence of an algorithm to compute the distance between an (explicit) distribution and the class of conditioned PBDs. This is provided by our next lemma:

For all n,γ>0n,\gamma>0, there exists a set Sγ⊆PBDn\mathcal{S}_{\gamma}\subseteq\mathcal{PBD}_{n} such that:

Sγ\mathcal{S}_{\gamma} is a γ\gamma-cover of PBDn\mathcal{PBD}_{n}; that is, for all D∈PBDnD\in\mathcal{PBD}_{n} there exists some D′∈SγD^{\prime}\in\mathcal{S}_{\gamma} such that ∥D−D′∥1≤γ{\lVert D-D^{\prime}{\rVert}}_{1}\leq\gamma

∣Sγ∣≤n(1/γ)O(log⁡1/γ)\left\lvert\mathcal{S}_{\gamma}\right\rvert\leq n\left({1/\gamma}\right)^{{O\left(\log{1/\gamma}\right)}}

Sγ\mathcal{S}_{\gamma} can be computed in time n(1/γ)O(log⁡1/γ)n\left({1/\gamma}\right)^{{O\left(\log{1/\gamma}\right)}}

and each D∈SγD\in\mathcal{S}_{\gamma} is explicitly described by its set of parameters.

We further observe that the factor nn in both the size of the cover and running time can be easily removed in our case, as we know a good approximation of the support size of the candidate PBDs. (That is, we only need to enumerate over a subset of the cover of [DKS15], that of the PBDs with effective support compatible with our distribution DD.)

Combining the above, we invoke Theorem 5.1 with M(n,ε)=O(nlog⁡(1/ε))M(n,\varepsilon)=O(\sqrt{n\log(1/\varepsilon)}) (5.2) and L(m,\gamma)=O\big{(}\frac{\log^{2}m}{\gamma}\big{)} (Section 4.1). This yields the claimed sample complexity; finally, the efficiency is a direct consequence of Section 5.2. ∎

Lower Bounds

We now turn to proving converses to our positive results – namely, that many of the upper bounds we obtain cannot be significantly improved upon. As in our algorithmic approach, we describe for this purpose a generic framework for obtaining lower bounds.

In order to state our results, we will require the usual definition of agnostic learning. Recall that an algorithm is said to be a semi-agnostic learner for a class C\mathcal{C} if it satisfies the following. Given sample access to an arbitrary distribution DD and parameter ε\varepsilon, it outputs a hypothesis D^\hat{D} which (with high probability) does “almost as well as it gets”:

The motivation for our result is the observation of [BKR04] that “monotonicity is at least as hard as uniformity.” Unfortunately, their specific argument does not generalize easily to other classes of distributions, making it impossible to extend it readily. The starting point of our approach is to observe that while uniformity testing is hard in general, it becomes very easy under the promise that the distribution is monotone, or even only close to monotone (namely, O(1/ε2){O\left(1/\varepsilon^{2}\right)} samples suffice). This can give an alternate proof of the lower bound for monotonicity testing, via a different reduction: first, test if the unknown distribution is monotone; if it is, test whether it is uniform, now assuming closeness to monotone.

More generally, this idea applies to any class C\mathcal{C} which (a) contains the uniform distribution, and (b) for which we have a o(n){o\left(\sqrt{n}\right)}-sample agnostic learner L\mathcal{L}, as follows. Assuming we have a tester T\mathcal{T} for C\mathcal{C} with sample complexity o(n){o\left(\sqrt{n}\right)}, define a uniformity tester as below.

test if D∈CD\in\mathcal{C} using T\mathcal{T}; if not, reject (as U∈C\mathcal{U}\in\mathcal{C}, DD cannot be uniform);

otherwise, agnostically learn DD with L\mathcal{L} (since DD is close to C\mathcal{C}), and obtain hypothesis D^\hat{D};

check offline if D^\hat{D} is close to uniform.

By assumption, T\mathcal{T} and L\mathcal{L} each use o(n){o\left(\sqrt{n}\right)} samples, so does the whole process; but this contradicts the lower bound of [BFR+00, Pan08] on uniformity testing. Hence, T\mathcal{T} must use Ω(n){\Omega\left(\sqrt{n}\right)} samples.

This “testing-by-narrowing” reduction argument can be further extended to other properties than to uniformity, as we show below:

Let C\mathcal{C} be a class of distributions over [n][n] for which the following holds:

there exists a semi-agnostic learner L\mathcal{L} for C\mathcal{C}, with sample complexity qL(n,ε,δ)q_{L}(n,\varepsilon,\delta) and “agnostic constant” cc;

there exists a subclass CHard⊆C\mathcal{C}_{\rm Hard}\subseteq\mathcal{C} such that testing CHard\mathcal{C}_{\rm Hard} requires qH(n,ε)q_{H}(n,\varepsilon) samples.

Suppose further that qL(n,ε,1/10)=o(qH(n,ε))q_{L}(n,\varepsilon,1/10)={o\left(q_{H}(n,\varepsilon)\right)}. Then, any tester for C\mathcal{C} must use Ω(qH(n,ε)){\Omega\left(q_{H}(n,\varepsilon)\right)} samples.

The above theorem relies on the reduction outlined above, which we rigorously detail here. Assuming C\mathcal{C}, CHard\mathcal{C}_{\rm Hard}, L\mathcal{L} as above (with semi-agnostic constant c≥1c\geq 1), and a tester T\mathcal{T} for C\mathcal{C} with sample complexity qT(n,ε)q_{T}(n,\varepsilon), we define a tester THard\mathcal{T}_{\rm Hard} for CHard\mathcal{C}_{\rm Hard}. On input ε∈(0,1]\varepsilon\in(0,1] and given sample access to a distribution DD on [n][n], THard\mathcal{T}_{\rm Hard} acts as follows:

call T\mathcal{T} with parameters nn, ε′c\frac{\varepsilon^{\prime}}{c} (where ε′=defε3\varepsilon^{\prime}\stackrel{{\scriptstyle\rm def}}{{=}}\frac{\varepsilon}{3}) and failure probability 1/61/6, to ε′c\frac{\varepsilon^{\prime}}{c}-test if D∈CD\in\mathcal{C}. If not, reject.

otherwise, agnostically learn a hypothesis D^\hat{D} for DD, with L\mathcal{L} called with parameters nn, ε′\varepsilon^{\prime} and failure probability 1/61/6;

check offline if D^\hat{D} is ε′\varepsilon^{\prime}-close to CHard\mathcal{C}_{\rm Hard}, accept if and only if this is the case.

Observing that the overall sample complexity is qT(n,ε′c)+qL(n,ε′,110)=qT(n,ε′c)+o(qH(n,ε′))q_{T}(n,\frac{\varepsilon^{\prime}}{c})+q_{L}(n,\varepsilon^{\prime},\frac{1}{10})=q_{T}(n,\frac{\varepsilon^{\prime}}{c})+{o\left(q_{H}(n,\varepsilon^{\prime})\right)} concludes the proof. ∎

Finally, we derive a lower bound on testing kk-SIIRVs from the agnostic learner of [DDO+13] (which has sample complexity poly⁡(k,1/ε)\operatorname*{poly}(k,1/\varepsilon) samples, independent of nn): See 1.1

2 Tolerant Testing

This lower bound framework from the previous section carries to tolerant testing as well, resulting in this analogue to Theorem 6.1:

Let C\mathcal{C} be a class of distributions over [n][n] for which the following holds:

there exists a semi-agnostic learner L\mathcal{L} for C\mathcal{C}, with sample complexity qL(n,ε,δ)q_{L}(n,\varepsilon,\delta) and “agnostic constant” cc;

there exists a subclass CHard⊆C\mathcal{C}_{\rm Hard}\subseteq\mathcal{C} such that tolerant testing CHard\mathcal{C}_{\rm Hard} requires qH(n,ε1,ε2)q_{H}(n,\varepsilon_{1},\varepsilon_{2}) samples for some parameters ε2>(4c+1)ε1\varepsilon_{2}>(4c+1)\varepsilon_{1}.

Suppose further that qL(n,ε2−ε1,1/10)=o(qH(n,ε1,ε2))q_{L}(n,\varepsilon_{2}-\varepsilon_{1},1/10)={o\left(q_{H}(n,\varepsilon_{1},\varepsilon_{2})\right)}. Then, any tolerant tester for C\mathcal{C} must use Ω(qH(n,ε1,ε2)){\Omega\left(q_{H}(n,\varepsilon_{1},\varepsilon_{2})\right)} samples (for some explicit parameters ε1′,ε2′\varepsilon^{\prime}_{1},\varepsilon^{\prime}_{2}).

The argument follows the same ideas as for Theorem 6.1, up to the details of the parameters. Assuming C\mathcal{C}, CHard\mathcal{C}_{\rm Hard}, L\mathcal{L} as above (with semi-agnostic constant c≥1c\geq 1), and a tolerant tester T\mathcal{T} for C\mathcal{C} with sample complexity q(n,ε1,ε2)q(n,\varepsilon_{1},\varepsilon_{2}), we define a tolerant tester THard\mathcal{T}_{\rm Hard} for CHard\mathcal{C}_{\rm Hard}. On input 0<ε1<ε2≤10<\varepsilon_{1}<\varepsilon_{2}\leq 1 with ε2>(4c+1)ε1\varepsilon_{2}>(4c+1)\varepsilon_{1}, and given sample access to a distribution DD on [n][n], THard\mathcal{T}_{\rm Hard} acts as follows. After setting ε1′=defε2−ε14\varepsilon^{\prime}_{1}\stackrel{{\scriptstyle\rm def}}{{=}}\frac{\varepsilon_{2}-\varepsilon_{1}}{4}, ε2′=defε2−ε12\varepsilon^{\prime}_{2}\stackrel{{\scriptstyle\rm def}}{{=}}\frac{\varepsilon_{2}-\varepsilon_{1}}{2}, ε′=defε2−ε116\varepsilon^{\prime}\stackrel{{\scriptstyle\rm def}}{{=}}\frac{\varepsilon_{2}-\varepsilon_{1}}{16} and τ=def6ε2+10ε116\tau\stackrel{{\scriptstyle\rm def}}{{=}}\frac{6\varepsilon_{2}+10\varepsilon_{1}}{16},

otherwise, agnostically learn a hypothesis D^\hat{D} for DD, with L\mathcal{L} called with parameters nn, ε′\varepsilon^{\prime} and failure probability 1/61/6;

check offline if D^\hat{D} is τ\tau-close to CHard\mathcal{C}_{\rm Hard}, accept if and only if this is the case.

Observing that the overall sample complexity is qT(n,ε1′c,ε2′c)+qL(n,ε′,110)=qT(n,ε′c)+o(qH(n,ε′))q_{T}(n,\frac{\varepsilon^{\prime}_{1}}{c},\frac{\varepsilon^{\prime}_{2}}{c})+q_{L}(n,\varepsilon^{\prime},\frac{1}{10})=q_{T}(n,\frac{\varepsilon^{\prime}}{c})+{o\left(q_{H}(n,\varepsilon^{\prime})\right)} concludes the proof. ∎

There exists an absolute constant ε0>0\varepsilon_{0}>0 such that the following holds. Any algorithm which, given sampling access to an unknown distribution DD on Ω\Omega and parameter ε∈(0,ε0)\varepsilon\in(0,\varepsilon_{0}), distinguishes with probability at least 2/32/3 between (i) ∥D−Bin⁡ ⁣(n,1/2)∥1≤ε{\lVert D-\operatorname{Bin}\!\left(n,1/2\right){\rVert}}_{1}\leq\varepsilon and (ii) ∥D−Bin⁡ ⁣(n,1/2)∥1≥100ε{\lVert D-\operatorname{Bin}\!\left(n,1/2\right){\rVert}}_{1}\geq 100\varepsilon must use Ω(1εnlog⁡n){\Omega\left(\frac{1}{\varepsilon}\frac{\sqrt{n}}{\log n}\right)} samples.

The proof relies on a reduction from tolerant testing of uniformity, drawing on a result of Valiant and Valiant [VV10]; for the sake of conciseness, the details are deferred to Appendix D. With Theorem 6.3 in hand, we can apply Theorem 6.2 to obtain the desired lower bound: See 1.1

We observe that both Section 1.1 and Section 1.1 are tight (with regard to the dependence on nn), as proven in the next section (Section 7).

A Generic Tolerant Testing Upper Bound

To conclude this work, we address the question of tolerant testing of distribution classes. In the same spirit as before, we focus on describing a generic approach to obtain such bounds, in a clean conceptual manner. The most general statement of the result we prove in this section is stated below, which we then instantiate to match the lower bounds from Section 6.2:

Let C\mathcal{C} be a class of distributions over [n][n] for which the following holds:

there exists a semi-agnostic learner L\mathcal{L} for C\mathcal{C}, with sample complexity qL(n,ε,δ)q_{L}(n,\varepsilon,\delta) and “agnostic constant” cc;

for any η∈\eta\in, every distribution in C\mathcal{C} has η\eta-effective support of size at most M(n,η)M(n,\eta).

Applying now the theorem with M(n,ε)=nlog⁡(1/ε)M(n,\varepsilon)=\sqrt{n\log(1/\varepsilon)} (as per Section 5.2), we obtain an improved upper bound for Binomial and Poisson Binomial distributions: See 1.1

Somewhat similar to the lower bound framework developed in Section 6, the gist of the approach is to reduce the problem of tolerant testing membership of DD to the class C\mathcal{C} to that of tolerant testing identity to a known distribution – namely, the distribution D^\hat{D} obtained after trying to agnostically learn DD. Intuitively, an agnostic learner for C\mathcal{C} should result in a good enough hypothesis D^\hat{D} (i.e., D^\hat{D} close enough to both DD and C\mathcal{C}) when DD is ε1\varepsilon_{1}-close to C\mathcal{C}; but output a D^\hat{D} that is significantly far from either DD or C\mathcal{C} when DD is ε2\varepsilon_{2}-far from C\mathcal{C} – sufficiently for us to be able to tell. Besides the many technical details one has to control for the parameters to work out, one key element is the use of a tolerant testing algorithm for closeness of two distributions due to [VV11b], whose (tight) sample complexity scales as n/log⁡nn/\log n for a domain of size nn. In order to get the right dependence on the effective support (required in particular for Section 1.1), we have to perform a first test to identify the effective support of the distribution and check its size, in order to only call this tolerant closeness testing algorithm on this much smaller subset. (This additional preprocessing step itself has to be carefully done, and comes at the price of a slightly worse constant C=C(c,κ)C=C(c,\kappa) in the statement of the theorem.)

1 Proof of Theorem 7.1

As described in the preceding section, the algorithm will rely on the ability to perform tolerant testing of equivalence between two unknown distributions (over some known domain of size mm). This is ensured by an algorithm of Valiant and Valiant, restated below:

There exists an algorithm E\mathcal{E} which, given sampling access to two unknown distributions D1,D2D_{1},D_{2} over [m][m], satisfies the following. On input ε∈(0,1]\varepsilon\in(0,1], it takes O(1ε2mlog⁡m)O(\frac{1}{\varepsilon^{2}}\frac{m}{\log m}) samples from D1D_{1} and D2D_{2}, and outputs a value Δ\Delta such that ∣∥D1−D2∥1−Δ∣≤ε\lvert{\lVert D_{1}-D_{2}{\rVert}}_{1}-\Delta\rvert\leq\varepsilon with probability 1−1/poly⁡(m)1-1/\operatorname*{poly}(m). (Furthermore, E\mathcal{E} runs in time poly⁡(m)\operatorname*{poly}(m).)

For the proof, we will also need this fact, similar to Section 5, which relates the distance of two distributions to that of their conditional distributions on a subset of the domain:

Let DD and PP be distributions over [n][n], and I⊆[n]I\subseteq[n] an interval such that D(I)≥1−αD(I)\geq 1-\alpha and P(I)≥1−βP(I)\geq 1-\beta. Then,

∥DI−PI∥1≤32∥D−P∥1D(I)≤3∥D−P∥1{\lVert D_{I}-P_{I}{\rVert}}_{1}\leq\frac{3}{2}\frac{{\lVert D-P{\rVert}}_{1}}{D(I)}\leq 3{\lVert D-P{\rVert}}_{1} (the last inequality for α≤12\alpha\leq\frac{1}{2}); and

∥DI−PI∥1≥∥D−P∥1−2(α+β){\lVert D_{I}-P_{I}{\rVert}}_{1}\geq\frac{}{}{\lVert D-P{\rVert}}_{1}-2(\alpha+\beta).

where we used the fact that ∣P(I)−D(I)∣≤dTV⁡ ⁣(D,P)=12∥D−P∥1\left\lvert P(I)-D(I)\right\rvert\leq{\operatorname{d_{\rm TV}}\!\left({D,P}\right)}=\frac{1}{2}{\lVert D-P{\rVert}}_{1}. Turning now to the second item, we have:

With these two ingredients, we are in position to establish our theorem:

The algorithm proceeds as follows, where we set ε=defε2−ε117κ\varepsilon\stackrel{{\scriptstyle\rm def}}{{=}}\frac{\varepsilon_{2}-\varepsilon_{1}}{17\kappa}, θ=defε2−((6+c)ε1+11ε)\theta\stackrel{{\scriptstyle\rm def}}{{=}}\varepsilon_{2}-((6+c)\varepsilon_{1}+11\varepsilon), and τ=def2(3+c)ε1+5ε2\tau\stackrel{{\scriptstyle\rm def}}{{=}}2\frac{(3+c)\varepsilon_{1}+5\varepsilon}{2}:

invoke L\mathcal{L} on DD with parameters ε\varepsilon and failure probability 110\frac{1}{10}, to obtain a hypothesis D^\hat{D};

call E\mathcal{E} (from Theorem 7.2) on DID_{I}, D^I\hat{D}_{I} with parameter ε6\frac{\varepsilon}{6} to get an estimate Δ^\hat{\Delta} of ∥DI−D^I∥1{\lVert D_{I}-\hat{D}_{I}{\rVert}}_{1};

output REJECT is Δ+Δ^>θ\Delta+\hat{\Delta}>\theta, and output ACCEPT otherwise.

The claimed sample complexity is immediate from Steps 2 and 3, along with Theorem 7.2. Turning to correctness, we condition on both subroutines meeting their guarantee (i.e., ∥D−D^∥1≤c⋅\textscopt+ε{\lVert D-\hat{D}{\rVert}}_{1}\leq c\cdot{\textsc{opt}}+\varepsilon and ∥D−D^∥1∈[Δ^−ε,Δ^+ε]{\lVert D-\hat{D}{\rVert}}_{1}\in[\hat{\Delta}-\varepsilon,\hat{\Delta}+\varepsilon]), which happens with probability at least 8/10−1/poly⁡(n)≥3/48/10-1/\operatorname*{poly}(n)\geq 3/4 by a union bound.

and the algorithm does not reject in Step 4. To conclude, one has by 7.3 that

Finally, the testing algorithm defined above is computationally efficient as long as both the learning algorithm (Step 2) and the estimation procedure (Step 5) are.

References

Appendix A Proof of Section 2.2

We now give the proof of Section 2.2, restated below: See 2.2

To do so, we first describe an algorithm that distinguishes between ∥D−U∥22≥ε2/n{\lVert D-\mathcal{U}{\rVert}}_{2}^{2}\geq\varepsilon^{2}/{n} and ∥D−U∥22<ε2/(2n){\lVert D-\mathcal{U}{\rVert}}_{2}^{2}<\varepsilon^{2}/(2n) with probability at least 2/32/3, using C⋅nε2C\cdot\frac{\sqrt{n}}{\varepsilon^{2}} samples. Boosting the success probability to 1−δ1-\delta at the price of a multiplicative log⁡1δ\log\frac{1}{\delta} factor can then be achieved by standard techniques.

Similarly as in the proof of Theorem 11 (whose algorithm we use, but with a threshold τ=def34m2ε2n\tau\stackrel{{\scriptstyle\rm def}}{{=}}\frac{3}{4}\frac{m^{2}\varepsilon^{2}}{n} instead of 4mn\frac{4m}{\sqrt{n}}), define the quantities

(after expanding and since ∑k=1nΔk=0\sum_{k=1}^{n}\Delta_{k}=0).

As Δ2≥ε2n\Delta^{2}\geq\frac{\varepsilon^{2}}{n}, we get m2Δ2≥C2ε2m^{2}\Delta^{2}\geq\frac{C^{2}}{\varepsilon^{2}}, and thus m2Δ4288≥C2288ε2Δ2≥Δ2\frac{m^{2}\Delta^{4}}{288}\geq\frac{C^{2}}{288\varepsilon^{2}}\Delta^{2}\geq\Delta^{2} (as C≥17C\geq 17 and ε≤1\varepsilon\leq 1).

Similarly, m2Δ4288≥C2288ε2⋅ε2n≥1n\frac{m^{2}\Delta^{4}}{288}\geq\frac{C^{2}}{288\varepsilon^{2}}\cdot\frac{\varepsilon^{2}}{n}\geq\frac{1}{n}.

we get that ∣2m∑k=1n∣Δk∣3∣≤2mΔ3=m2Δ4288⋅2⋅288mΔ≤m2Δ4288\left\lvert 2m\sum_{k=1}^{n}\left\lvert\Delta_{k}\right\rvert^{3}\right\rvert\leq 2m\Delta^{3}=\frac{m^{2}\Delta^{4}}{288}\cdot\frac{2\cdot 288}{m\Delta}\leq\frac{m^{2}\Delta^{4}}{288}, using the fact that mΔ2⋅288≥C576ε≥1\frac{m\Delta}{2\cdot 288}\geq\frac{C}{576\varepsilon}\geq 1 (by choice of C≥576C\geq 576).

Overall, the LHS is at most 3⋅m2Δ4288=m2Δ4963\cdot\frac{m^{2}\Delta^{4}}{288}=\frac{m^{2}\Delta^{4}}{96}, as claimed.

Assume Δ2=∥D−U∥22<ε2/(4n)\Delta^{2}={\lVert D-\mathcal{U}{\rVert}}_{2}^{2}<\varepsilon^{2}/(4n). We need to show that Pr⁡ ⁣[ Z≥τ ]≤1/3\Pr\!\left[\,Z\geq\tau\,\right]\leq 1/3. Chebyshev’s inequality implies

and therefore it is sufficient to show that

Since 1+nΔ2−2nm∑k=1nΔk3≤1+nΔ2≤1+ε2/4≤5/4\sqrt{1+n\Delta^{2}-2nm\sum_{k=1}^{n}\Delta_{k}^{3}}\leq\sqrt{1+n\Delta^{2}}\leq\sqrt{1+\varepsilon^{2}/4}\leq\sqrt{5/4}, we get that the second term is at most 30/4<3\sqrt{30/4}<3. All that remains is to show that mnΔ2≥3mε24n−3m\sqrt{n}\Delta^{2}\geq 3m\frac{\varepsilon^{2}}{4\sqrt{n}}-3. But as Δ2<ε2/(4n)\Delta^{2}<\varepsilon^{2}/(4n), mnΔ2≤mε24nm\sqrt{n}\Delta^{2}\leq m\frac{\varepsilon^{2}}{4\sqrt{n}}; and our choice of m≥C⋅nε2m\geq C\cdot\frac{\sqrt{n}}{\varepsilon^{2}} for some absolute constant C≥6C\geq 6 ensures this holds. ∎

Appendix B Proof of Theorem 4.2

In this section, we prove our structural result for MHR distributions, Theorem 4.2: See 4.2

We reproduce and adapt the argument of [CDSS13, Section 5.1] to meet our definition of decomposability (which, albeit related, is incomparable to theirs). First, we modify the algorithm at the core of their constructive proof, in Algorithm 3: note that the only two changes are in Steps 3 and 4, where we use parameters respectively γn\frac{\gamma}{n} and γn2\frac{\gamma}{n^{2}}.

Following the structure of their proof, we write Q={I1,…,I∣Q∣}\mathcal{Q}=\{I_{1},\dots,I_{\left\lvert\mathcal{Q}\right\rvert}\} with Ii=[ai,bi]I_{i}=[a_{i},b_{i}], and define Q′={  Ii∈Q   ⁣:  D(ai)>D(ai+1)  }\mathcal{Q}^{\prime}=\left\{\;I_{i}\in\mathcal{Q}\;\colon\;D(a_{i})>D(a_{i+1})\;\right\}, Q′′={  Ii∈Q   ⁣:  D(ai)≤D(ai+1)  }\mathcal{Q}^{\prime\prime}=\left\{\;I_{i}\in\mathcal{Q}\;\colon\;D(a_{i})\leq D(a_{i+1})\;\right\}.

We immediately obtain the analogues of their Lemmas 5.2 and 5.3:

We have ∏Ii∈Q′D(ai)D(ai+1)≤nγ\prod_{I_{i}\in\mathcal{Q}^{\prime}}\frac{D(a_{i})}{D(a_{i+1})}\leq\frac{n}{\gamma}.

Step 5 of Algorithm 3 adds at most O(1εlog⁡nε){O\left(\frac{1}{\varepsilon}\log\frac{n}{\varepsilon}\right)} intervals to Q\mathcal{Q}.

This derives from observing that now D(I∪I′)≥γ/nD(I\cup I^{\prime})\geq\gamma/n, which as in [CDSS13, Lemma 5.3] in turn implies

so that ∣Q′∣=O(1εlog⁡nε)\left\lvert\mathcal{Q}^{\prime}\right\rvert={O\left(\frac{1}{\varepsilon}\log\frac{n}{\varepsilon}\right)}.

Again following their argument, we also get

by combining Appendix B with the fact that D(a∣Q∣+1≤1D(a_{\left\lvert\mathcal{Q}\right\rvert+1}\leq 1 and that by construction D(ai)≥γ/n2D(a_{i})\geq\gamma/n^{2}, we get

But since each term in the product is at least (1+γ)(1+\gamma) (by construction of Q\mathcal{Q} and the definition of Q′′\mathcal{Q}^{\prime\prime}), this leads to

and thus ∣Q′′∣=O(1εlog⁡nε)\left\lvert\mathcal{Q}^{\prime\prime}\right\rvert={O\left(\frac{1}{\varepsilon}\log\frac{n}{\varepsilon}\right)} as well. ∎

It remains to show that Q∪{I,I′,I′′}\mathcal{Q}\cup\{I,I^{\prime},I^{\prime\prime}\} is indeed a good decomposition of [n][n] for DD, as per Section 3. Since by construction every interval in Q\mathcal{Q} satisfies item ii, we only are left with the case of II, I′I^{\prime} and I′′I^{\prime\prime}. For the first two, as they were returned by Right-Interval either (a) they are singletons, in which case item ii trivially holds; or (b) they have at least two elements, in which case they have probability mass at most γn\frac{\gamma}{n} (by the choice of parameters for Right-Interval) and thus item i is satisfied. Finally, it is immediate to see that by construction D(I′′)≤n⋅γ/n2=γ/nD(I^{\prime\prime})\leq n\cdot\gamma/n^{2}=\gamma/n, and item i holds in this case as well. ∎

Appendix C Proofs from Section 4

This section contains the proofs omitted from Section 4, namely the distance estimation procedures for tt-piecewise degree-dd (Theorem 4.4), monotone hazard rate (Section 4.2.1), and log-concave distributions (Section 4.2.1).

As mentioned in Section 4, the proof of this statement is a rather straightforward adaption of the proof of [CDSS14a, Theorem 9], with two differences: first, in our setting there is no uncertainty nor probabilistic argument due to sampling, as we are provided with an explicit description of the histogram pp. Second, Chan et al. require some “well-behavedness” assumption on the distribution pp (for technical reasons essentially due to the sampling access), that we remove here. Besides these two points, the proof is almost identical to theirs, and we only reproduce (our modification of) it here for the sake of completeness. (Any error introduced in the process, however, is solely our responsibility.)

Some preliminary definitions will be helpful:

We will also use the following notation: For this subsection, let I=[−1,1)I={[-1,1)} (II will denote a subinterval of [−1,1)[-1,1) when the results are applied in the next subsection). We write ∥f∥1(I)\|f\|^{(I)}_{1} to denote ∫I∣f(x)∣dx\int_{I}|f(x)|dx, and we write dTV⁡(I)(p,q)\operatorname{d_{\rm TV}}^{(I)}(p,q) to denote ∥p−q∥1(I)/2{\lVert p-q{\rVert}}_{1}^{(I)}/2. We write \textscopt1,d(I){\textsc{opt}}^{(I)}_{1,d} to denote the infimum of the distance ∥p−g∥1(I){\lVert p-g{\rVert}}_{1}^{(I)} between pp and any degree-dd subdistribution gg on II that satisfies g(I)=p(I)g(I)=p(I).

The key step of ProjectSinglePoly is Step 4 where it calls the FindSinglePoly procedure. In this procedure Ti(x)T_{i}(x) denotes the degree-ii Chebychev polynomial of the first kind. The function FindSinglePoly should be thought of as the CDF of a “quasi-distribution” ff; we say that f=F′f=F^{\prime} is a “quasi-distribution” and not a bona fide probability distribution because it is not guaranteed to be non-negative everywhere on [−1,1)[-1,1). Step 4 of FindSinglePoly processes ff slightly to obtain a polynomial qq which is an actual distribution over [−1,1).[-1,1).

We begin by observing that ProjectSinglePoly calls FindSinglePoly with input parameters that satisfy FindSinglePoly’s input requirements:

the non-singleton intervals I0,…,Iz−1I_{0},\dots,I_{z-1} are (p,η)(p,\eta)-uniform; and

the singleton intervals each have weight at least η10\frac{\eta}{10}.

We then proceed to show that, from there, FindSinglePoly’s LP is feasible and has a high-quality optimal solution.

We first argue feasibility of the above solution. We first take care of the easy constraints: since FF is the cdf of a subdistribution over II it is clear that constraints a and e are satisfied, and since both rr and pp are pdfs with the same total weight it is clear that constraints c(4) and f are both satisfied. Constraints c(5) and c(6) also hold. So it remains to argue constraints b and d.

Note that constraint b is equivalent to p+(r−p)=rp+({r}-p)={r} and r{r} satisfying (I,ε/(d+1),ε)(\mathcal{I},\varepsilon/(d+1),\varepsilon)-inequalities, therefore this constraint is satisfied.

To see that constraint d is satisfied we recall some of the analysis of Arora and Khot [AK03, Section 3]. This analysis shows that since FF is a cumulative distribution function (and in particular a function bounded between 0 and 1 on II) each of its Chebychev coefficients is at most 2\sqrt{2} in magnitude.

So q(x)q(x) is indeed a degree-dd pdf. To prove Theorem C.1 it remains to show that ∥p−q∥1≤3\textscopt1,d+O(ε).{\lVert p-q{\rVert}}_{1}\leq 3{\textsc{opt}}_{1,d}+O(\varepsilon).

We will use the following lemma that translates (I,η,ε)(\mathcal{I},\eta,\varepsilon)-inequalities into a bound on Ad+1\mathcal{A}_{d+1} distance.

To analyze ∥p−h∥Ad+1\lVert p-h{\rVert}_{\mathcal{A}_{d+1}}, consider any union of d+1{d+1} disjoint non-overlapping intervals S=J1∪⋯∪Jd+1S=J_{1}\cup\dots\cup J_{d+1}. We will bound ∥p−h∥Ad+1\lVert p-h{\rVert}_{\mathcal{A}_{d+1}} by bounding ∣p(S)−h(S)∣\left\lvert p(S)-h(S)\right\rvert.

Now rewrite TT as a disjoint union of s≤d+1s\leq{d+1} intervals [iL1,iR1)∪⋯∪[iLs,iRs)[i_{L_{1}},i_{R_{1}})\cup\dots\cup[i_{L_{s}},i_{R_{s}}). We have

by (I,η,ε)(\mathcal{I},\eta,\varepsilon)-inequalities between pp and hh. Now observing that that 0≤L1≤R1⋯≤Ls≤Rs≤t=O((d+1)/ε)0\leq L_{1}\leq R_{1}\cdots\leq L_{s}\leq R_{s}\leq t=O((d+1)/\varepsilon), we get that the largest possible value of ∑j=1sRj−Lj\sum_{j=1}^{s}\sqrt{R_{j}-L_{j}} is sz≤(d+1)z\sqrt{sz}\leq{\sqrt{{(d+1)}z}}, so the RHS of (7) is at most O((d+1)η)+(d+1)zεηO({(d+1)}\eta)+{\sqrt{{(d+1)}z\varepsilon}\eta}, as desired. ∎

Next, by the triangle inequality we have (writing A{\cal A} for Ad+1{\cal A}_{d+1})

The last term on the RHS has just been shown to be O(ε)O(\varepsilon). The first term is bounded by

Altogether, we get that ∥r−f∥A≤\textscopt1,d+O(ε)\lVert r-f{\rVert}_{\cal A}\leq{\textsc{opt}}_{1,d}+O(\varepsilon).

Since rr and ff are degree dd polynomials, ∥r−f∥1=2∥r−f∥A≤2\textscopt1,d+O(ε){\lVert r-f{\rVert}}_{1}=2\lVert r-f{\rVert}_{\cal A}\leq 2{\textsc{opt}}_{1,d}+O(\varepsilon). This implies ∥p−f∥1≤∥p−r∥1+∥r−f∥1≤3\textscopt1,d+O(ε){\lVert p-f{\rVert}}_{1}\leq{\lVert p-r{\rVert}}_{1}+{\lVert r-f{\rVert}}_{1}\leq 3{\textsc{opt}}_{1,d}+O(\varepsilon). Finally, we turn our quasidistribution ff which has value ≥−ε/2\geq-\varepsilon/2 everywhere into a distribution qq (which is nonnegative), by redistributing the weight. The following simple proposition bounds the error incurred.

Let ff and pp be any sub-quasidistribution on II. If q=εf(I)/∣I∣+(1−ε)fq={\varepsilon f(I)/\left\lvert I\right\rvert+(1-\varepsilon)f}, then ∥q−p∥1≤∥f−p∥1+ε(f(I)+p(I))\lVert q-p{\rVert}_{1}\leq\lVert f-p{\rVert}_{1}+{\varepsilon(f(I)+p(I))}.

We now have ∥p−q∥1≤∥p−f∥1+O(ε){\lVert p-q{\rVert}}_{1}\leq{\lVert p-f{\rVert}}_{1}+O(\varepsilon) by Section C.1, concluding the proof of Theorem C.1. ∎

C.2 Proof of Section 4.2.1

For convenience, let α=defε3\alpha\stackrel{{\scriptstyle\rm def}}{{=}}\varepsilon^{3}; we also write [i,j][i,j] instead of {i,…,j}\{i,\dots,j\}.

DD is 32ε32\varepsilon-far from monotone hazard rate

We then proceed by observing the following easy fact: suppose PP is a MHR distribution on [n][n], i.e. such that the quantity hi=defP(i)∑j=inP(i)h_{i}\stackrel{{\scriptstyle\rm def}}{{=}}\frac{P(i)}{\sum_{j=i}^{n}P(i)}, i∈[n]i\in[n] is non-increasing. Then, we have

and there is a bijective correspondence between PP and (hi)i∈[n](h_{i})_{i\in[n]}.

We will write a linear program with variables y1,…,yny_{1},\dots,y_{n}, with the correspondence yi=defln⁡(1−hi)y_{i}\stackrel{{\scriptstyle\rm def}}{{=}}\ln(1-h_{i}). Note that with this parameterization, we get that if the (yi)i∈[n](y_{i})_{i\in[n]} correspond to a MHR distribution PP, then for i∈[n]i\in[n]

and asking that ln⁡(1−ε)≤∑j=1i−1yj−ln⁡D([i,n])≤ln⁡(1+ε)\ln(1-\varepsilon)\leq\sum_{j=1}^{i-1}y_{j}-\ln D([i,n])\leq\ln(1+\varepsilon) amounts to requiring

We focus first on the completeness case, to provide intuition for the linear program. Suppose there exists P∈MHRP\in\mathcal{MHR} such P∈MHRP\in\mathcal{MHR} such that ∥D−P∥1≤ε{\lVert D-P{\rVert}}_{1}\leq\varepsilon and ∥D′−P∥Kol≤α{\lVert D^{\prime}-P{\rVert}_{\rm Kol}}\leq\alpha. This implies that for all i∈[n]i\in[n], ∣P([i,n])−D([i,n])∣≤2α\left\lvert P([i,n])-D([i,n])\right\rvert\leq 2\alpha. Define I={b+1,…,n}I=\{b+1,\dots,n\} to be the longest interval such that D({b+1,…,n})≤ε2D(\{b+1,\dots,n\})\leq\frac{\varepsilon}{2}. It follows that for every i∈[n]∖Ii\in[n]\setminus I,

and similarly P([i,n])D([i,n])≥D([i,n])−2αD([i,n]≥1−ε\frac{P([i,n])}{D([i,n])}\geq\frac{D([i,n])-2\alpha}{D([i,n]}\geq 1-\varepsilon. This means that for the points ii in [n]∖I[n]\setminus I, we can write constraints asking for multiplicative closeness (within 1±ε)1\pm\varepsilon) between e∑j=1i−1yje^{\sum_{j=1}^{i-1}y_{j}} and D([i,n])D([i,n]), which is very easy to write down as linear constraints on the yiy_{i}’s.

Let TT and SS be respectively the sets of “light” and “heavy” points, defined as T={  i∈{1,…,b}   ⁣:  D(i)≤ε2  }T=\left\{\;i\in\{1,\dots,b\}\;\colon\;D(i)\leq\varepsilon^{2}\;\right\} and S={  i∈{1,…,b}   ⁣:  D(i)>ε2  }S=\left\{\;i\in\{1,\dots,b\}\;\colon\;D(i)>\varepsilon^{2}\;\right\}, where bb is as above. (In particular, ∣S∣≤1/ε2\left\lvert S\right\rvert\leq 1/\varepsilon^{2}.)

Suppose P∈MHRP\in\mathcal{MHR} is as promised. In particular, by the Kolmogorov distance assumption we know that every i∈Ti\in T has P(i)≤ε2+2α<2ε2P(i)\leq\varepsilon^{2}+2\alpha<2\varepsilon^{2}.

For any i∈Ti\in T, we have that P(i)P[i,n]≤2ε2(1−ε)ε≤4ε\frac{P(i)}{P[i,n]}\leq\frac{2\varepsilon^{2}}{(1-\varepsilon)\varepsilon}\leq 4\varepsilon, and

For i∈Si\in S, Constraint (18) is also met, as P(i)P([i,n])∈[D(i)−2αP([i,n]),D(i)+2αP([i,n])]⊆[D(i)−2α(1+ε)D([i,n]),D(i)+2α(1−ε)D([i,n])]\frac{P(i)}{P([i,n])}\in\left[\frac{D(i)-2\alpha}{P([i,n])},\frac{D(i)+2\alpha}{P([i,n])}\right]\subseteq\left[\frac{D(i)-2\alpha}{(1+\varepsilon)D([i,n])},\frac{D(i)+2\alpha}{(1-\varepsilon)D([i,n])}\right].

To analyze the contribution from SS, we observe that Constraint (18) implies that, for any i∈Si\in S,

which combined with Constraint (14) guarantees

The running time is immediate, from executing the two linear programs on poly⁡(n,1/ε)\operatorname*{poly}(n,1/\varepsilon) variables and constraints. ∎

C.3 Proof of Section 4.2.1

We set α=defε2log⁡2(1/ε)\alpha\stackrel{{\scriptstyle\rm def}}{{=}}\frac{\varepsilon^{2}}{\log^{2}(1/\varepsilon)}, β=defε2log⁡(1/ε)\beta\stackrel{{\scriptstyle\rm def}}{{=}}\frac{\varepsilon^{2}}{\log(1/\varepsilon)}, and γ=defε210\gamma\stackrel{{\scriptstyle\rm def}}{{=}}\frac{\varepsilon^{2}}{10} (so that α≪β≪γ≪ε\alpha\ll\beta\ll\gamma\ll\varepsilon),

Given the explicit description of a distribution DD on [n][n], which a kk-histogram over a partition I=(I1,…,Ik)\mathcal{I}=(I_{1},\dots,I_{k}) of [n][n] with k=poly⁡(log⁡n,1/ε)k=\operatorname*{poly}(\log n,1/\varepsilon) and the explicit description of a distribution D′D^{\prime} on [n][n], one must efficiently distinguish between:

DD is 100ε100\varepsilon-far from log-concave.

If we are willing to pay an extra factor of O(n){O\left(n\right)}, we can assume without loss of generality that we know the mode of the closest log-concave distribution (which is implicitly assumed in the following: the final algorithm will simply try all possible modes).

We will require the following result of Chan, Diakonikolas, Servedio, and Sun:

Let DD be a distribution over [n][n], log-concave and non-decreasing over {1,…,b}⊆[n]\{1,\dots,b\}\subseteq[n]. Let a≤ba\leq b such that σ=D({1,…,a−1})>0\sigma=D(\{1,\dots,a-1\})>0, and write τ=D({a,…,b})\tau=D(\{a,\dots,b\}). Then D(b)D(a)≤1+τσ\frac{D(b)}{D(a)}\leq 1+\frac{\tau}{\sigma}.

C.3.1 Step 1

DD is 97ε97\varepsilon-far from log-concave;

This way, we have reduced the problem to a slightly more convenient one, that of Section C.3.2.

The next step is to compute a good approximation of the support of any target log-concave distribution. This is easily obtained in time O(k)O(k) as the interval {a,⋯ ,b}\{a,\cdots,b\} such that

D({1,…,a−1})≤αD(\{1,\dots,a-1\})\leq\alpha but D({1,…,a})>αD(\{1,\dots,a\})>\alpha; and

D({b+1,…,}n)≤αD(\{b+1,\dots,\}n)\leq\alpha but D({b,…,n})>αD(\{b,\dots,n\})>\alpha.

C.3.2 Step 2

Given the explicit description of a unimodal distribution DD on [n][n], which a kk-histogram over a partition I=(I1,…,Ik)\mathcal{I}=(I_{1},\dots,I_{k}) of [n][n] with k=poly⁡(log⁡n,1/ε)k=\operatorname*{poly}(\log n,1/\varepsilon), one must efficiently distinguish between:

DD is 24ε24\varepsilon-far from log-concave,

assuming we know the mode of the closest log-concave distribution, which has support [n][n].

As DD is unimodal, we can efficiently (O(log⁡k){O\left(\log k\right)}) find the interval SS of heavy points, that is

Each point in SS will form a singleton interval in our partition. Let T=def[n]∖ST\stackrel{{\scriptstyle\rm def}}{{=}}[n]\setminus S be its complement (TT is the union of at most two intervals T1,T2T_{1},T_{2} on which DD is monotone, the head and tail of the distribution). For convenience, we focus on only one of these two intervals, without loss of generality the “head” T1T_{1} (on which DD is non-decreasing).

Greedily find J={1,…,a}J=\{1,\dots,a\}, the smallest prefix of the distribution satisfying D(J)∈[ε10−β,ε10]D(J)\in\left[\frac{\varepsilon}{10}-\beta,\frac{\varepsilon}{10}\right].

Similarly, partition T1∖JT_{1}\setminus J into intervals I1′,…,Is′I^{\prime}_{1},\dots,I^{\prime}_{s} (with s=O(1/γ)=O(1/ε2)s={O\left(1/\gamma\right)}={O\left(1/\varepsilon^{2}\right)}) such that γ10≤D(Ij′)≤910γ\frac{\gamma}{10}\leq D(I^{\prime}_{j})\leq\frac{9}{10}\gamma for all 1≤j≤s−11\leq j\leq s-1, and γ10≤D(Is′)≤γ\frac{\gamma}{10}\leq D(I^{\prime}_{s})\leq\gamma. This is possible as all points not in SS have weight less than β\beta, and β≪γ\beta\ll\gamma.

We focus on the completeness case: let P∈LP\in\mathcal{L} be a log-concave distribution such that ∥D−P∥1≤ε{\lVert D-P{\rVert}}_{1}\leq\varepsilon and ∥D−P∥Kol≤α{\lVert D-P{\rVert}_{\rm Kol}}\leq\alpha. Applying Theorem C.2 on JJ and the Ij′I^{\prime}_{j}’s, we obtain (using the fact that ∣P(Ij′)−D(Ij′)∣≤2α\left\lvert P(I^{\prime}_{j})-D(I^{\prime}_{j})\right\rvert\leq 2\alpha) that:

Moreover, we also get that each resulting interval Ij′I^{\prime}_{j} will satisfy

with κj=def2αD(Ij′)=Θ(1/log⁡2(1/ε))\kappa_{j}\stackrel{{\scriptstyle\rm def}}{{=}}\frac{2\alpha}{D(I^{\prime}_{j})}={\Theta\left(1/\log^{2}(1/\varepsilon)\right)}.

The (at most) two end intervals have D(J)∈[ε10−β,ε10]D(J)\in\left[\frac{\varepsilon}{10}-\beta,\frac{\varepsilon}{10}\right], and thus P(J)∈[ε10−β−2α,ε10+2α]P(J)\in\left[\frac{\varepsilon}{10}-\beta-2\alpha,\frac{\varepsilon}{10}+2\alpha\right];

each other interval I=Ij′I=I^{\prime}_{j} satisfies

with κj=O(1/log⁡2(1/ε))\kappa_{j}={O\left(1/\log^{2}(1/\varepsilon)\right)}; and

We will use in the constraints of the linear program the fact that (1+32ε)(1+κj)≤1+2ε(1+\frac{3}{2}\varepsilon)(1+\kappa_{j})\leq 1+2\varepsilon, and 1−κj1+32ε≥11+2ε\frac{1-\kappa_{j}}{1+\frac{3}{2}\varepsilon}\geq\frac{1}{1+2\varepsilon}.

C.3.3 Step 3

A feasible solution to this linear program will define (setting pi=exip_{i}=e^{x_{i}}) a sequence p=(p1,…,pn)∈(0,1]np=(p_{1},\dots,p_{n})\in(0,1]^{n} such that

pp is “(1+O(ε))(1+O(\varepsilon))-multiplicatively constant” on each interval JjJ_{j} (from (24));

pp puts roughly the right amount of weight on each JiJ_{i}:

it puts weight approximately D(J)D(J) on every singleton JJ from SS, i.e. such that D(J)≥βD(J)\geq\beta. To see why, observe that each εi\varepsilon_{i} is in [0,2α][0,2\alpha] by constraints (27). In particular, this means that εiD(i)≤2αβ≪1\frac{\varepsilon_{i}}{D(i)}\leq 2\frac{\alpha}{\beta}\ll 1, and we have

If There is PP in L\mathcal{L} such that ∥D−P∥1≤ε{\lVert D-P{\rVert}}_{1}\leq\varepsilon and ∥D−P∥Kol≤α{\lVert D-P{\rVert}_{\rm Kol}}\leq\alpha, then the linear program (Algorithm 7) has a feasible solution.

Let P∈LP\in\mathcal{L} such that ∥D−P∥1≤ε{\lVert D-P{\rVert}}_{1}\leq\varepsilon and ∥D−P∥Kol≤α{\lVert D-P{\rVert}_{\rm Kol}}\leq\alpha. Define xi=defln⁡P(i)x_{i}\stackrel{{\scriptstyle\rm def}}{{=}}\ln P(i) for all i∈[n]i\in[n]. Constraints (22) and (23) are immediately satisfied, since PP is log-concave. By the discussion from Section C.3.2 (more specifically, Eq. (20) and (21)), constraint (24) holds as well.

Letting εi=def∣P(i)−D(i)∣\varepsilon_{i}\stackrel{{\scriptstyle\rm def}}{{=}}\left\lvert P(i)-D(i)\right\rvert for i∈Si\in S, we also immediately have (26) and (27) (since ∥P−D∥1≤ε{\lVert P-D{\rVert}}_{1}\leq\varepsilon and ∥D−P∥Kol≤α{\lVert D-P{\rVert}_{\rm Kol}}\leq\alpha by assumption). Finally, to see why (25) is satisfied, we rewrite

and use the fact that ln⁡(1+x)≤x\ln(1+x)\leq x and ln⁡(1−x)≥−2x\ln(1-x)\geq-2x (the latter for x<12x<\frac{1}{2}, along with εiD(i)≤2αβ≪1\frac{\varepsilon_{i}}{D(i)}\leq\frac{2\alpha}{\beta}\ll 1). ∎

C.3.4 Putting it all together: Proof of Section 4.2

The algorithm is as follows (keeping the notations from Section C.3.1 to Section C.3.3):

For each of the O(n){O\left(n\right)} possible modes c∈[a,b]c\in[a,b]:

Run the linear program Algorithm 7, return ACCEPT if a feasible solution is found

None of the linear programs was feasible: return REJECT.

The correctness comes from Section C.3.3 and Section C.3.3 and the discussions in Section C.3.1 to Section C.3.3; as for the claimed running time, it is immediate from the algorithm and the fact that the linear program executed each step has poly⁡(n,1/ε)\operatorname*{poly}(n,1/\varepsilon) constraints and variables.

Appendix D Proof of Theorem 6.3

In this section, we establish our lower bound for tolerant testing of the Binomial distribution, restated below:

See 6.3 The theorem will be a consequence of the (slightly) more general result below:

There exist absolute constants ε0>0\varepsilon_{0}>0 and λ>0\lambda>0 such that the following holds. Any algorithm which, given SAMP{\sf SAMP} access to an unknown distribution DD on Ω\Omega and parameter ε∈(0,ε0)\varepsilon\in(0,\varepsilon_{0}), distinguishes with probability at least 2/32/3 between (i) ∥D−Bin⁡ ⁣(n,12)∥1≤ε{\lVert D-\operatorname{Bin}\!\left(n,\frac{1}{2}\right){\rVert}}_{1}\leq\varepsilon and (ii) ∥D−Bin⁡ ⁣(n,12)∥1≥λε1/3−ε{\lVert D-\operatorname{Bin}\!\left(n,\frac{1}{2}\right){\rVert}}_{1}\geq\lambda\varepsilon^{1/3}-\varepsilon must use Ω(εnlog⁡(ε2/3n)){\Omega\left(\varepsilon\frac{\sqrt{n}}{\log(\varepsilon^{2/3}n)}\right)} samples.

By choosing a suitable ϕ\phi and working out the corresponding parameters, this for instance enables us to derive the following:

There exists an absolute constant ε0∈(0,1/1000)\varepsilon_{0}\in(0,1/1000) such that the following holds. Any algorithm which, given SAMP{\sf SAMP} access to an unknown distribution DD on Ω\Omega, distinguishes with probability at least 2/32/3 between (i) ∥D−Bin⁡ ⁣(n,12)∥1≤ε0{\lVert D-\operatorname{Bin}\!\left(n,\frac{1}{2}\right){\rVert}}_{1}\leq\varepsilon_{0} and (ii) ∥D−Bin⁡ ⁣(n,12)∥1≥100ε0{\lVert D-\operatorname{Bin}\!\left(n,\frac{1}{2}\right){\rVert}}_{1}\geq 100\varepsilon_{0} must use Ω(nlog⁡n){\Omega\left(\frac{\sqrt{n}}{\log n}\right)} samples.

By standard techniques, this will in turn imply Theorem 6.3.

Hereafter, we write for convenience Bn=defBin⁡ ⁣(n,12)B_{n}\stackrel{{\scriptstyle\rm def}}{{=}}\operatorname{Bin}\!\left(n,\frac{1}{2}\right). To prove this lower bound, we will rely on the following:

For any constant ϕ∈(0,1/4)\phi\in(0,1/4), following holds. Any algorithm which, given SAMP{\sf SAMP} access to an unknown distribution DD on Ω\Omega, distinguishes with probability at least 2/32/3 between (i) ∥D−Un∥1≤ϕ{\lVert D-\mathcal{U}_{n}{\rVert}}_{1}\leq\phi and (ii) ∥D−Un∥1≥12−ϕ{\lVert D-\mathcal{U}_{n}{\rVert}}_{1}\geq\frac{1}{2}-\phi, must have sample complexity at least ϕ32nlog⁡n\frac{\phi}{32}\frac{n}{\log n}.

Without loss of generality, assume nn is even (so that BnB_{n} has only one mode located at n2\frac{n}{2}). For c>0c>0, we write In,cI_{n,c} for the interval {n2−cn,…,n2+cn}\{\frac{n}{2}-c\sqrt{n},\dots,\frac{n}{2}+c\sqrt{n}\} and Jn,c=defΩ∖In,cJ_{n,c}\stackrel{{\scriptstyle\rm def}}{{=}}\Omega\setminus I_{n,c}.

The reduction proceeds as follows: given sampling access to DD on [n][n], we can simulate sampling access to a distribution D′D^{\prime} on [N][N] (where N=Θ(n2)N={\Theta\left(n^{2}\right)}) such that

if ∥D−Un∥1≤ϕ{\lVert D-\mathcal{U}_{n}{\rVert}}_{1}\leq\phi, then ∥D′−BN∥1<ε{\lVert D^{\prime}-B_{N}{\rVert}}_{1}<\varepsilon;

if ∥D−Un∥1≥12−ϕ{\lVert D-\mathcal{U}_{n}{\rVert}}_{1}\geq\frac{1}{2}-\phi, then ∥D′−BN∥1>ε′−ε{\lVert D^{\prime}-B_{N}{\rVert}}_{1}>\varepsilon^{\prime}-\varepsilon

for ε=defΘ(ϕ3/2)\varepsilon\stackrel{{\scriptstyle\rm def}}{{=}}\Theta(\phi^{3/2}) and ε′=defΘ(ϕ12)\varepsilon^{\prime}\stackrel{{\scriptstyle\rm def}}{{=}}\Theta(\phi^{\frac{1}{2}}); in a way that preserves the sample complexity.

More precisely, define c=def2ln⁡11−ϕ=Θ(ϕ)c\stackrel{{\scriptstyle\rm def}}{{=}}\sqrt{2\ln\frac{1}{1-\phi}}={\Theta\left(\sqrt{\phi}\right)} (so that ϕ=1−e−2c2\phi=1-e^{-2c^{2}}) and NN such that ∣IN,c∣=n\left\lvert I_{N,c}\right\rvert=n (that is, N=(n/(2c))2=Θ(n2/ϕ)N=(n/(2c))^{2}={\Theta\left(n^{2}/\phi\right)}). From now on, we can therefore identify [n][n] to IN,cI_{N,c} in the obvious way, and see a draw from DD as an element in IN,cI_{N,c}.

Let p=defBN(IN,c)=Θ(ϕ)p\stackrel{{\scriptstyle\rm def}}{{=}}B_{N}(I_{N,c})={\Theta\left(\sqrt{\phi}\right)}, and BN,cB_{N,c}, BˉN,c\bar{B}_{N,c} respectively denote the conditional distributions induced by BNB_{N} on IN,cI_{N,c} and JN,cJ_{N,c}. Intuitively, we want DD to be mapped to the conditional distribution of D′D^{\prime} on IN,cI_{N,c}, and the conditional distribution of D′D^{\prime} on JN,cJ_{N,c} to be exactly BˉN,c\bar{B}_{N,c}. This is done as by defining D′D^{\prime} by the process below:

with probability pp, we draw a sample from DD (seen as an element of IN,cI_{N,c};

with probability 1−p1-p, we draw a sample from BˉN,c\bar{B}_{N,c}.

If ∥D−Un∥1≤ϕ{\lVert D-\mathcal{U}_{n}{\rVert}}_{1}\leq\phi, then by the triangle inequality ∥D′−BN∥1≤p(ϕ+ϕ)=2pϕ{\lVert D^{\prime}-B_{N}{\rVert}}_{1}\leq p(\phi+\phi)=2p\phi;

If ∥D−Un∥1≥12−ϕ{\lVert D-\mathcal{U}_{n}{\rVert}}_{1}\geq\frac{1}{2}-\phi, then similarly ∥D′−BN∥1≥p(12−ϕ−ϕ)=p4−2pϕ{\lVert D^{\prime}-B_{N}{\rVert}}_{1}\geq p(\frac{1}{2}-\phi-\phi)=\frac{p}{4}-2p\phi.

Recalling that p=Θ(ϕ)p={\Theta\left(\sqrt{\phi}\right)} and setting ε=def2pϕ\varepsilon\stackrel{{\scriptstyle\rm def}}{{=}}2p\phi concludes the reduction. From Theorem D.2, we conclude that

The corollary follows from the proof of Appendix D, by taking ϕ=1/1000\phi=1/1000 and computing the corresponding ε\varepsilon and ε′−ε\varepsilon^{\prime}-\varepsilon to check that indeed lim⁡n→∞ε′−εε>100\lim_{n\to\infty}\frac{\varepsilon^{\prime}-\varepsilon}{\varepsilon}>100. ∎