Abstract
We study the question of testing structured properties (classes) of discrete distributions. Specifically, given sample access to an arbitrary distribution D over [n] and a property \(\mathcal {P}\), the goal is to distinguish between D ∈ \(\mathcal {P}\) and ℓ1(D, \(\mathcal {P}\)) > ε. We develop a general algorithm for this question, which applies to a large range of “shape-constrained” properties, including monotone, log-concave, t-modal, piecewise-polynomial, and Poisson Binomial distributions. Moreover, for all cases considered, our algorithm has near-optimal sample complexity with regard to the domain size and is computationally efficient. For most of these classes, we provide the first non-trivial tester in the literature. In addition, we also describe a generic method to prove lower bounds for this problem, and use it to show our upper bounds are nearly tight. Finally, we extend some of our techniques to tolerant testing, deriving nearly–tight upper and lower bounds for the corresponding questions.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 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., [36, 39, 48]).
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 [8, 47] and model selection [41]. 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 [7, 25, 46, 54]. From a different perspective, a recent line of work in Theoretical Computer Science, originating from the papers of Batu et al. [10, 11, 35] has also been tackling similar questions in the setting of property testing (see [13, 43,44,45] 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 [1, 2, 9, 18, 24, 28, 34]. 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 [26, 50, 51, 53].
In this paper, we focus on the following general property testing problem: given a class (property) of distributions \(\mathcal {P}\) and sample access to an arbitrary distribution D, one must distinguish between the case that (a) \(D\in \mathcal {P}\), versus (b) \(\|{D}-{D}^{\prime }\|_{1} >\varepsilon \) for all \(D^{\prime }\in \mathcal {P}\) (i.e., D 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 [27, 28, 49, 51]. This direction, the testing analog of a similar movement in distribution learning [4, 15,16,17], 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.
Related Work
Batu et al. [12] initiated the study of efficient property testers for monotonicity and obtained (nearly) matching upper and lower bounds for this problem; while [2] later considered testing the class of Poisson Binomial Distributions, and settled the sample complexity of this problem (up to the precise dependence on ε). Indyk, Levi, and Rubinfeld [37], focusing on distributions that are piecewise constant on t intervals (“t-histograms”) described a \(\tilde {O}(\sqrt {tn}/\varepsilon ^{5})\)-sample algorithm for testing membership to this class. Another body of work by [9, 12], and [24] shows how assumptions on the shape of the distributions can lead to significantly more efficient algorithms. They describe such improvements in the case of identity and closeness testing as well as for entropy estimation, under monotonicity or k-modality constraints. Specifically, Batu et al. show in [12] how to obtain a \(O\left ({\log ^{3} n/\varepsilon ^{3}}\right )\)-sample tester for closeness in this setting, in stark contrast to the \({\Omega }\left ({{n}^{2/3}}\right )\) general lower bound. Daskalakis et al. [24] later gave \({O}(\sqrt {\log n})\) and \({O}({\log ^{2/3} n})\)-sample testing algorithms for testing respectively identity and closeness of monotone distributions, and obtained similar results for k-modal distributions. Finally, we briefly mention two related results, due respectively to [9] and [22]. The first one states that for the task of getting a multiplicative estimate of the entropy of a distribution, assuming monotonicity enables exponential savings in sample complexity—\(O\left ({\log ^{6} n}\right )\), instead of Ω(n c) for the general case. The second describes how to test if an unknown k-modal distribution is in fact monotone, using only O(k/ε 2) samples. Note that the latter line of work differs from ours in that it presupposes the distributions satisfy some structural property, and uses this knowledge to test something else about the distribution; while we are given a priori arbitrary distributions, and must check whether the structural property holds. Except for the properties of monotonicity and being a PBD, nothing was previously known on testing the shape restricted properties that we study.
Moreover, for the specific problems of identity and closeness testing,Footnote 1 recent results of [27, 28] 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.
Concurrent and Followup Work
Independently and concurrently to this work, Acharya, Daskalakis, and Kamath [3] obtained a sample near-optimal efficient algorithm for testing log-concavity, as well as sample-optimal algorithms for testing the classes of monotone, unimodal, and monotone hazard rate distributions (along with matching lower bounds on the sample complexity of these tasks). Their work builds on ideas from [2] and their techniques are orthogonal to ours: namely, while at some level both works follow a “testing-by-learning” paradigm, theirs rely on first learning in the (more stringent) χ 2 distance, then applying a testing algorithm which is robust to some amount of noise (i.e., tolerant testing) in this χ 2 sense (as opposed to noise in an ℓ 1 sense, which is known to be impossible without a near-linear number of samples [50]).
Subsequent to the publication of the conference version of this work, [14] improved on both [37] and our results for the specific class of t-histograms, providing nearly tight upper and lower bounds on testing membership to this class. Specifically, it obtains an upper bound of \(\tilde {O}(\sqrt {n}/\varepsilon ^{2} + t/\varepsilon ^{3})\), complemented with an \({\Omega }(\sqrt {n}/\varepsilon ^{2}+t/(\varepsilon \log t))\) lower bound on the sample complexity.
Building on our work, Fischer, Lachish, and Vasudev recently generalized in [33] our approach and algorithm to the conditional sampling model of [19, 20], obtaining analogues of our testing results in this different setting of distribution testing where the algorithm is allowed to condition the samples it receives on subsets of the domain of its choosing. In the “standard” sampling setting, [33] additionally provides an alternative to the first subroutine of our testing algorithm: this yields a simpler and non-recursive algorithm, with a factor \(\log n\) shaved off at the price of a worse dependency on the distance parameter ε. (Namely, their sample complexity is dominated by \(O(\sqrt {nL}\log ^{2}(1/\varepsilon )/{\varepsilon ^{5}})\), to be compared to the \(O(\sqrt {nL}\log n/{\varepsilon ^{3}})\) term of Theorem 3.3.)
1.1 Results and Techniques
Upper Bounds A natural way to tackle our membership testing problem would be to first learn the unknown distribution D as if it satisfied the property, before checking if the hypothesis obtained is indeed both close to the original distribution and to the property. Taking advantage of the purported structure, the first step could presumably be conducted with a small number of samples; things break down, however, in the second step. Indeed, most approximation results leading to the improved learning algorithms one would apply in the first stage only provide very weak guarantees, that is in the ℓ 1 sense only. For this reason, they lack the robustness that would be required for the second part, where it becomes necessary to perform tolerant testing between the hypothesis and D—a task that would then entail a number of samples almost linear in the domain size. To overcome this difficulty, we need to move away from these global ℓ 1 closeness results and instead work with stronger requirements, this time in ℓ 2 norm.
At the core of our approach is an idea of Batu et al. [12], which show that monotone distributions can be well-approximated (in a certain technical sense) by piecewise constant densities on a suitable interval partition of the domain; and leverage this fact to reduce monotonicity testing to uniformity testing on each interval of this partition. While the argument of [12] is tailored specifically for the setting of monotonicity testing, we are able to abstract the key ingredients, and obtain a generic membership tester that applies to a wide range of distribution families. In more detail, we provide a testing algorithm which applies to any class of distributions which admit succinct approximate decompositions—that is, each distribution in the class can be well-approximated (in a strong ℓ 2 sense) by piecewise constant densities on a small number of intervals (we hereafter refer to this approximation property, formally defined in Definition 3.1, as (Succinctness); and extend the notation to apply to any class \(\mathcal {C}\) of distributions for which all \(D\in \mathcal {C}\) satisfy (Succinctness)). Crucially, the algorithm does not care about how these decompositions can be obtained: for the purpose of testing these structural properties we only need to establish their existence. Specific examples are given in the corollaries below. Informally, our main algorithmic result, informally stated (see Theorem 3.3 for a detailed formal statement), is as follows:
Theorem 1.1 (Main Theorem)
There exists an algorithm TestSplittable which, given sampling access to an unknown distribution D over [n]and parameter ε ∈ (0,1], can distinguish with probability 2/3between (a) \(D\in \mathcal {P}\) versus (b) \(\ell _{1}({D}, \mathcal {P}) > \varepsilon \), for any property \(\mathcal {P}\) that satisfies the above natural structural criterion(Succinctness). Moreover, for many such properties this algorithm is computationally efficient, and its sample complexity is optimal (up to logarithmic factors and the exact dependence on ε ).
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):
Corollary 1.2
The algorithm TestSplittable can test the classes of monotone, unimodal, log-concave, concave, convex, and monotone hazard rate (MHR) distributions, with \(\tilde {O}({\sqrt {n}/\varepsilon ^{7/2}})\) samples.
Corollary 1.3
The algorithm TestSplittable can test the class of t-modal distributions, with \(\tilde {O}({\sqrt {tn}/\varepsilon ^{7/2}})\) samples.
Corollary 1.4
The algorithm TestSplittable can test the classes of t-histograms and t-piecewise degree- D distributions, with \(\tilde {O}({\sqrt {tn}/\varepsilon ^{3}})\) and \(\tilde {O}({\sqrt {t(d+1)n}/\varepsilon ^{7/2} + t(d+1)/\varepsilon ^{3}})\) samples respectively.
Corollary 1.5
The algorithm TestSplittable can test the classes of Binomial and Poisson Binomial Distributions, with \(\tilde {O}({{n}^{1/4}/\varepsilon ^{7/2}})\) samples.
We remark that the aforementioned sample upper bounds are information-theoretically near-optimal in the domain size n (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 ε, though a more careful analysis might lead to such improvements.
We stress that prior to our work, no non-trivial testing bound was known for most of these classes – specifically, our nearly-tight bounds for t-modal with t > 1, log-concave, concave, convex, MHR, and piecewise polynomial distributions are new. Moreover, although a few of our applications were known in the literature (the \(\tilde {O}\left (\sqrt {n}/{\varepsilon }^{6} \right )\) upper and \({\Omega \left (\sqrt {n}/{\varepsilon }^{2} \right )}\) lower bounds on testing monotonicity can be found in [12], while the \({\Theta }\left ({n^{1/4}}\right )\) sample complexity of testing PBDs was recently givenFootnote 2 in [2], and the task of testing t-histograms is considered in [37]), the crux here is that we are able to derive them in a unified way, by applying the same generic algorithm to all these different distribution families. We note that our upper bound for t-histograms (Corollary 1.4) also significantly improves on the previous \(\tilde {O}\left (\sqrt {tn}/{\varepsilon }^{5} \right )\)-sample tester with regard to the dependence on the proximity parameter ε. In addition to its generality, our framework yields much cleaner and conceptually simpler proofs of the upper and lower bounds from [2].
Lower Bounds
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 \(\mathcal {C}\)—the problem of testing membership to \(\mathcal {C}\) (“does \(D\in \mathcal {C}\)?”) to testing identity to D ∗ (“does D = D ∗?”), for any explicit distribution D ∗ in \(\mathcal {C}\). While these two problems need not in general be related,Footnote 3 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 [2] 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:
Corollary 1.6
Testing log-concavity, convexity, concavity, MHR, unimodality, t-modality, t-histograms, and t-piecewise degree- D distributions each require \({\Omega \left ({\sqrt {n}}/{{\varepsilon }^{2}} \right )}\) samples (the last three for \(t = o(\sqrt {n})\) and \(t(d+1) = o(\sqrt {n})\), respectively), for any ε ≥ 1/n O(1) .
Corollary 1.7
Testing the classes of Binomial and Poisson Binomial Distributions each require \({\Omega \left ({n^{1/4}}/{{\varepsilon }^{2}} \right )}\) samples, for any ε ≥ 1/n O(1) .
Corollary 1.8
There exist absolute constants c > 0and ε 0 > 0such that testing the class of k-SIIRV distributions requires \({\Omega }\left (k^{1/2}n^{1/4}/{\varepsilon }^{2} \right )\) samples, for any \(k={o\left (n^{c} \right )}\) and \({1}/{n^{O(1)}} \leq {\varepsilon } \leq {\varepsilon }_{0}\) .
Tolerant Testing
Using our techniques, we also establish nearly–tight upper and lower bounds on tolerant testingFootnote 4 for shape restrictions. Similarly, our upper and lower bounds are matching as a function of the domain size. More specifically, we give a simple generic upper bound approach (namely, a learning followed by tolerant testing algorithm). Our tolerant testing lower bounds follow the same reduction-based approach as in the non-tolerant case. In more detail, our results are as follows (see Sections 6 and 7):
Corollary 1.9
Tolerant testing of log-concavity, convexity, concavity, MHR, unimodality, and t-modality can be performed with \(O\left (\frac {1}{(\varepsilon _{2}-\varepsilon _{1})^{2}}\frac {n}{\log n} \right )\) samples, for ε 2 ≥ C ε 1 (where C > 2is an absolute constant).
Corollary 1.10
Tolerant testing of the classes of Binomial and Poisson Binomial Distributions can be performed with \(O\left (\frac {1}{(\varepsilon _{2}-\varepsilon _{1})^{2}}\frac {\sqrt {n\log ({1}/{\varepsilon _{1}})}}{\log n} \right )\) samples, for ε 2 ≥ C ε 1 (where C > 2is an absolute constant).
Corollary 1.11
Tolerant testing of log-concavity, convexity, concavity, MHR, unimodality, and t-modality each require \({\Omega \left (\frac {1}{({\varepsilon }_{2}-{\varepsilon }_{1})}\frac {n}{\log n} \right )}\) samples (the latter for t = o(n)).
Corollary 1.12
Tolerant testing of the classes of Binomial and Poisson Binomial Distributions each require \({\Omega \left (\frac {1}{({\varepsilon }_{2}-{\varepsilon }_{1})}\frac {\sqrt {n}}{\log n} \right )}\) samples.
On the Scope of our Results
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.
1.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 class 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 Corollary 1.5, 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.
2 Notation and Preliminaries
2.1 Definitions
We give here the formal descriptions of the classes of distributions involved in this work, starting with that of monotone distributions.
Definition 2.1 (monotone)
A distribution D over [n] is monotone (non-increasing) if its probability mass function (pmf) satisfies \(D(1) \geq {D}(2) \geq {\dots } {D}(n)\).
A natural generalization of the class \({\mathcal {M}}\) of monotone distributions is the set of t-modal distributions, i.e. distributions whose pmf can go “up and down” or “down and up” up to t times:Footnote 5
Definition 2.2 (t-modal)
Fix any distribution D over [n], and integer t. D is said to have t modes if there exists a sequence \(i_{0} < {\dots } < i_{t+1}\) such that either (−1)j D(i j ) < (−1)j D(i j+1) for all 0 ≤ j ≤ t, or (−1)j D(i j ) > (−1)j D(i j+1) for all 0 ≤ j ≤ t. We call D t-modal if it has at most t modes, and write \({\mathcal {M}_{t}}\) for the class of all t-modal distributions (omitting the dependence on n). The particular case of t = 1 corresponds to the set \(\mathcal {M}_{1}\) of unimodal distributions.
Definition 2.3 (Log-concave)
A distribution D over [n] is said to be log-concave if it satisfies the following conditions: (i) for any 1 ≤ i < j < k ≤ n such that D(i)D(k) > 0, D(j) > 0; and (ii) for all 1 < k < n, D(k)2 ≥ D(k − 1)D(k + 1). We write \({\mathcal {L}}\) for the class of all log-concave distributions (omitting the dependence on n).
Definition 2.4 (Concave and Convex)
A distribution D over [n] is said to be concave if it satisfies the following conditions: (i) for any 1 ≤ i < j < k ≤ n such that D(i)D(k) > 0, D(j) > 0; and (ii) for all 1 < k < n such that D(k − 1)D(k + 1) > 0, 2D(k) ≥ D(k − 1) + D(k + 1); it is convex if the reverse inequality holds in (ii). We write \({\mathcal {K}^-}\) (resp. \({\mathcal {K}^+}\)) for the class of all concave (resp. convex) distributions (omitting the dependence on n).
It is not hard to see that convex and concave distributions are unimodal; moreover, every concave distribution is also log-concave, i.e. \(\mathcal {K}^{-}\subseteq \mathcal {L}\). Note that in both Definition 2.3 and Definition 2.4, condition (i) is equivalent to enforcing that the distribution be supported on an interval.
Definition 2.5 (Monotone Hazard Rate)
A distribution D over [n] is said to have monotone hazard rate (MHR) if its hazard rate \(H(i)\overset {\text {def}}{=} \frac {{D}(i)}{{\sum }_{j=i}^{n} {D}(j)}\) is a non-decreasing function. We write \({\mathcal {MHR}}\) for the class of all MHR distributions (omitting the dependence on n).
It is known that every log-concave distribution is both unimodal and MHR (see e.g. [6, Proposition 10]), and that monotone distributions are MHR. Two other classes of distributions have elicited significant interest in the context of density estimation, those of histograms (piecewise constant) and piecewise polynomial densities:
Definition 2.6 (Piecewise Polynomials [16])
A distribution D over [n] is said to be a t-piecewise degree-d distribution if there is a partition of [n] into t disjoint intervals \(I_{1},\dots ,I_{t}\) such that D(i) = p j (i) for all i ∈ I j , where each \(p_{1},{\dots } p_{t}\) is a univariate polynomial of degree at most d. We write \({\mathcal {P}_{t,d}}\) for the class of all t-piecewise degree-d distributions (omitting the dependence on n). (We note that t-piecewise degree-0 distributions are also commonly referred to as t-histograms, and write \({\mathcal {H}_{t}}\) for \(\mathcal {P}_{t,0}\).)
Finally, we recall the definition of the two following classes, which both extend the family of Binomial distributions \(\mathcal {BIN}_{n}\): the first, by removing the need for each of the independent Bernoulli summands to share the same bias parameter.
Definition 2.7
A random variable X is said to follow a Poisson Binomial Distribution (with parameter \(n\in {\mathbb {N}}\)) if it can be written as \(X={\sum }_{k=1}^{n} X_{k}\), where \(X_{1}\dots ,X_{n}\) are independent, non-necessarily identically distributed Bernoulli random variables. We denote by \(\mathcal {PBD}_{n}\) the class of all such Poisson Binomial Distributions.
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:
Definition 2.8
Fix any k ≥ 0. We say a random variable X is a k-Sum of Independent Integer Random Variables (k-SIIRV) with parameter \(n\in {\mathbb {N}}\) if it can be written as \(X={\sum }_{j=1}^{n} X_{j}\), where \(X_{1}\dots ,X_{n}\) are independent, non-necessarily identically distributed random variables taking value in \(\{0,1,\dots ,k-1\}\). We denote by \({k}\text {-}{\mathcal {SIIRV}}_{n}\) the class of all such k-SIIRVs.
2.2 Tools from Previous Work
We first restate a result of Batu et al. relating closeness to uniformity in ℓ 2 and ℓ 1 norms to “overall flatness” of the probability mass function, and which will be one of the ingredients of the proof of Theorem 1.1:
Lemma 2.9 ([10, 11])
Let D be a distribution on a domain S. (a) If \(\max _{i\in S} {D}(i) \leq (1+{\varepsilon })\min _{i\in S} {D}(i)\), then \(\|{D}\|^{2} \leq (1+\varepsilon ^{2})/\left \lvert {S} \right \rvert \) . (b) If \(\|{D}\|^{2} \leq (1+\varepsilon ^{2})/\left \lvert {S} \right \rvert \), then \(\|{D}-{\mathcal {U}}_{S}\| \leq \varepsilon \) .
To check condition (b) above we shall rely on the following, which one can derive from the techniques in [28] and whose proof we defer to Appendix A:
Theorem 2.10 (Adapted from [28, Theorem 11])
There exists an algorithm Check-Small-ℓ 2 which, given parameters ε, δ ∈ (0, 1) and \(c\cdot {\sqrt {\left \lvert {I} \right \rvert }}/{\varepsilon ^{2}} \log (1/\delta )\) independent samples from a distribution D over I (for some absolute constant c > 0), outputs either yes or no, and satisfies the following.
-
If \({\lVert {{D}-{\mathcal {U}}_{I}}}{\rVert }_2 > {{\varepsilon }}/{\sqrt {\left \lvert I \right \rvert }}\), then the algorithm outputs no with probability at least 1 − δ;
-
If \({\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 − δ.
Finally, we will also rely on a classical result from probability, the Dvoretzky–Kiefer–Wolfowitz (DKW) inequality, restated below:
Theorem 2.11 ([32, 40])
Let D be a distribution over [n].Given m independent samples \(x_{1},{\dots } ,x_{m}\) from D, define the empirical distribution \(\hat {{D}}\) as follows:
Then,for all ε > 0,\(\Pr \!\left [\, {\lVert {D} - \hat {{D}}{\rVert }_{\text {Kol}}} > {\varepsilon } \, \right ] \leq 2e^{-2m{\varepsilon }^{2}}\), where\({\lVert {{\cdot } - {\cdot }}{\rVert }_{\text {Kol}}}\)denotes the Kolmogorovdistance (i.e., the \(\ell _{\infty }\)distance between cumulative distribution functions).
In particular, this implies that \({O\left (1/{\varepsilon }^{2} \right )}\) samples suffice to learn a distribution up to ε in Kolmogorov distance.
3 The General Algorithm
In this section, we obtain our main result, restated below:
Theorem 1.1 (Main Theorem)
There exists an algorithm TestSplittable which, given sampling access to an unknown distribution D over [n]and parameter ε ∈ (0, 1], can distinguish with probability 2/3between (a) \(D\in \mathcal {P}\) versus (b) \(\ell _{1}({D}, \mathcal {P}) > \varepsilon \), for any property \(\mathcal {P}\) that satisfies the above natural structural criterion(Succinctness).Moreover, for many such properties this algorithm is computationally efficient, and its sample complexity is optimal (up to logarithmic factors and the exact dependence on ε ).
Intuition
Before diving into the proof of this theorem, we first provide a high-level description of the argument. The algorithm proceeds in 3 stages: the first, the decomposition step, attempts to recursively construct a partition of the domain in a small number of intervals, with a very strong guarantee. If the decomposition succeeds, then the unknown distribution D will be close (in ℓ 1 distance) to its “flattening” on the partition; while if it fails (too many intervals have to be created), this serves as evidence that D does not belong to the class and we can reject. The second stage, the approximation step, then learns this flattening of the distribution—which can be done with few samples since by construction we do not have many intervals. The last stage is purely computational, the projection step: where we verify that the flattening we have learned is indeed close to the class \(\mathcal {C}\). If all three stages succeed, then by the triangle inequality it must be the case that D is close to \(\mathcal {C}\); and by the structural assumption on the class, if \(D\in \mathcal {C}\) then it will admit succinct enough partitions, and all three stages will go through.
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 Corollary 1.5.)
Definition 3.1 (Decompositions)
Let γ, ζ > 0 and L = L(γ, ζ, n) ≥ 1. A class of distributions \({\mathcal {C}}\) on [n] is said to be (γ, ζ, L)-decomposable if for every \(D\in {\mathcal {C}}\) there exists ℓ ≤ L and a partition \(\mathcal {I}(\gamma ,\zeta ,{D})=(I_{1},\dots ,I_{\ell })\) of the interval [1,n] such that, for all j ∈ [ℓ], one of the following holds:
-
(i)
\(D(I_{j}) \leq \frac {\zeta }{L}\); or
-
(ii)
\(\displaystyle \max _{i \in I_{j}} {D}(i)\leq (1+\gamma )\cdot \min _{i \in I_{j}} {D}(i)\).
Further, if \(\mathcal {I}(\gamma ,\zeta ,{D})\) is dyadic (i.e., each I k is of the form [j ⋅ 2i + 1,(j + 1) ⋅ 2i] for some integers i, j, corresponding to the leaves of a recursive bisection of [n]), then \(\mathcal {C}\) is said to be (γ, ζ, L)-splittable.
Lemma 3.2
If \({\mathcal {C}}\) is (γ, ζ, L)-decomposable, then it is \((\gamma , \zeta , L^{\prime })\) -splittable for \(L^{\prime }(\gamma ,\zeta ,n) = O(\log n)\cdot L(\gamma ,\frac {\zeta }{2(\log n+1)},n)\) .
Proof
We will begin by proving a claim that for every partition \(\mathcal {I}=\{I_{1},I_{2},...,I_{L}\}\) of the interval [1,n] into L intervals, there exists a refinement of that partition which consists of at most \(L\cdot O(\log n)\) dyadic intervals. So, it suffices to prove that every interval \([a,b]\subseteq [1,n]\) can be partitioned in at most \({O\left ({\log n} \right )}\) dyadic intervals. Indeed, let ℓ be the largest integer such that \(2^{\ell }\leq \frac {b-a}{2}\) and let m be the smallest integer such that m ⋅ 2ℓ ≥ a. If follows that \(m\cdot 2^{\ell }\leq a+\frac {b-a}{2}=\frac {a+b}{2}\) and (m + 1) ⋅ 2ℓ ≤ b. So, the interval I = [m ⋅ 2ℓ + 1,(m + 1) ⋅ 2ℓ] is fully contained in [a, b] and has size at least \(\frac {b-a}{4}\).
We will also use the fact that, for every \(\ell ^{\prime }\leq \ell \),
Now consider the following procedure: Starting from right (resp. left) side of the interval I, we add the largest interval which is adjacent to it and fully contained in [a, b] and recurse until we cover the whole interval [(m + 1) ⋅ 2ℓ + 1,b] (resp. [a, m ⋅ 2ℓ]). Clearly, at the end of this procedure, the whole interval [a, b] is covered by dyadic intervals. It remains to show that the procedure takes \({O\left ({\log n} \right )}\) steps. Indeed, using (1), we can see that at least half of the remaining left or right interval is covered in each step (except maybe for the first 2 steps where it is at least a quarter). Thus, the procedure will take at most \(2\log n +2={O\left ({\log n} \right )}\) steps in total. From the above, we can see that each of the L intervals of the partition \(\mathcal {I}\) can be covered with \({O\left ({\log n} \right )}\) dyadic intervals, which completes the proof of the claim.
In order to complete the proof of the lemma, notice that the two conditions in Definition 3.1 are closed under taking subsets: so that the second is immediately verified, while for the first we have that for any of the “new” intervals I that \(D(I) \leq \frac {\zeta }{L} \leq \frac {\zeta \cdot (2\log n+2)}{L^{\prime }}\). □
3.1 The Algorithm
Theorem 1.1, and with it Corollary 1.2, Corollary 1.3, and Corollary 1.4 will follow from the theorem below, combined with the structural theorems from Section 4:
Theorem 3.3
Let \({\mathcal {C}}\) be a class of distributions over [n]for which the following holds.
-
1.
\({\mathcal {C}}\) is (γ, ζ, L(γ, ζ, n))-splittable;
-
2.
there exists a procedure \(\textsc {ProjectionDist}_{\mathcal {C}}\) which, given as input a parameter α ∈ (0, 1)and the explicit description of a distribution D over [n], returns yes if the distance \(\ell _{1}({D},\mathcal {C})\) to \(\mathcal {C}\) is at most α/10, and no if \(\ell _{1}({D},\mathcal {C}) \geq 9\alpha /10\) (and either yes or no otherwise).
Then the algorithm TestSplittable (Algorithm 1) is a \({O\left (\max \left ({\sqrt {nL}}\log n/{{\varepsilon }^{3}}, L/{{\varepsilon }^{2}}\right ) \right )}\) -sample tester for \({\mathcal {C}}\), for L = L(O(ε),O(ε),n).(Moreover, if \(\textsc {ProjectionDist}_{\mathcal {C}}\) is computationally efficient, then so is TestSplittable .)
3.2 Proof of Theorem 3.3
We now give the proof of our main result (Theorem 3.3), first analyzing the sample complexity of Algorithm 1 before arguing its correctness. For the latter, we will need the following simple fact from [37], restated below:
Fact 3.4 ([37, Fact 1])
Let D be a distribution over [n], and δ ∈ (0, 1].Given \(m\geq C\cdot \frac {\log \frac {n}{\delta }}{\eta }\) independent samples from D (for some absolute constant C > 0), with probability at least 1 − δ we have that, for every interval \(I\subseteq [n]\) :
-
(i)
if \(D(I) \geq \frac {\eta }{4}\), then \(\frac {{D}(I)}{2} \leq \frac {m_{I}}{m} \leq \frac {3{D}(I)}{2}\) ;
-
(ii)
if \(\frac {m_{I}}{m} \geq \frac {\eta }{2}\), then \(D(I) > \frac {\eta }{4}\) ;
-
(iii)
if \(\frac {m_{I}}{m} < \frac {\eta }{2}\), then D(I) < η;
where \(m_{I} \overset {\text {def}}{=} \left \lvert \left \{\; j\in [m] \;\colon \; x_{j} \in I \; \right \} \right \rvert \) is the number of the samples falling into I.
3.3 Sample Complexity
The sample complexity is immediate, and comes from Steps 4 and 20. The total number of samples is
3.4 Correctness
Say an interval I considered during the execution of the “Decomposition” step is heavy if m I is big enough on Step 7, and light otherwise; and let \(\mathcal {H}\) and \(\mathcal {L}\) denote the sets of heavy and light intervals respectively. By choice of m, we can assume that with probability at least 9/10 the guarantees of Fact 3.4 hold simultaneously for all intervals considered. We hereafter condition on this event.
We first argue that if the algorithm does not reject in Step 13, then with probability at least 9/10 we have \(\|{D}-{\Phi }({D},\mathcal {I})\|_{1} \leq \varepsilon /20\) (where \({\Phi }({D},\mathcal {I})\) denotes the flattening of D over the partition \(\mathcal {I}\)). Indeed, we can write
Let us bound the two terms separately.
-
If \(I^{\prime } \in \mathcal {H}\), then by our choice of threshold we can apply Lemma 2.10 with \(\delta =\frac {1}{10L}\); conditioning on all of the (at most L) events happening, which overall fails with probability at most 1/10 by a union bound, we get
$${\lVert{{D}_{I^{\prime}}}{\rVert}}_2^{2} = {\lVert{{D}_{I^{\prime}}-{\mathcal{U}}_{I^{\prime}}}{\rVert}}_2^{2} + \frac{1}{\left\lvert I^{\prime} \right\rvert} \leq \left( 1+\frac{{\varepsilon}^{2}}{1600} \right) \frac{1}{\left\lvert I^{\prime} \right\rvert} $$as Check-Small-ℓ 2 returned yes; and by Lemma 2.9 this implies \({\lVert {{D}_{I^{\prime }} - {\mathcal {U}}_{I^{\prime }}}{\rVert }}_1\leq {\varepsilon }/40\).
-
If \(I^{\prime } \in \mathcal {L}\), then we claim that \(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^{\prime }) \leq \kappa \), so it only remains to show that \(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 Fact 3.4 (i), as if we had \(D(I^{\prime }) > 2c\cdot \frac {\sqrt {\left \lvert I^{\prime } \right \rvert }}{m{\varepsilon }^{2}}\log \frac {1}{\delta }\) then \(m_{I^{\prime }}\) would have been big enough, and \(I^{\prime }\notin \mathcal {L}\). Overall,
$$\sum\limits_{I^{\prime} \in \mathcal{L} } {D}(I^{\prime}) \leq \sum\limits_{I^{\prime} \in \mathcal{L} } \left( \kappa + 2c\cdot\frac{\sqrt{\left\lvert {I^{\prime}} \right\rvert}}{m\varepsilon^{2}}\log\frac{1}{\delta} \right) \leq L\kappa + 2\sum\limits_{I^{\prime} \in \mathcal{L} } c\cdot\frac{\sqrt{\left\lvert I^{\prime} \right\rvert}}{m{\varepsilon}^{2}}\log\frac{1}{\delta} \leq \frac{{\varepsilon}}{160}\left( 1+ \sum\limits_{I^{\prime} \in \mathcal{L} } \sqrt{\frac{\left\lvert I^{\prime} \right\rvert}{\left\lvert I \right\rvert L}}\right) \leq \frac{{\varepsilon}}{80} $$for a sufficiently big choice of constant C > 0 in the definition of m; where we first used that \(\left \lvert {\mathcal {L}} \right \rvert \leq L\), and then that \({\sum }_{I^{\prime } \in \mathcal {L} } \sqrt {\frac {\left \lvert {I^{\prime }} \right \rvert }{\left \lvert {I} \right \rvert }}\leq \sqrt {L}\) by Jensen’s inequality.
Putting it together, this yields
- Soundness. :
-
By contrapositive, we argue that if the test returns accept, then (with probability at least 2/3) D is ε-close to \(\mathcal {C}\). Indeed, conditioning on \(\tilde {{D}}\) being ε/20-close to \({\Phi }({D},\mathcal {I})\), we get by the triangle inequality that
$$\begin{array}{@{}rcl@{}} {\lVert{{D}-{\mathcal{C}}}{\rVert}}_1 &\leq& {\lVert{{D}-{\Phi}({D},\mathcal{I})}{\rVert}}_1 + {\lVert{\Phi({D},\mathcal{I}) - \tilde{{D}}}{\rVert}}_1 + {\operatorname{dist}\!\left( {\tilde{{D}}, \mathcal{C}}\right)} \\ &\leq& \frac{{\varepsilon}}{20} + \frac{{\varepsilon}}{20}+\frac{9{\varepsilon}}{10} = {\varepsilon}. \end{array} $$Overall, this happens except with probability at most 1/10 + 1/10 + 1/10 < 1/3.
- Completeness.:
-
Assume \(D\in {\mathcal {C}}\). Then the choice of of γ and L ensures the existence of a good dyadic partition \(\mathcal {I}(\gamma ,\gamma ,{D})\) in the sense of Definition 3.1. For any I in this partition for which (i) holds (\(D(I) \leq \frac {\gamma }{L} < \frac {\kappa }{2}\)), I will have \(\frac {m_{I}}{m} < \kappa \) and be kept as a “light leaf” (this by contrapositive of Fact 3.4 (ii)). For the other ones, (ii) holds: let I be one of these (at most L) intervals.
-
If m I is too small on Step 7, then I is kept as “light leaf.”
-
Otherwise, then by our choice of constants we can use Lemma 2.9 and apply Lemma 2.10 with \(\delta =\frac {1}{10L}\); conditioning on all of the (at most L) events happening, which overall fails with probability at most 1/10 by a union bound, Check-Small-ℓ 2 will output yes, as
$${\lVert{{D}_{I}-{\mathcal{U}}_{I}}{\rVert}}_2^{2} = {\lVert{{D}_{I}}{\rVert}}_2^{2} - \frac{1}{\left\lvert I \right\rvert} \leq \left( 1+\frac{{\varepsilon}^{2}}{6400} \right) \frac{1}{\left\lvert I \right\rvert} - \frac{1}{\left\lvert I \right\rvert} = \frac{{\varepsilon}^{2}}{6400\left\lvert I \right\rvert} $$and I is kept as “flat leaf.”
Therefore, as \(\mathcal {I}(\gamma ,\gamma ,{D})\) is dyadic the Decomposition stage is guaranteed to stop within at most L splits (in the worst case, it goes on until \(\mathcal {I}(\gamma ,\gamma ,{D})\) is considered, at which point it succeeds).Footnote 6 Thus Step 13 passes, and the algorithm reaches the Approximation stage. By the foregoing discussion, this implies \({\Phi }({D},\mathcal {I})\) is ε/20-close to D (and hence to \({\mathcal {C}}\)); \(\tilde {{D}}\) is then (except with probability at most 1/10) \((\frac {{\varepsilon }}{20}+\frac {{\varepsilon }}{20}=\frac {{\varepsilon }}{10})\)-close to \({\mathcal {C}}\), and the algorithm returns accept.
-
4 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.
4.1 Existence of Structural Decompositions
Theorem 4.1 (Monotonicity)
For all γ, ζ > 0, the class \({\mathcal {M}}\) of monotone distributions on [n]is (γ, ζ, L)-splittable for \(L \overset {\text {def}}{=} {O\left ({\frac {\log ^{2} \frac {n}{\zeta }}{\gamma }} \right )}\) .
Note that this proof can already be found in [12, 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:
Proof of Theorem 4.1
We define the \(\mathcal {I}\) recursively as follows: \(\mathcal {I}^{(0)}=([1,n])\), and for j ≥ 0 the partition \(\mathcal {I}^{(j+1)}\) is obtained from \(\mathcal {I}^{(j)}=(I_{1}^{(j)},\dots ,I_{\ell _{j}}^{(j)})\) by going over the \(I^{(j)}_{i}=[a^{(j)}_{i}, b^{(j)}_{i}]\) in order, and:
-
(a)
if \(D(I^{(j)}_{i})\leq \frac {\zeta }{L}\), then \(I^{(j)}_{i}\) is added as element of \(\mathcal {I}^{(j+1)}\) (“marked as leaf”);
-
(b)
else, if \(D(a^{(j)}_{i}) \leq (1+\gamma ){D}(b^{(j)}_{i})\), then \(I^{(j)}_{i}\) is added as element of \(\mathcal {I}^{(j+1)}\) (“marked as leaf”);
-
(c)
otherwise, bisect I (j) in \(I^{(j)}_{\mathrm {L}}\), \(I^{(j)}_{\mathrm {R}}\) (with \(\left \lvert {I^{(j)}_{\mathrm {L}}} \right \rvert =\left \lceil {\left \lvert {I^{(j)}} \right \rvert /2} \right \rceil \)) and add both \(I^{(j)}_{\mathrm {L}}\) and \(I^{(j)}_{\mathrm {R}}\) as elements of \(\mathcal {I}^{(j+1)}\).
and repeat until convergence (that is, whenever the last item is not applied for any of the intervals). Clearly, this process is well-defined, and will eventually terminate (as (ℓ j ) j is a non-decreasing sequence of natural numbers, upper bounded by n). Let \(\mathcal {I}=(I_{1},\dots ,I_{\ell })\) (with I i = [a i ,a i+1)) be its outcome, so that the I i ’s are consecutive intervals all satisfying either (a) or (b). As (b) clearly implies (ii), we only need to show that ℓ ≤ L; for this purpose, we shall leverage as in [12] the fact that D is monotone to bound the number of recursion steps.
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 t be the number of recursion steps the process goes through before converging to \(\mathcal {I}\) (height of the tree); as mentioned above, we have \(t\leq \log n\) (as we start with an interval of size n, and the length is halved at each step.). Observe further that if at any point an interval \(I^{(j)}_{i}=[a^{(j)}_{i}, b^{(j)}_{i}]\) has \(D(a^{(j)}_{i}) \leq \frac {\zeta }{nL}\), then it immediately (as well as all the \(I^{(j)}_{k}\)’s for k ≥ i by monotonicity) satisfies (a) and is no longer split (“becomes a leaf”). So at any j ≤ t, the number of intervals i j for which neither (a) nor (b) holds must satisfy
where a k denotes the beginning of the k-th interval (again we use monotonicity to argue that the extrema were reached at the ends of each interval), so that \(i_{j} \leq 1+\frac {\log \frac {nL}{\zeta }}{\log (1+\gamma )}\). In particular, the total number of internal nodes is then
This implies the same bound on the number of leaves ℓ. □
Corollary 4.2 (Unimodality)
For all γ, ζ > 0, the class \(\mathcal {M}_{1}\) of unimodal distributions on [n]is (γ, ζ, L)-decomposable for \(L \overset {\text {def}}{=} {O\left ({\frac {\log ^{2} \frac {n}{\zeta }}{\gamma }} \right )}\) .
Proof
For any \(D\in \mathcal {M}_{1}\), [n] can be partitioned in two intervals I, J such that D I , D J are either monotone non-increasing or non-decreasing. Applying Theorem 4.1 to D I and D J and taking the union of both partitions yields a (no longer necessarily dyadic) partition of [n]. □
The same argument yields an analogous statement for t-modal distributions:
Corollary 4.3 (t-modality)
For any t ≥ 1and all γ, ζ > 0, the class \({\mathcal {M}_{t}}\) of t-modal distributions on [n]is (γ, ζ, L)-decomposable for \(L \overset {\text {def}}{=} {O\left ({\frac {t\log ^{2} \frac {n}{\zeta }}{\gamma }} \right )}\) .
Corollary 4.4 (Log-concavity, concavity and convexity)
For all γ, ζ > 0, the classes \({\mathcal {L}}\), \({\mathcal {K}^-}\) and \({\mathcal {K}^+}\) of log-concave, concave and convex distributions on [n]are (γ, ζ, L)-decomposable for \(L \overset {\text {def}}{=} {O\left ({\frac {\log ^{2} \frac {n}{\zeta }}{\gamma }} \right )}\) .
Proof
This is directly implied by Corollary 4.2, recalling that log-concave, concave and convex distributions are unimodal. □
Theorem 4.5 (Monotone Hazard Rate)
For all γ, ζ > 0, the class \({\mathcal {MHR}}\) of MHR distributions on [n]is (γ, ζ, L)-decomposable for \(L \overset {\text {def}}{=} {O\left ({\frac {\log \frac {n}{\zeta }}{\gamma }} \right )}\) .
Proof
This follows from adapting the proof of [15], which establishes that every MHR distribution can be approximated in ℓ 1 distance by a \({O\left ({\log (n/\varepsilon )/\varepsilon } \right )}\)-histogram. For completeness, we reproduce their argument, suitably modified to our purposes, in Appendix B. □
Theorem 4.6 (Piecewise Polynomials)
For all γ, ζ > 0, t, d ≥ 0, the class \({\mathcal {P}_{t,d}}\) of t-piecewise degree- D distributions on [n]is (γ, ζ, L)-decomposable for \(L \overset {\text {def}}{=} O\left ({\frac {t(d+1)}{\gamma }\log ^{2} \frac {n}{\zeta }} \right )\) .(Moreover, for the class of t-histograms \({\mathcal {H}_{t}}\) ( d = 0) one can take L = t .)
Proof
The last part of the statement is obvious, so we focus on the first claim. Observing that each of the t pieces of a distribution \(D\in {\mathcal {P}_{t,d}}\) can be subdivided in at most d + 1 intervals on which D is monotone (being degree-d polynomial on each such piece), we obtain a partition of [n] into at most t(d + 1) intervals. D 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 ^{2} n/\gamma )\) subintervals, yielding a good decomposition with \(O(t(d+1)\log ^{2} ({n}/{\zeta })/\gamma )\) pieces. □
4.2 Projection Step: Computing the Distances
This section contains details of the distance estimation procedures for these classes, required in the last stage of Algorithm 1. (Note that some of these results are phrased in terms of distance approximation, as estimating the distance \(\ell _{1}({D},\mathcal {C})\) to sufficient accuracy in particular yields an algorithm for this stage.)
We focus in this section on achieving the sample complexities stated in Corollary 1.2, Corollary 1.3, and Corollary 1.4—that is, our procedures will not require any additional sample from the distribution. 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 n, there are two exceptions—namely, the procedures for monotone hazard rate (Lemma 4.9) and log-concave (Lemma 4.10) 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 (that is, these more efficient procedures will require some additional samples from the distribution).
Lemma 4.7 (Monotonicity [12, Lemma 8])
There exists a procedure \(\textsc {ProjectionDist}_{{\mathcal {M}}}\) that, on input n as well as the full (succinct) specification of an ℓ -histogram D on [n], computes the (exact) distance \(\ell _{1}({D},\mathcal {M})\) in time poly(ℓ).
A straightforward modification of the algorithm above (e.g., by adapting the underlying linear program to take as input the location m ∈ [ℓ] of the mode of the distribution; then trying all ℓ possibilities, running the subroutine ℓ times and picking the minimum value) results in a similar claim for unimodal distributions:
Lemma 4.8 (Unimodality)
There exists a procedure \(\textsc {ProjectionDist}_{\mathcal {M}_{1}}\) that, on input n as well as the full (succinct) specification of an ℓ -histogram D on [n], computes the (exact) distance \(\ell _{1}({D},{{\mathcal {M}}_{1}})\) in time poly(ℓ).
A similar result can easily be obtained for the class of t-modal distributions as well, with a poly(ℓ, t)-time algorithm based on a combination of dynamic and linear programming. Analogous statements hold for the classes of concave and convex distributions \({\mathcal {K}^+}, {\mathcal {K}^-}\), also based on linear programming (specifically, on running \({O\left (n^{2} \right )}\) different linear programs—one for each possible support \([a,b]\subseteq [n]\)—and taking the minimum over them).
Lemma 4.9 (MHR)
There exists a (non-efficient) procedure \(\textsc {ProjectionDist}_{{\mathcal {MHR}}}\) that, on input n, ε, as well as the full specification of a distribution D on [n], distinguishes between \(\ell _{1}({D},{\mathcal {MHR}}) \leq \varepsilon \) and \(\ell _{1}({D},{\mathcal {MHR}})>2\varepsilon \) in time \(2^{\tilde {O}_{\varepsilon }(n)}\).
Lemma 4.10 (Log-concavity)
There exists a (non-efficient) procedure \(\textsc {ProjectionDist}_{{\mathcal {L}}}\) that, on input n, ε, as well as the full specification of a distribution D on [n], distinguishes between \(\ell _{1}({D},\mathcal {L}) \leq \varepsilon \) and \(\ell _{1}({D},\mathcal {L})>2\varepsilon \) in time \(2^{\tilde {O}_{\varepsilon }(n)}\) .
Proof of Lemma 4.9 and Lemma 4.10
We here give a naive algorithm for these two problems, based on an exhaustive search over a (huge) ε-cover \(\mathcal {S}\) of distributions over [n]. Essentially, \(\mathcal {S}\) contains all possible distributions whose probabilities \(p_{1},\dots ,p_{n}\) are of the form j ε/n, for \(j\in \{0,\dots ,n/\varepsilon \}\) (so that \(\left \lvert {\mathcal {S}} \right \rvert = {O\left ({(n/\varepsilon )^{n}} \right )}\)). It is not hard to see that this indeed defines an ε-cover of the set of all distributions, and moreover that it can be computed in time \(\text {poly}(\left \lvert {\mathcal {S}} \right \rvert )\). To approximate the distance from an explicit distribution D to the class \(\mathcal {C}\) (either \({\mathcal {MHR}}\) or \(\mathcal {L}\)), it is enough to go over every element S of \(\mathcal {S}\), checking (this time, efficiently) if ∥S − D∥1 ≤ ε and if there is a distribution \(P\in \mathcal {C}\) close to S (this time, pointwise, that is \(\left \lvert {P(i)-S(i)} \right \rvert \leq \varepsilon /n\) for all i)—which also implies ∥S − P∥1 ≤ ε and thus ∥P − D∥1 ≤ 2ε. 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. \(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)-\varepsilon /n) \leq x_{i} \leq \ln (S(i)+\varepsilon /n)\) for all i. At the end of this enumeration, the procedure accepts if and only if for some S both ∥S − D∥1 ≤ ε and the corresponding linear program was feasible. □
Lemma 4.11 (Piecewise Polynomials)
There exists a procedure \(\textsc {ProjectionDist}_{{\mathcal {P}_{t,d}}}\) that, on input n as well as the full specification of an ℓ -histogram D on [n], computes an approximation Δof the distance \(\ell _{1}({D},{\mathcal {P}_{t,d}})\) such that \(\ell _{1}({D},{\mathcal {P}_{t,d}}) \leq {\Delta } \leq 3\ell _{1}({D},{\mathcal {P}_{t,d}})+\varepsilon \), and runs in time \({O\left ({n^{3}} \right )}\cdot \text {poly}(\ell ,t,d,\frac {1}{\varepsilon })\) .
Moreover, for the special case of t-histograms (d = 0)there exists a procedure \(\textsc {ProjectionDist}_{{\mathcal {H}_{t}}}\), which, given inputs as above, computes an approximation Δof the distance \(\ell _{1}({D},{\mathcal {H}_{t}})\) such that \(\ell _{1}({D},{\mathcal {H}_{t}}) \leq {\Delta } \leq 4\ell _{1}({D},{\mathcal {H}_{t}})+{\varepsilon }\), and runs in time \(\text {poly}(\ell ,t,\frac {1}{{\varepsilon }})\), independent of n.
Proof
We begin with \(\textsc {ProjectionDist}_{{\mathcal {H}_{t}}}\). Fix any distribution D on [n]. Given any explicit partition of [n] into intervals \(\mathcal {I}=(I_{1},\dots ,I_{t})\), one can easily show that \(\|{{D} - {\Phi }({D},\mathcal {I})\|_{1}} \leq 2{\textsc {opt}}_{\mathcal {I}}\), where \({\textsc {opt}}_{\mathcal {I}}\) is the optimal distance of D to any histogram on \(\mathcal {I}\) (recall that we write \({\Phi }({D},\mathcal {I})\) for the flattening of D over the partition \(\mathcal {I}\)). To get a 2-approximation of \(\ell _{1}({D},{\mathcal {H}_{t}})\), it thus suffices to find the minimum, over all possible partitionings \(\mathcal {I}\) of [n] into t intervals, of the quantity \(\|{{D} - {\Phi }({D},\mathcal {I})\|_{1}}\) (which itself can be computed in time \(T=O(\min (t\ell ,n))\)). By a simple dynamic programming approach, this can be performed in time \({O\left ({t n^{2} \cdot T} \right )}\). The quadratic dependence on n, which follows from allowing the endpoints of the t intervals to be at any point of the domain, is however far from optimal and can be reduced to (t/ε)2, as we show below.
For η > 0, define an η-granular decomposition of a distribution D over [n] to be a partition of [n] into \(s={O\left ({1/\eta } \right )}\) intervals \(J_{1},\dots ,J_{s}\) such that each interval J i is either a singleton or satisfies D(J i ) ≤ η. (Note that if D is a known ℓ-histogram, one can compute an η-granular decomposition of D in time \({O\left ({\ell /\eta } \right )}\) in a greedy fashion.)
Claim 4.12
Let D be a distribution over [n], and \(\mathcal {J} = (J_{1},\dots ,J_{s})\) be an η -granular decomposition of D (with s ≥ t ). Then, there exists a partition of [n]into t intervals \(\mathcal {I}=(I_{1},\dots ,I_{t})\) and a t-histogram H on \(\mathcal {I}\) such that \(\|{{D} - H}\|_{1} \leq 2\ell _{1}({D},{\mathcal {H}_{t}})+2t\eta \), and \(\mathcal {I}\) is a coarsening of \(\mathcal {J}\) .
Before proving it, we describe how this will enable us to get the desired time complexity for \(\textsc {ProjectionDist}_{{\mathcal {H}_{t}}}\). Phrased differently, the claim above allows us to run our dynamic program using the \({O\left ({1/\eta } \right )}\) endpoints of the \({O\left ({1/\eta } \right )}\) instead of the n points of the domain, paying only an additive error O(t η). Setting \(\eta =\frac {\varepsilon }{4t}\), the guarantee for \(\textsc {ProjectionDist}_{{\mathcal {H}_{t}}}\) follows.
Proof of Claim 4.12
Let \(\mathcal {J} =(J_{1},\dots ,J_{s})\) be an η-granular decomposition of D, and \(H^{\ast }\in {\mathcal {H}_{t}}\) be a histogram achieving \({\textsc {opt}}=\ell _{1}({D},{\mathcal {H}_{t}})\). Denote further by \(\mathcal {I^{\ast }} = (I^{\ast }_{1},\dots ,I^{\ast }_{t})\) the partition of [n] corresponding to H ∗. Consider now the r ≤ t endpoints of the \(I^{\ast }_{i}\)’s that do not fall on one of the endpoints of the J i ’s: let \(J_{i_{1}},\dots ,J_{i_{r}}\) be the respective intervals in which they fall (in particular, these cannot be singleton intervals), and \(S=\cup _{j=1}^{r} J_{i_{j}}\) their union. By definition of η-granularity, D(S) ≤ t η, and it follows that \(H^{\ast }(S)\leq t\eta + \frac {1}{2}{\textsc {opt}}\). We define H from H ∗ in two stages: first, we obtain a (sub)distribution \(H^{\prime }\) by modifying H ∗ on S, setting for each \(x\in J_{i_{j}}\) the value of H to be the minimum value (among the two options) that H ∗ takes on \(J_{i_{j}}\). \(H^{\prime }\) is thus a t-histogram, and the endpoints of its intervals are endpoints of \(\mathcal {J}\) as wished; but it may not sum to one. However, by construction we have that \(H^{\prime }([n]) \geq 1-H^{\ast }(S) \geq 1-t\eta - \frac {1}{2}{\textsc {opt}}\). Using this, we can finally define our t-histogram distribution H as the renormalization of \(H^{\prime }\). It is easy to check that H is a valid t-histogram on a coarsening of \(\mathcal {J}\), and
as stated. □
Turning now to \(\textsc {ProjectionDist}_{{\mathcal {P}_{t,d}}}\), we apply the same initial dynamic programming approach, which will result on a running time of \({O\left ({n^{2}t\cdot T} \right )}\), where T is the time required to estimate (to sufficient accuracy) the distance of a given (sub)distribution over an interval I onto the space \({\mathcal {P}_{d}}\) of degree-d polynomials. Specifically, we will invoke the following result, adapted from [16] to our setting:
Theorem 4.13
Let p be an ℓ -histogram over [−1,1).There is an algorithm ProjectSinglePoly(d, η)which runs in time poly(ℓ, d + 1,1/η), and outputs a degree- D polynomial q which defines a pdf over [−1,1)such that \({\lVert {p-q}{\rVert }}_1 \leq 3 \ell _{1}(p,{\mathcal {P}_{d}}) + O(\eta )\) .
The proof of this modification of [16, Theorem 9] is deferred to Appendix C. Applying it as a blackbox with η set to \({O\left ({\varepsilon /t} \right )}\) and noting that computing the ℓ 1 distance to our explicit distribution on a given interval of the degree-d polynomial returned incurs an additional \({O\left ({n} \right )}\) factor, we obtain the claimed guarantee and running time. □
4.2.1 Computationally Efficient Procedures for Log-Concave and MHR Distributions
We now describe how to obtain efficient testing for the classes \({\mathcal {L}}\) and \({\mathcal {MHR}}\)—that is, how to obtain polynomial-time distance estimation procedures for these two classes, unlike the ones described in the previous section. At a very high-level, the idea is in both cases to write down a linear program on variables related logarithmically to the probabilities we are searching, as enforcing the log-concave and MHR constraints on these new variables can be done linearly. The catch now becomes the ℓ 1 objective function (and, to a lesser extent, the fact that the probabilities must sum to one), now highly non-linear.
The first insight is to leverage the structure of log-concave (resp. monotone hazard rate) distributions to express this objective as slightly stronger constraints, specifically pointwise (1 ± ε)-multiplicative closeness, much easier to enforce in our “logarithmic formulation.” Even so, doing this naively fails, essentially because of a too weak distance guarantee between our explicit histogram \(\hat {{D}}\) and the unknown distribution we are trying to find: in the completeness case, we are only promised ε-closeness in ℓ 1, while we would also require good additive pointwise closeness of the order ε 2 or ε 3.
The second insight is thus to observe that we “almost” have this for free: indeed, if we do not reject in the first stage of the testing algorithm, we do obtain an explicit k-histogram \(\hat {{D}}\) with the guarantee that D is ε-close to the distribution P to test. However, we also implicitly have another distribution \(\hat {{D}}^{\prime }\) that is \(\sqrt {\varepsilon /k}\)-close to P in Kolmogorov distance: as in the recursive descent we take enough samples to use the DKW inequality (Theorem 2.11) with this parameter, i.e. an additive overhead of \({O\left ({k/\varepsilon } \right )}\) samples (on top of the \(\tilde {O}(\sqrt {kn}/\varepsilon ^{7/2})\)). If we are willing to increase this overhead by just a small amount, that is to take \(\tilde {O}\left ({ \max (k/\varepsilon , 1/\varepsilon ^{4}) } \right )\), we can guarantee that \(\hat {{D}}^{\prime }\) be also \(\tilde {O}\left ({\varepsilon ^{2}} \right )\)-close to P in Kolmogorov distance.
Combining these ideas yield the following distance estimation lemmas:
Lemma 4.14 (Monotone Hazard Rate)
There exists a procedure \(\textsc {ProjectionDist}_{{\mathcal {MHR}}}^{\ast }\) that, on input n as well as the full specification of a k-histogram distribution D on [n]and of an ℓ -histogram distribution \(D^{\prime }\) on [n], runs in time poly(n,1/ε), and satisfies the following.
-
If there is \(P\in {\mathcal {MHR}}\) such that \({\lVert {{D}-P}{\rVert }}_1 \leq {\varepsilon }\) and \({\lVert {D}^{\prime } - P{\rVert }_{\text {Kol}}} \leq {\varepsilon }^{3}\), then the procedure returns yes;
-
If \(\ell _{1}({D},{\mathcal {MHR}}) > 100{\varepsilon }\), then the procedure returns no.
Theorem 4.15 (Log-Concavity)
There exists a procedure \(\textsc {ProjectionDist}_{{\mathcal {L}}}^{\ast }\) that, on input n as well as the full specifications of a k-histogram distribution D on [n]and an ℓ -histogram distribution \(D^{\prime }\) on [n], runs in time poly(n, k, ℓ,1/ε), and satisfies the following.
-
If there is \(P\in {\mathcal {L}}\) such that \({\lVert {{D}-P}{\rVert }}_1\leq {\varepsilon }\) and \({\lVert {D}^{\prime } - P{\rVert }_{\text {Kol}}}\leq \frac {\varepsilon ^{2}}{\log ^{2}(1/\varepsilon )}\), then the procedure returns yes;
-
If \(\ell _{1}({D},{\mathcal {L}}) \geq 100{\varepsilon }\), then the procedure returns no.
The proofs of these two lemmas are quite technical and deferred to Appendix C. With these in hand, a simple modification of our main algorithm (specifically, setting \(m = \tilde {O}(\max ({\sqrt {L\left \lvert {I} \right \rvert }}/{\varepsilon ^{3}}, {L}/{\varepsilon ^{2}}, {1}/{\varepsilon ^{c}} ) )\) for c either 4 or 6 instead of \(\tilde {O}(\max ({\sqrt {L\left \lvert {I}\right \rvert }}/{\varepsilon ^{3}}, {L}/{\varepsilon ^{2}} ) )\), to get the desired Kolmogorov distance guarantee; and providing the empirical histogram defined by these m samples along to the distance estimation procedure) suffices to obtain the following counterpart to Corollary 1.2:
Corollary 4.16
The algorithm TestSplittable , after this modification, can efficiently test the classes of log-concave and monotone hazard rate (MHR) distributions, with respectively \(\tilde {O}\left ({\sqrt {n}/\varepsilon ^{7/2} + 1/\varepsilon ^{4}}\right )\) and \(\tilde {O}\left ({\sqrt {n}/\varepsilon ^{7/2} + 1/\varepsilon ^{6}}\right )\) samples.
We observe that Lemma 4.14 and Lemma 4.15 actually imply efficient proper learning algorithms for the classes of respectively MHR and log-concave distributions, with sample complexity \({O\left ({1/\varepsilon ^{4}} \right )}\) and \({O\left ({1/\varepsilon ^{6}} \right )}\). Along with analogous subroutines of [3], these were the first proper learning algorithms (albeit with suboptimal sample complexity) for these classes. (Subsequent work of Diakonikolas, Kane, and Steward [30] recently obtained, through a completely different approach, a sample-optimal and efficient learning algorithm for the class of log-concave distributions which is both proper and agnostic.)
5 Going Further: Reducing the Support Size
The general approach we have been following so far gives, out-of-the-box, an efficient testing algorithm with sample complexity \(\tilde {O}\left (\sqrt {n} \right )\) for a large range of properties. However, this sample complexity can for some classes \({\mathcal {P}}\) be brought down a lot more, by taking advantage in a preprocessing step of good concentration guarantees of distributions in \({\mathcal {P}}\).
As a motivating example, consider the class of Poisson Binomial Distributions (PBD). It is well-known (see e.g. [38, Section 2]) that PBDs are unimodal, and more specifically that \(\mathcal {PBD}_{n}\subseteq \mathcal {L}\subseteq {{\mathcal {M}}_{1}}\). Therefore, using our generic framework we can test Poisson Binomial Distributions with \(\tilde {O}\left ({\sqrt {n}} \right )\) samples. This is, however, far from optimal: as shown in [2], a sample complexity of \({\Theta \left ({n^{1/4}} \right )}\) is both necessary and sufficient. The reason our general algorithm ends up making quadratically too many queries can be explained as follows. PBDs are tightly concentrated around their expectation, so that they “morally” live on a support of size \(m={O\left ({\sqrt {n}} \right )}\). Yet, instead of testing them on this very small support, in the above we still consider the entire range [n], and thus end up paying a dependence \(\sqrt {n}\) – instead of \(\sqrt {m}\).
If we could use that observation to first reduce the domain to the effective support of the distribution, then we could call our testing algorithm on this reduced domain of size \({O\left ({\sqrt {n}} \right )}\). In the rest of this section, we formalize and develop this idea, and in Section 5.2 will obtain as a direct application a \(\tilde {O}\left ({n^{1/4}} \right )\)-query testing algorithm for \(\mathcal {PBD}_{n}\).
Definition 5.1
Given ε > 0, the ε-effective support of a distribution D is the smallest interval I such that D(I) ≥ 1 − ε.
The last definition we shall require is that of the conditioned distributions of a class \({\mathcal {C}}\):
Definition 5.2
For any class of distributions \({\mathcal {C}}\) over [n], define the set of conditioned distributions of \(\mathcal {C}\) (with respect to ε > 0 and interval \(I\subseteq [n]\)) as \(\mathcal {C}^{\varepsilon ,I}\overset {\text {def}}{=} \left \{ {{D}_{I}} \;\colon \; {{D}\in \mathcal {C}, {D}(I) \geq 1-\varepsilon } \right \} \).
Finally, we will require the following simple result:
Lemma 5.3
Let D be a distribution over [n], and \(I\subseteq [n]\) an interval such that \(D(I) \geq 1- \frac {{\varepsilon }}{10}\) .Then,
-
If \(D\in {\mathcal {C}}\), then \(D_{I}\in {\mathcal {C}}^{\frac {{\varepsilon }}{10},I}\) ;
-
If \(\ell _{1}({D},{\mathcal {C}}) > {\varepsilon }\), then \(\ell _{1}({D}_{I}, {\mathcal {C}}^{\frac {{\varepsilon }}{10},I}) > \frac {7{\varepsilon }}{10}\) .
Proof
The first item is obvious. As for the second, let \(P\in {\mathcal {C}}\) be any distribution with \(P(I)\geq 1-\frac {{\varepsilon }}{10}\). By assumption, ∥D − P∥1 > ε: but we have, writing α = 1/10,
□
We now proceed to state and prove our result—namely, efficient testing of structured classes of distributions with nice concentration properties.
Theorem 5.4
Let \({\mathcal {C}}\) be a class of distributions over [n]for which the following holds.
-
1.
there is a function M(⋅,⋅)such that each \(D\in {\mathcal {C}}\) has ε -effective support of size at most M(n, ε);
-
2.
for every ε ∈ [0, 1]and interval \(I\subseteq [n]\), \({\mathcal {C}}^{{\varepsilon },I}\) is (γ, ζ, L)-splittable;
-
3.
there exists an efficient procedure \(\textsc {ProjectionDist}_{{\mathcal {C}}^{{\varepsilon },I}}\) which, given as input the explicit description of a distribution D over [n]and interval \(I\subseteq [n]\), computes the distance \(\ell _{1}({D}_{I},\mathcal {C}^{\varepsilon ,I})\) .
Then, the algorithm TestEffectiveSplittable (Algorithm 2) is a \({O\left (\max \left (\frac {1}{{\varepsilon }^{3}} \sqrt {m\ell } \log m, \frac {\ell }{{\varepsilon }^{2}}\right ) \right )}\) -sample tester for \({\mathcal {C}}\), where \(m=M(n,\frac {{\varepsilon }}{60})\) and \(\ell =L(\frac {{\varepsilon }}{1200},\frac {{\varepsilon }}{1200}, m)\) .
5.1 Proof of Theorem 5.4
By the choice of m and the DKW inequality, with probability at least 23/24 the estimate \(\hat {{D}}\) satisfies \({\lVert {D} - \hat {{D}}{\rVert }_{\text {Kol}}} \leq \frac {{\varepsilon }}{60}\). Conditioning on that from now on, we get that \(D(I) \geq \hat {{D}}(I) - \frac {{\varepsilon }}{30} \geq 1-\frac {{\varepsilon }}{10}\). Furthermore, denoting by j and k the two inner endpoints of J and K in Steps 4 and 5, we have \(D(J\cup \{j+1\}) \geq \hat {{D}}(J\cup \{j+1\}) - \frac {{\varepsilon }}{60} > \frac {{\varepsilon }}{60}\) (similarly for \(D(K\cup \{k-1\})\)), so that I has size at most σ + 1, where σ is the \(\frac {{\varepsilon }}{60}\)-effective support size of D.
Finally, note that since \(D(I) = {\Omega \left (1 \right )}\) by our conditioning, the simulation of samples by rejection sampling will succeed with probability at least 23/24 and the algorithm will not output fail.
Sample Complexity
The sample complexity is the sum of the \({O\left (1/{\varepsilon }^{2} \right )}\) in Step 3 and the \({O\left (q \right )}\) in Step 11. From Theorem 1.1 and the choice of I, this latter quantity is \({O\left ({ \max \left (\frac {1}{\varepsilon ^{3}} \sqrt {m\ell } \log m, \frac {\ell }{\varepsilon ^{2}}\right ) } \right )}\) where \(m = M(n,\frac {\varepsilon }{60})\) and \(\ell =L(\frac {\varepsilon }{1200},\frac {\varepsilon }{1200}, M(n,\frac {\varepsilon }{60}))\).
Correctness
If \(D\in {\mathcal {C}}\), then by the setting of τ (set to be an upper bound on the \(\frac {\varepsilon }{60}\)-effective support size of any distribution in \(\mathcal {C}\)) the algorithm will go beyond Step 6. The call to TestSplittable will then end up in the algorithm returning accept in Step 12, with probability at least 2/3 by Lemma 5.3, Theorem 1.1 and our choice of parameters.
Similarly, if D is ε-far from \({\mathcal {C}}\), then either its effective support is too large (and then the test on Step 6 fails), or the main tester will detect that its conditional distribution on I is \(\frac {7\varepsilon }{10}\)-far from \(\mathcal {C}\) and output reject in Step 12.
Overall, in either case the algorithm is correct except with probability at most 1/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/3.
5.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:
Corollary 5.5
The class of Poisson Binomial Distributions can be tested with \(\tilde {O}\left ({n}^{1/4}/{\varepsilon }^{7/2} \right ) + \tilde {O}\left (\log ^{2} n/\varepsilon ^{3} \right )\) samples, using Algorithm 2.
This is a direct consequence of Theorem 5.4 and the lemmas below. The first one states that, indeed, PBDs have small effective support:
Fact 5.6
For any ε > 0, a PBD has ε -effective support of size \({O\left (\sqrt {n\log (1/{\varepsilon })} \right )}\) .
Proof
By an additive Chernoff Bound, any random variable X following a Poisson Binomial Distribution has \(\Pr \!\left [\, {\left \lvert {X-\mathbb {E} X} \right \rvert > \gamma n}\, \right ] \leq 2e^{-2\gamma ^{2}n}\). Taking \(\gamma \overset {\text {def}}{=}\sqrt {\frac {1}{2n}\ln \frac {2}{\varepsilon }}\), we get that \(\Pr \!\left [\, {X\in I}\, \right ] \geq 1-\varepsilon \), where \(I\overset {\text {def}}{=} [\mathbb {E} X-\sqrt {\frac {n}{2}\ln \frac {2}{\varepsilon }}, \mathbb {E} X+\sqrt {\frac {n}{2}\ln \frac {2}{\varepsilon }}]\). □
It is clear that if \(D\in {\mathcal {PBD}}_{n}\) (and therefore is unimodal), then for any interval \(I\subseteq [n]\) the conditional distribution D I is still unimodal, and thus the class of conditioned PBDs \(\mathcal {PBD}_{n}^{\varepsilon ,I}\overset {\text {def}}{=} \left \{ {{D}_{I}} \;\colon \; {{D}\in \mathcal {PBD}_{n}, {D}(I) \geq 1-\varepsilon } \right \}\) falls under Corollary 4.2. 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:
Claim 5.7
There exists a procedure \(\textsc {ProjectionDist}_{{\mathcal {PBD}}_{n}^{{\varepsilon },I}}\) that, on input n and ε ∈ [0, 1], \(I\subseteq [n]\) as well as the full specification of a distribution D on [n], computes a value τ such that \(\tau \in [1\pm 2\varepsilon ] \cdot \ell _{1}({D},\mathcal {PBD}_{n}^{\varepsilon ,I}) \pm \frac {\varepsilon }{100}\), in time \(n^{2} \left ({1/\varepsilon } \right )^{{O\left ({\log {1/\varepsilon }} \right )}}\) .
Proof
The goal is to find a γ = Θ(ε)-approximation of the minimum value of \({\sum }_{i\in I}\left \lvert \frac {P(i)}{P(I)} - \frac {{D}(i)}{{D}(I)} \right \rvert \), subject to \(P(I)={\sum }_{i\in I} P(i) \geq 1-{\varepsilon }\) and \(P\in {\mathcal {PBD}}_{n}\). We first note that, given the parameters \(n \in {\mathbb {N}}\) and \(p_{1},\dots ,p_{n}\in [0, 1]\) of a PBD P, the vector of (n + 1) probabilities \(P(0),\dots ,P(n)\) can be obtained in time \({O\left (n^{2} \right )}\) by dynamic programming. Therefore, computing the ℓ 1 distance between D and any PBD with known parameters can be done efficiently. To conclude, we invoke a result of Diakonikolas, Kane, and Stewart, that guarantees the existence of a succinct (proper) cover of \({\mathcal {PBD}}_{n}\):
Theorem 5.8 ([31, Theorem 4] (rephrased))
For all n, γ > 0, there exists a set \(\mathcal {S}_{\gamma } \subseteq \mathcal {PBD}_{n}\) such that:
-
(i)
\(\mathcal {S}_{\gamma }\) is a γ -cover of \({\mathcal {PBD}}_{n}\) ;that is, for all \(D \in {\mathcal {PBD}}_{n}\) there exists some \(D^{\prime } \in \mathcal {S}_{\gamma }\) such that \(\|{{D}-{D}^{\prime }}\|_{1} \leq \gamma \)
-
(ii)
\(\left \lvert \mathcal {S}_{\gamma } \right \rvert \leq n \left ({1/\gamma }\right )^{{O\left (\log {1/\gamma } \right )}}\)
-
(iii)
\(\mathcal {S}_{\gamma }\) can be computed in time \(n\left ({1/\gamma } \right )^{{O\left (\log {1/\gamma } \right )}}\)
and each \(D\in \mathcal {S}_{\gamma }\) is explicitly described by its set of parameters.
We further observe that the factor n 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 [31], that of the PBDs with effective support compatible with our distribution D.)
Set \(\gamma \overset {\text {def}}{=}\frac {{\varepsilon }}{250}\). Fix \(P\in {\mathcal {PBD}}_{n}\) such that P(I) ≥ 1 − ε, and \(Q\in \mathcal {S}_{\gamma }\) such that \({\lVert {P-Q}{\rVert }}_1\leq \gamma \). In particular, it is easy to see via the correspondence between ℓ 1 and total variation distance that \(\left \lvert P(I)-Q(I) \right \rvert \leq \gamma /2\). By a calculation similar to that of Lemma 5.3, we have
where we used the fact that \({\sum }_{i\notin I}\left \lvert P(i) - Q(i) \right \rvert = 2\left ({\sum }_{i\notin I\colon P(i) > Q(i)} (P(i)-Q(i))\right ) + Q(I)-P(I) \in [-2\gamma ,2\gamma ]\). By the triangle inequality, this implies that the minimum of \({\lVert {P_{I}-{D}_{I}}{\rVert }}_1\) over the distributions P of \(\mathcal {S}_{{\varepsilon }}\) with P(I) ≥ 1 − (ε + γ/2) will be within an additive \({O\left ({\varepsilon } \right )}\) of \(\ell _{1}({D},{\mathcal {PBD}}_{n}^{{\varepsilon },I})\). The fact that the former can be found (by enumerating over the cover of size \(\left ({1/{\varepsilon }} \right )^{{O\left (\log {1/{\varepsilon }} \right )}}\) by the above discussion, and for each distribution in the cover computing the vector of probabilities and the distance to D) in time \(O(n^{2})\cdot \left \lvert S_{{\varepsilon }} \right \rvert =n^{2} \cdot \left ({1/{\varepsilon }} \right )^{{O\left (\log {1/{\varepsilon }} \right )}}\) concludes the proof. □ As previously mentioned, this approximation guarantee for \(\ell _{1}({D},{\mathcal {PBD}}_{n}^{{\varepsilon },I})\) is sufficient for the purpose of Algorithm 1.
Proof of Corollary 5.5
Combining the above, we invoke Theorem 5.4 with \(M(n,{\varepsilon })=O(\sqrt {n\log (1/{\varepsilon })} )\) (Fact 5.6) and \(L(\gamma ,\zeta ,m)=O\left (\frac {1}{\gamma }\log ^{2} \frac {m}{\zeta } \right )\) (Corollary 4.2). This yields the claimed sample complexity; finally, the efficiency is a direct consequence of Claim 5.7. □
6 Lower Bounds
6.1 Reduction-Based Lower Bound Approach
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 \(\mathcal {C}\) if it satisfies the following. Given sample access to an arbitrary distribution D and parameter ε, it outputs a hypothesis \(\hat {{D}}\) which (with high probability) does “almost as well as it gets”:
where \({\textsc {opt}}_{{\mathcal {C}},{D}}\overset {\text {def}}{=} \inf _{{D}^{\prime }\in {\mathcal {C}}} \ell _{1}({D}^{\prime },{D})\), and c ≥ 1 is some absolute constant (if c = 1, the learner is said to be agnostic).
High-Level Idea
The motivation for our result is the observation of [12] 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\left ({1/\varepsilon ^{2}} \right )}\) samples suffice.)Footnote 7 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 \({\mathcal {C}}\) which (a) contains the uniform distribution, and (b) for which we have a \({o\left (\sqrt {n} \right )}\)-sample agnostic learner \({\mathcal {L}}\), as follows. Assuming we have a tester \({\mathcal {T}}\) for \({\mathcal {C}}\) with sample complexity \({o\left (\sqrt {n} \right )}\), define a uniformity tester as below.
-
test if \(D\in {\mathcal {C}}\) using \({\mathcal {T}}\); if not, reject (as \({\mathcal {U}}\in {\mathcal {C}}\), D cannot be uniform);
-
otherwise, agnostically learn D with \({\mathcal {L}}\) (since D is close to \({\mathcal {C}}\)), and obtain hypothesis \(\hat {{D}}\);
-
check offline if \(\hat {D}\) is close to uniform.
By assumption, \({\mathcal {T}}\) and \({\mathcal {L}}\) each use \({o\left (\sqrt {n} \right )}\) samples, so does the whole process; but this contradicts the lower bound of [11, 42] on uniformity testing. Hence, \({\mathcal {T}}\) must use \({\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:
Theorem 6.1
Let \({\mathcal {C}}\) be a class of distributions over [n]for which the following holds:
-
(i)
there exists a semi-agnostic learner \({\mathcal {L}}\) for \({\mathcal {C}}\), with sample complexity q L (n, ε, δ)and “agnostic constant” c;
-
(ii)
there exists a subclass \({\mathcal {C}}_{\text {Hard}}\subseteq {\mathcal {C}}\) such that testing \({\mathcal {C}}_{\text {Hard}}\) requires q H (n, ε)samples.
Suppose further that \(q_{L}(n,{\varepsilon }, 1/6)={o\left (q_{H}(n,{\varepsilon }) \right )}\) .Then, any tester for \({\mathcal {C}}\) must use \({\Omega \left ({q_{H}(n,\varepsilon )} \right )}\) samples.
Proof
The above theorem relies on the reduction outlined above, which we rigorously detail here. Assuming \({\mathcal {C}}\), \(\mathcal {C}_{\text {Hard}}\), \({\mathcal {L}}\) as above (with semi-agnostic constant c ≥ 1), and a tester \({\mathcal {T}}\) for \(\mathcal {C}\) with sample complexity q T (n, ε), we define a tester \({\mathcal {T}}_{\text {Hard}}\) for \(\mathcal {C}_{\text {Hard}}\). On input ε ∈ (0, 1] and given sample access to a distribution D on [n], \({\mathcal {T}}_{\text {Hard}}\) acts as follows:
-
call \({\mathcal {T}}\) with parameters n, \(\frac {{\varepsilon }^{\prime }}{c}\) (where \({\varepsilon }^{\prime }\overset {\text {def}}{=}\frac {{\varepsilon }}{3}\)) and failure probability 1/6, to \(\frac {\varepsilon ^{\prime }}{c}\)-test if \(D\in \mathcal {C}\). If not, reject.
-
otherwise, agnostically learn a hypothesis \(\hat {{D}}\) for D, with \({\mathcal {L}}\) called with parameters n, \(\varepsilon ^{\prime }\) and failure probability 1/6;
-
check offline if \(\hat {{D}}\) is \({\varepsilon }^{\prime }\)-close to \({\mathcal {C}}_{\text {Hard}}\), accept if and only if this is the case.
We condition on both calls (to \({\mathcal {T}}\) and \({\mathcal {L}}\)) to be successful, which overall happens with probability at least 2/3 by a union bound. The completeness is immediate: if \(D\in \mathcal {C}_{\text {Hard}}\subseteq \mathcal {C}\), \({\mathcal {T}}\) accepts, and the hypothesis \(\hat {{D}}\) satisfies \(\|{\hat {{D}}-{D}}\|_{1} \leq \varepsilon ^{\prime }\). Therefore, \(\ell _{1}(\hat {{D}},\mathcal {C}_{\text {Hard}}) \leq \varepsilon ^{\prime }\), and \({\mathcal {T}}_{\text {Hard}}\) accepts.
For the soundness, we proceed by contrapositive. Suppose \({\mathcal {T}}_{\text {Hard}}\) accepts; it means that each step was successful. In particular, \(\ell _{1}(\hat {{D}},{\mathcal {C}})\leq {{\varepsilon }^{\prime }}/{c}\); so that the hypothesis outputted by the agnostic learner satisfies \({\lVert {\hat {{D}}-{D}}{\rVert }}_1 \leq c\cdot {\textsc {opt}}+{\varepsilon }^{\prime }\leq 2{\varepsilon }^{\prime }\). In turn, since the last step passed and by a triangle inequality we get, as claimed, \(\ell _{1}({D}, {\mathcal {C}}_{\text {Hard}}) \leq 2\varepsilon ^{\prime } + \ell _{1}(\hat {{D}},{\mathcal {C}}_{\text {Hard}}) \leq 3{\varepsilon }^{\prime } = {\varepsilon }\).
Observing that the overall sample complexity is \(q_{T}(n,\frac {{\varepsilon }^{\prime }}{c})+q_{L}(n,{\varepsilon }^{\prime }, \frac {1}{6}) = q_{T}(n,\frac {\varepsilon ^{\prime }}{c})+{o\left ({q_{H}(n,\varepsilon ^{\prime })} \right )}\) concludes the proof. □
Taking \({\mathcal {C}}_{\text {Hard}}\) to be the singleton consisting of the uniform distribution, and from the semi-agnostic learners of [15, 16] (each with sample complexity either poly(1/ε) or \(\text {poly}(\log n,1/{\varepsilon })\)), we obtain the following:Footnote 8
Corollary 1.6
Testing log-concavity, convexity, concavity, MHR, unimodality, t-modality, t-histograms, and t-piecewise degree- D distributions each require \({\Omega \left ({\sqrt {n}}/{{\varepsilon }^{2}} \right )}\) samples (the last three for \(t = o(\sqrt {n})\) and \(t(d+1) = o(\sqrt {n})\), respectively), for any ε ≥ 1/n O(1).
Similarly, we can use another result of [23] which shows how to agnostically learn Poisson Binomial Distributions with \(\tilde {O}\left (1/{\varepsilon }^{2} \right )\) samples.Footnote 9 Taking \({\mathcal {C}}_{\text {Hard}}\) to be the single \({\operatorname {Bin}\!\left (n, 1/2 \right )}\) distribution (along with the testing lower bound of [53]), this yields the following:
Corollary 1.7
Testing the classes of Binomial and Poisson Binomial Distributions each require \({\Omega \left ({n^{1/4}}/{{\varepsilon }^{2}} \right )}\) samples, for any ε ≥ 1/n O(1).
Finally, we derive a lower bound on testing k-SIIRVs from the agnostic learner of [21] (which has sample complexity poly(k,1/ε), independent of n):
Corollary 1.8
There exist absolute constants c > 0and ε 0 > 0such that testing the class of k-SIIRV distributions requires \({\Omega }\left (k^{1/2}n^{1/4}/{\varepsilon }^{2} \right )\) samples, for any \(k={o\left (n^{c} \right )}\) and \({1}/{n^{O(1)}} \leq {\varepsilon } \leq {\varepsilon }_{0}\) .
Proof of Corollary 1.8
To prove this result, it is enough by Theorem 6.1 to exhibit a particular k-SIIRV S such that testing identity to S requires this many samples. Moreover, from [53] this last part amounts to proving that the (truncated) 2/3-norm \(\lVert S^{-\max }_{-{\varepsilon }}{\rVert }_{2/3}\) of S is \({\Omega \left (k^{1/2}n^{1/4} \right )}\) (for every ε ∈ (0,ε 0), for some small ε 0 > 0). Our hard instance S will be defined as follows: it is defined as the distribution of \(X_{1}+\dots +X_{n}\), where the X i ’s are independent integer random variables uniform on \(\{0,\dots ,k-1\}\) (in particular, for k = 2 we get a \({\operatorname {Bin}\!\left (n, 1/2 \right )}\) distribution). It is straightforward to verify that \(\mathbb {E}{S} = \frac {n(k-1)}{2}\) and \(\sigma ^{2}\overset {\text {def}}{=}\text {Var}~S = \frac {(k^{2}-1)n}{12} = {\Theta \left (k^{2} n \right )}\); moreover, S is log-concave (as the convolution of n uniform distributions). From this last point, we get that (i) the maximum probability of S, attained at its mode, is \({\lVert {S}{\rVert }}_{\infty }={\Theta \left (1/\sigma \right )}\); and (ii) for every j in an interval I of length 2σ centered at this mode, \(S(j) \geq {\Omega \left ({\lVert {S}{\rVert }}_{\infty } \right )}\) (see e.g. [29, Lemma 5.7] for the latter point). Define now ε 0 as an absolute constant such that \(2{\varepsilon }_{0} \leq {D}(I) = {\Omega \left (1 \right )}\).
We want to lower bound \(\lVert S^{-\max }_{-{\varepsilon }}{\rVert }_{2/3}\), for ε ≤ ε 0; as by the above the “\(-\max \)” part can only change the value by \({\lVert {{S}}{\rVert }}_{\infty }=o(1)\), we can ignore it. Turning to the − ε part, i.e. the removal of the ε probability mass of the elements with smallest probability, note that this can only result in zeroing out at most \(\frac {\varepsilon }{{D}(I)}\left \lvert {I} \right \rvert \leq \frac {1}{2}\left \lvert {I} \right \rvert \) elements in I (call these \(J_{\varepsilon }\subseteq I\)). From this, we obtain that
which concludes the proof. □
6.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:
Theorem 6.2
Let \({\mathcal {C}}\) be a class of distributions over [n]for which the following holds:
-
(i)
there exists a semi-agnostic learner \({\mathcal {L}}\) for \({\mathcal {C}}\), with sample complexity q L (n, ε, δ)and “agnostic constant” c;
-
(ii)
there exists a subclass \({\mathcal {C}}_{\text {Hard}}\subseteq {\mathcal {C}}\) such that tolerant testing \(\mathcal {C}_{\text {Hard}}\) requires q H (n, ε 1,ε 2)samples for some parameters ε 2 > (4c + 1)ε 1.
Suppose further that \(q_{L}(n,{\varepsilon }_{2}-{\varepsilon }_{1}, 1/10)={o\left (q_{H}(n,{\varepsilon }_{1},{\varepsilon }_{2}) \right )}\) . Then, any tolerant tester for \(\mathcal {C}\) must use \({\Omega \left ({q_{H}(n,\varepsilon _{1},\varepsilon _{2})} \right )}\) samples (for some explicit parameters \(\varepsilon ^{\prime }_{1},\varepsilon ^{\prime }_{2}\) ).
Proof
The argument follows the same ideas as for Theorem 6.1, up to the details of the parameters. Assuming \(\mathcal {C}\), \(\mathcal {C}_{\text {Hard}}\), \({\mathcal {L}}\) as above (with semi-agnostic constant c ≥ 1), and a tolerant tester \({\mathcal {T}}\) for \(\mathcal {C}\) with sample complexity q(n, ε 1,ε 2), we define a tolerant tester \({\mathcal {T}}_{\text {Hard}}\) for \(\mathcal {C}_{\text {Hard}}\). On input 0 < ε 1 < ε 2 ≤ 1 with ε 2 > (4c + 1)ε 1, and given sample access to a distribution D on [n], \({\mathcal {T}}_{\text {Hard}}\) acts as follows. After setting \(\varepsilon ^{\prime }_{1}\overset {\text {def}}{=}\frac {\varepsilon _{2}-\varepsilon _{1}}{4}\), \(\varepsilon ^{\prime }_{2}\overset {\text {def}}{=}\frac {\varepsilon _{2}-\varepsilon _{1}}{2}\), \(\varepsilon ^{\prime } \overset {\text {def}}{=} \frac {\varepsilon _{2}-\varepsilon _{1}}{16}\) and \(\tau \overset {\text {def}}{=} \frac {6\varepsilon _{2}+10\varepsilon _{1}}{16}\),
-
call \({\mathcal {T}}\) with parameters n, \(\frac {{\varepsilon }^{\prime }_{1}}{c}\), \(\frac {{\varepsilon }^{\prime }_{2}}{c}\) and failure probability 1/6, to tolerantly test if \(D\in \mathcal {C}\). If \(\ell _{1}({D},\mathcal {C}) > \varepsilon ^{\prime }_{2}/c\), reject.
-
otherwise, agnostically learn a hypothesis \(\hat {{D}}\) for D, with \({\mathcal {L}}\) called with parameters n, \(\varepsilon ^{\prime }\) and failure probability 1/6;
-
check offline if \(\hat {{D}}\) is τ-close to \({\mathcal {C}}_{\text {Hard}}\), accept if and only if this is the case.
We condition on both calls (to \({\mathcal {T}}\) and \({\mathcal {L}}\)) to be successful, which overall happens with probability at least 2/3 by a union bound. We first argue completeness: assume \(\ell _{1}({D},{\mathcal {C}}_{\text {Hard}}) \leq {\varepsilon }_{1}\). This implies \(\ell _{1}({D},{\mathcal {C}}) \leq {\varepsilon }_{1}\), so that \({\mathcal {T}}\) accepts as \({\varepsilon }_{1} \leq {\varepsilon }^{\prime }_{1}/c\) (which is the case because ε 2 > (4c + 1)ε 1). Thus, the hypothesis \(\hat {{D}}\) satisfies \({\lVert {\hat {{D}}-{D}}{\rVert }}_1 \leq c\cdot {\varepsilon }^{\prime }_{1}/c + {\varepsilon }^{\prime } = {\varepsilon }^{\prime }_{1} + {\varepsilon }^{\prime }\). Therefore, \(\ell _{1}(\hat {{D}},{\mathcal {C}}_{\text {Hard}}) \leq {\lVert {\hat {{D}}-{D}}{\rVert }}_1 + \ell _{1}({D},{\mathcal {C}}_{\text {Hard}}) \leq {\varepsilon }^{\prime }_{1} + {\varepsilon }^{\prime } + {\varepsilon }_{1} < \tau \), and \({\mathcal {T}}_{\text {Hard}}\) accepts.
For the soundness, we again proceed by contrapositive. Suppose \({\mathcal {T}}_{\text {Hard}}\) accepts; it means that each step was successful. In particular, \(\ell _{1}(\hat {{D}},{\mathcal {C}})\leq {{\varepsilon }^{\prime }_{2}}/{c}\); so that the hypothesis outputted by the agnostic learner satisfies \({\lVert {\hat {{D}}-{D}}{\rVert }}_1 \leq c\cdot {\textsc {opt}}+{\varepsilon }^{\prime }\leq {\varepsilon }^{\prime }_{2} + {\varepsilon }^{\prime }\). In turn, since the last step passed and by a triangle inequality we get, as claimed, \(\ell _{1}({D}, {\mathcal {C}}_{\text {Hard}}) \leq {\varepsilon }^{\prime }_{2} + {\varepsilon }^{\prime } + \ell _{1}(\hat {{D}},{\mathcal {C}}_{\text {Hard}}) \leq {\varepsilon }^{\prime }_{2} + {\varepsilon }^{\prime } + \tau < {\varepsilon }_{2}\).
Observing that the overall sample complexity is \(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. □
As before, we instantiate the general theorem to obtain specific lower bounds for tolerant testing of the classes we covered in this paper. That is, taking \({\mathcal {C}}_{\text {Hard}}\) to be the singleton consisting of the uniform distribution (combined with the tolerant testing lower bound of [50] (restated in Theorem D.3), which states that tolerant testing of uniformity over [n] requires \({\Omega \left (\frac {n}{\log n} \right )}\) samples), and again from the semi-agnostic learners of [15, 16] (each with sample complexity either poly(1/ε) or \(\text {poly}(\log n,1/{\varepsilon })\)), we obtain the following:
Corollary 1.11
Tolerant testing of log-concavity, convexity, concavity, MHR, unimodality, and t-modality can be performed with \(O\left (\frac {1}{(\varepsilon _{2}-\varepsilon _{1})^{2}}\frac {n}{\log n} \right )\) samples, for ε 2 ≥ C ε 1 (where C > 2is an absolute constant).
Similarly, we again turn to the class of Poisson Binomial Distributions, for which we can invoke as before the \(\tilde {O}\left (1/{\varepsilon }^{2} \right )\)-sample agnostic learner of [23]. As before, we would like to choose for \({\mathcal {C}}_{\text {Hard}}\) the single \({\operatorname {Bin}\!\left (n, 1/2 \right )}\) distribution; however, as no tolerant testing lower bound for this distribution exists—to the best of our knowledge—in the literature, we first need to establish the lower bound we will rely upon:
Theorem 6.3
There exists an absolute constant ε 0 > 0such that the following holds. Any algorithm which, given sampling access to an unknown distribution D on Ωand parameter ε ∈ (0, ε 0), distinguishes with probability at least 2/3between (i) \({\lVert {{D}-{\operatorname {Bin}\!\left (n, 1/2 \right )}}{\rVert }}_1 \leq {\varepsilon }\) and (ii) \({\lVert {{D}-{\operatorname {Bin}\!\left (n, 1/2 \right )}}{\rVert }}_1 \geq 100{\varepsilon }\) must use \({\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 [50]; 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:
Corollary 1.12
Tolerant testing of the classes of Binomial and Poisson Binomial Distributions can be performed with \(O\left (\frac {1}{(\varepsilon _{2}-\varepsilon _{1})^{2}}\frac {\sqrt {n\log ({1}/{\varepsilon _{1}})}}{\log n} \right )\) samples, for ε 2 ≥ C ε 1 (where C > 2is an absolute constant).
We observe that both Corollary 1.11 and Corollary 1.12 are tight (with regard to the dependence on n), as proven in the next section (Section 7).
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:
Theorem 7.1
Let \({\mathcal {C}}\) be a class of distributions over [n]for which the following holds:
-
(i)
there exists a semi-agnostic learner \({\mathcal {L}}\) for \({\mathcal {C}}\), with sample complexity q L (n, ε, δ)and “agnostic constant” c;
-
(ii)
for any η ∈ [0, 1], every distribution in \({\mathcal {C}}\) has η -effective support of size at most M(n, η).
Then, there exists an algorithm that, for any fixed κ > 1and on input ε 1,ε 2 ∈ (0, 1)such that ε 2 ≥ C ε 1 , has the following guarantee (where C > 2depends on c and κ only). The algorithm takes \({O\left ({\frac {1}{(\varepsilon _{2}-\varepsilon _{1})^{2}}\frac {m}{\log m}} \right )} + q_{L}(n,\frac {\varepsilon _{2}-\varepsilon _{1}}{\kappa }, \frac {1}{10})\) samples (where m = M(n, ε 1)), and with probability at least 2/3distinguishes between (a) \(\ell _{1}({D},\mathcal {C}) \leq \varepsilon _{1}\) and (b) \(\ell _{1}({D},\mathcal {C}) >~\varepsilon _{2}\) . (Moreover, one can take \(C=(1+(5c+6)\frac {\kappa }{\kappa -1})\) .)
Corollary 1.9
Tolerant testing of log-concavity, convexity, concavity, MHR, unimodality, and t-modality can be performed with \(O\left (\frac {1}{(\varepsilon _{2}-\varepsilon _{1})^{2}}\frac {n}{\log n} \right )\) samples, for ε 2 ≥ C ε 1 (where C > 2is an absolute constant).
Applying now the theorem with \(M(n,{\varepsilon })=\sqrt {n\log (1/{\varepsilon })}\) (as per Corollary 5.5), we obtain an improved upper bound for Binomial and Poisson Binomial distributions:
Corollary 1.10
Tolerant testing of the classes of Binomial and Poisson Binomial Distributions can be performed with \(O\left (\frac {1}{(\varepsilon _{2}-\varepsilon _{1})^{2}}\frac {\sqrt {n\log ({1}/{\varepsilon _{1}})}}{\log n} \right )\) samples, for ε 2 ≥ C ε 1 (where C > 2is an absolute constant).
High-Level Idea
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 D to the class \(\mathcal {C}\) to that of tolerant testing identity to a known distribution—namely, the distribution \(\hat {{D}}\) obtained after trying to agnostically learn D. Intuitively, an agnostic learner for \(\mathcal {C}\) should result in a good enough hypothesis \(\hat {{D}}\) (i.e., \(\hat {{D}}\) close enough to both D and \(\mathcal {C}\)) when D is ε 1-close to \(\mathcal {C}\); but output a \(\hat {{D}}\) that is significantly far from either D or \(\mathcal {C}\) when D is ε 2-far from \(\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 [52], whose (tight) sample complexity scales as \(n/\log n\) for a domain of size n. In order to get the right dependence on the effective support (required in particular for Corollary 1.10), 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, κ) in the statement of the theorem.)
7.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 m). This is ensured by an algorithm of Valiant and Valiant, restated below:
Theorem 7.2 ([52, Theorem 3 and 4])
There exists an algorithm \(\mathcal {E}\) which, given sampling access to two unknown distributions D 1,D 2 over [m], satisfies the following. On input ε ∈ (0, 1], it takes \(O(\frac {1}{{\varepsilon }^{2}}\frac {m}{\log m} )\) samples from D 1 and D 2, and outputs a value Δsuch that \(\lvert {\lVert {{D}_{1}-{D}_{2}}{\rVert }}_1-{\Delta } \rvert \leq {\varepsilon }\) with probability 1 − 1/poly(m).(Furthermore, \(\mathcal {E}\) runs in time poly(m).)
For the proof, we will also need this fact, similar to Lemma 5.3, which relates the distance of two distributions to that of their conditional distributions on a subset of the domain:
Fact 7.3
Let D and P be distributions over [n], and \(I\subseteq [n]\) an interval such that D(I) ≥ 1 − α and P(I) ≥ 1 − β.Then,
-
\({\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 \(\alpha \leq \frac {1}{2}\) ); and
-
\({\lVert {{D}_{I} - P_{I}}{\rVert }}_1 \geq \frac {}{}{\lVert {{D} - P}{\rVert }}_1 - 2(\alpha +\beta )\) .
Proof
To establish the first item, write:
where we used the fact that \(\left \lvert P(I)- {D}(I) \right \rvert \leq {\operatorname {d_{\text {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:
Proof of Theorem 7.1
The algorithm proceeds as follows, where we set \({\varepsilon }\overset {\text {def}}{=}\frac {{\varepsilon }_{2}-{\varepsilon }_{1}}{17\kappa }\), \(\theta \overset {\text {def}}{=}{\varepsilon }_{2} - ((6+c)\varepsilon _{1}+11\varepsilon )\), and \(\tau \overset {\text {def}}{=}2 \frac {(3+c)\varepsilon _{1}+5\varepsilon }{2}\):
-
(1)
using \(O(\frac {1}{{\varepsilon }^{2}})\) samples, get (with probability at least 1 − 1/10, by Theorem 2.11) a distribution \(\tilde {{D}}\) \(\frac {\varepsilon }{2}\)-close to D in Kolmogorov distance; and let \(I\subseteq [n]\) be the smallest interval such that \(\tilde {{D}}(I) > 1-\frac {3}{2}\varepsilon _{1}-\varepsilon \). Output reject if \(\left \lvert {I} \right \rvert > M(n,\varepsilon _{1})\).
-
(2)
invoke \({\mathcal {L}}\) on D with parameters ε and failure probability \(\frac {1}{10}\), to obtain a hypothesis \(\hat {{D}}\);
-
(3)
call \(\mathcal {E}\) (from Theorem 7.2) on D I , \(\hat {{D}}_{I}\) with parameter \(\frac {\varepsilon }{6}\) to get an estimate \(\hat {\Delta }\) of \(\|{{D}_{I}-\hat {{D}}_{I}}\|_{1}\);
-
(4)
output reject if \(\hat {{D}}(I) < 1-\tau \);
-
(5)
compute “offline” (an estimate accurate within ε of) \(\ell _{1}(\hat {{D}},\mathcal {C})\), denoted Δ;
-
(6)
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}-\hat {{D}}}\|_{1} \leq c\cdot {\textsc {opt}}+\varepsilon \) and \(\|{{D}-\hat {{D}}}\|_{1} \in [\hat {\Delta } - \varepsilon ,\hat {\Delta } + \varepsilon ]\)), which happens with probability at least 8/10 − 1/poly(n) ≥ 3/4 by a union bound.
Completeness
If \(\ell _{1}({D},{\mathcal {C}}) \leq {\varepsilon }_{1}\), then D is ε 1-close to some \(P\in {\mathcal {C}}\), for which there exists an interval \(J\subseteq [n]\) of size at most M(n, ε 1) such that P(J) ≥ 1 − ε 1. It follows that \(D(J) \geq 1-\frac {3}{2}\varepsilon _{1}\) (since \(\left \lvert {{D}(J)-P(J)} \right \rvert \leq \frac {\varepsilon _{1}}{2}\)) and \(\tilde {{D}}(J) \geq 1-\frac {3}{2}\varepsilon _{1}-2\cdot \frac {\varepsilon }{2}\varepsilon \); establishing existence of a good interval I to be found (and Step (1) does not end with reject). Additionally, \(\|{{D}-\hat {{D}}}\|_{1} \leq c\cdot \varepsilon _{1}+\varepsilon \) and by the triangle inequality this implies \(\ell _{1}(\hat {{D}},\mathcal {C}) \leq (1+c)\varepsilon _{1}+\varepsilon \).
Moreover, as \(D(I) \geq \tilde {{D}}(I) - 2\cdot \frac {{\varepsilon }}{2} \geq 1-\frac {3}{2}{\varepsilon }_{1}-2{\varepsilon }\) and \(\left \lvert \hat {{D}}(I) - {D}(I) \right \rvert \leq \frac {1}{2}{\lVert {{D}-\hat {{D}}}{\rVert }}_1\), we do have
and the algorithm does not reject in Step (4). To conclude, one has by Fact 7.3 that
Therefore, \({\Delta }+\hat {\Delta } \leq \ell _{1}(\hat {{D}},{\mathcal {C}})+{\varepsilon } + {\lVert {{D}_{I}-\hat {{D}}_{I}}{\rVert }}_1+{\varepsilon } \leq (4c+1){\varepsilon }_{1}+6{\varepsilon } \leq {\varepsilon }_{2} - ((6+c){\varepsilon }_{1}+11{\varepsilon }) = \theta \)(the last inequality by the assumption on ε 2,ε 1), and the tester accepts.
Soundness
If \(\ell _{1}({D},{\mathcal {C}}) > {\varepsilon }_{2}\), then we must have \({\lVert {{D}-\hat {{D}}}{\rVert }}_1 + \ell _{1}(\hat {{D}},\mathcal {C}) > \varepsilon _{2}\). If the algorithm does not already reject in Step (4), then \(\hat {{D}}(I) \geq 1-\tau \). But, by Fact 7.3,
we then have \({\lVert {{D}_{I}-\hat {{D}}_{I}}{\rVert }}_1 + \ell _{1}(\hat {{D}},{\mathcal {C}}) > {\varepsilon }_{2} - ((6+c){\varepsilon }_{1}+9{\varepsilon })\). This implies \({\Delta }+\hat {\Delta } > {\varepsilon }_{2} - ((6+c){\varepsilon }_{1}+9{\varepsilon }) -2{\varepsilon } = {\varepsilon }_{2} - ((6+c){\varepsilon }_{1}+11{\varepsilon }) = \theta \), and the tester rejects. 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. □
Notes
Recall that the identity testing problem asks, given the explicit description of a distribution D ∗ and sample access to an unknown distribution D, to decide whether D is equal to D ∗ or far from it; while in closeness testing both distributions to compare are unknown.
For the sample complexity of testing monotonicity, [12] originally states an \(\tilde {O}\left ({\sqrt {n}}/{{\varepsilon }^{4}} \right )\) upper bound, but the proof seems to only result in an \(\tilde {O}\left ({\sqrt {n}}/{{\varepsilon }^{6}} \right )\) bound. Regarding the class of PBDs, [2] obtain an \({n^{1/4}}\cdot \tilde {O}\left ({1/{\varepsilon }^{2}}\right ) + \tilde {O}\left ({1/{\varepsilon }^{6}}\right )\) sample complexity, to be compared with our \(\tilde {O}\left ({n^{1/4}/{\varepsilon }^{7/2}}\right ) + {O\left (\log ^{4} n/{\varepsilon }^{4} \right )}\) upper bound; as well as an \({\Omega }\left ({n^{1/4}/{\varepsilon }^{2}}\right )\) lower bound.
As a simple example, consider the class \(\mathcal {C}\) of all distributions, for which testing membership is trivial.
Tolerant testing of a property \(\mathcal {P}\) is defined as follows: given 0 ≤ ε 1 < ε 2 ≤ 1, one must distinguish between (a) \(\ell _{1}({D},{\mathcal {P}}) \leq {\varepsilon }_{1}\) and (b) \(\ell _{1}({D},{\mathcal {P}}) \geq {\varepsilon }_{2}\). This turns out to be, in general, a much harder task than that of “regular” testing (where we take ε 1 = 0).
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, 3-modal).
In more detail, we want to argue that if D is in the class, then a decomposition with at most L pieces is found by the algorithm. Since there is a dyadic decomposition with at most L pieces (namely, \(\mathcal {I}(\gamma ,\gamma ,{D})=(I_{1},\dots ,I_{t})\)), it suffices to argue that the algorithm will never split one of the I j ’s (as every single I j will eventually be considered by the recursive binary splitting, unless the algorithm stopped recursing in this “path” before even considering I j , which is even better). But this is the case by the above argument, which ensures each such I j will be recognized as satisfying one of the two conditions for “good decomposition” (being either close to uniform in ℓ 2 distance, or having very little mass).
Indeed, it is not hard to show that a monotone distribution can only be ε-far from uniform if it puts probability weight \(1/2+{\Omega \left ({\varepsilon } \right )}\) on the first half of the domain. Estimating this probability weight to an additive O(ε) is thus sufficient to conclude.
Specifically, these lower bounds hold as long as \({\varepsilon }={\Omega \left (1/n^{\alpha } \right )}\) for some absolute constant α > 0 (so that the sample complexity of the agnostic learner is indeed negligible in front of \(\sqrt {n}/{\varepsilon }^{2}\)).
Note the quasi-quadratic dependence on ε of the learner, which allows us to get ε into our lower bound for \(n\gg \text {poly}\log (1/{\varepsilon })\).
For any sequence \(x=(x_{1},\dots ,x_{n})\in {\mathbb {R}}^{n}\), \(p > 0 \mapsto \lVert x{\rVert }_{p}\) is non-increasing. In particular, for \(0 < p \leq q <\infty \),
$$\left( \sum\limits_{i} \left\lvert x_{i} \right\rvert^{q}\right)^{1/q} = \lVert x{\rVert}_{q} \leq \lVert x{\rVert}_{p} = \left( \sum\limits_{i} \left\lvert x_{i} \right\rvert^{p}\right)^{1/p}\;. $$To see why, one can easily prove that if \(\lVert x{\rVert }_{p} = 1\), then \(\lVert x{\rVert }_{q}^{q} \leq 1\) (bounding each term \(\left \lvert {x_{i}} \right \rvert ^{q} \leq \left \lvert {x_{i}} \right \rvert ^{p}\)), and therefore \(\lVert {x}{\rVert }_{q} \leq 1 = \lVert {x}{\rVert }_{p}\). Next, for the general case, apply this to \(y = x/\lVert {x}{\rVert }_{p}\), which has unit ℓ p norm, and conclude by homogeneity of the norm.
Namely, for ε ∈ (0,ε 0), define the mixture \(D_{{\varepsilon }} \overset {\text {def}}{=} \frac {{\varepsilon }}{{\varepsilon }_{0}}{D}+(1-\frac {{\varepsilon }}{{\varepsilon }_{0}}){\operatorname {Bin}\!\left (n, 1/2 \right )}\). Being able to distinguish \({\lVert {{D}_{{\varepsilon }}-{\operatorname {Bin}\!\left (n, 1/2 \right )}}{\rVert }}_1 \leq {\varepsilon }\) from \({\lVert {{D}_{{\varepsilon }}-{\operatorname {Bin}\!\left (n, 1/2 \right )}}{\rVert }}_1 \geq 100{\varepsilon }\) in q samples then allows one to distinguish \({\lVert {{D}-{\operatorname {Bin}\!\left (n, 1/2 \right )}}{\rVert }}_1 \leq {\varepsilon }_{0}\) from \({\lVert {{D}-{\operatorname {Bin}\!\left (n, 1/2 \right )}}{\rVert }}_1 \geq 100{\varepsilon }_{0}\) in O(ε ⋅ q) samples.
References
Alon, N., Andoni, A., Kaufman, T., Matulef, K., Rubinfeld, R., Xie, N.: Testing k-wise and almost k-wise independence. In: Proceedings of the 39th ACM Symposium on Theory of Computing, STOC 2007, San Diego, California, USA, June 11–13, 2007, pp. 496–505. New York (2007)
Acharya, J., Daskalakis, C.: Testing Poisson binomial distributions. In: Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, San Diego, CA, USA, January 4–6, 2015, pp. 1829–1840 (2015)
Acharya, J., Daskalakis, C., Kamath, G.C.: Optimal testing for properties of distributions. In: Cortes, C., Lawrence, N.D., Lee, D.D., Sugiyama, M. Garnett, R., Garnett, R. (eds.) Advances in Neural Information Processing Systems 28, pp. 3577–3598. Curran Associates, Inc. (2015)
Acharya, J., Diakonikolas, I., Li, J.Z., Schmidt, L.: Sample-optimal density estimation in nearly-linear time. CoRR, arXiv:1506.00671 (2015)
Arora, S., Khot, S.: Fitting algebraic curves to noisy data. J. Comput. Syst. Sci. 67(2), 325–340 (2003). Special Issue on STOC 2002
An, M.Y.: Log-concave probability distributions: theory and statistical testing. Technical report, Centre for Labour Market and Social Research, Denmark (1996)
Bagnoli, M., Bergstrom, T.: Log-concave probability and its applications. Econ. Theory 26(2), 445–469 (2005)
Barlow, R.E., Bartholomew, D.J., Bremner, J.M., Brunk, H.D.: Statistical inference under order restrictions: the theory and application of isotonic regression. Wiley Series in Probability and Mathematical Statistics. Wiley, London, New York (1972)
Batu, T., Dasgupta, S., Kumar, R., Rubinfeld, R.: The complexity of approximating the entropy. SIAM J. Comput. 35(1), 132–150 (2005)
Batu, T., Fischer, E., Fortnow, L., Kumar, R., Rubinfeld, R., White, P.: Testing random variables for independence and identity. In: 42nd Annual IEEE Symposium on Foundations of Computer Science, FOCS 2001, Las Vegas, Nevada, USA, October 14–17 2001, pp. 442–451 (2001)
Batu, T., Fortnow, L., Rubinfeld, R., Smith, W.D., White, P.: Testing that distributions are close. In: 41st Annual IEEE Symposium on Foundations of Computer Science, FOCS 2000, Redondo Beach, California, USA, November 12–14 2000, pp. 259–269 (2000)
Batu, T., Kumar, R., Rubinfeld, R.: Sublinear algorithms for testing monotone and unimodal distributions. In: Proceedings of the 36th ACM Symposium on Theory of Computing, STOC 2004, Chicago, IL, June 13–16, 2004, pp. 381–390. ACM, New York (2004)
Canonne, C.L.: A survey on distribution testing: your data is big. But is it blue? Electronic Colloquium on Computational Complexity (ECCC) 22, 63 (2015)
Canonne, C.L.: Are few bins enough: testing histogram distributions. In: Proceedings of PODS. Association for Computing Machinery (ACM) (2016)
Chan, S., Diakonikolas, I., Servedio, R.A., Sun, X.: Learning mixtures of structured distributions over discrete domains. In: Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2013, New Orleans, Louisiana, USA, January 6–8, 2013, pp. 1380–1394 (2013)
Chan, S., Diakonikolas, I., Servedio, R.A., Sun, X.: Efficient density estimation via piecewise polynomial approximation. In: Proceedings of the 45th ACM Symposium on Theory of Computing, STOC 2014, New York, NY, USA, May 31–June 03, 2014, pp. 604–613. ACM (2014)
Chan, S., Diakonikolas, I., Servedio, R.A., Sun, X.: Near-optimal density estimation in near-linear time using variable-width histograms. In: Annual Conference on Neural Information Processing Systems (NIPS), pp. 1844–1852 (2014)
Chan, S., Diakonikolas, I., Valiant, G., Valiant, P.: Optimal algorithms for testing closeness of discrete distributions. In: Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, Portland, Oregon, USA, January 5–7, 2014, pp. 1193–1203 (2014)
Chakraborty, S., Fischer, E., Goldhirsh, Y., Matsliah, A.: On the power of conditional samples in distribution testing. In: Proceedings of ITCS, pages 561–580, New York, NY, USA. ACM (2013)
Canonne, C.L., Ron, D., Servedio, R.A.: Testing probability distributions using conditional samples. SIAM J. Comput. (SICOMP) 44(3), 540–616 (2015)
Daskalakis, C., Diakonikolas, I., O’Donnell, R., Servedio, R.A., Tan, L.-Y.: Learning sums of independent integer random variables. In: 54th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2013, Berkeley, CA, USA, October 26–29, 2013, pp. 217–226. IEEE Computer Society (2013)
Daskalakis, C., Diakonikolas, I., Servedio, r.A.: Learning k-modal distributions via testing. In: Proceedings of the Twenty-Third Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2012, Kyoto, Japan, January 17–19, 2012, pp. 1371–1385. Society for Industrial and Applied Mathematics (SIAM) (2012)
Daskalakis, C., Diakonikolas, I., Servedio, R.A.: Learning Poisson binomial distributions. In: Proceedings of the 44th ACM Symposium on Theory of Computing, STOC 2012 Conference, New York, NY, USA, May 19–22, 2012, STOC ’12, New York, NY, pp. 709–728. ACM (2012)
Daskalakis, C., Diakonikolas, I., Servedio, r.A., Valiant, G., Valiant, P.: Testing k-modal distributions: Optimal algorithms via reductions. In: Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2013, New Orleans, Louisiana, USA, January 6–8, 2013, pp. 1833–1852. Society for Industrial and Applied Mathematics (SIAM) (2013)
Diakonikolas, I.: Learning structured distributions. In: Handbook of Big Data. CRC Press (2016)
Diakonikolas, I., Kane, D.M.: A New Approach for Testing Properties of discrete distributions. IEEE Computer Society (2016)
Diakonikolas, I., Kane, D.M., Nikishkin, V.: Optimal algorithms and lower bounds for testing closeness of structured distributions. In: 56th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2016 (2015)
Diakonikolas, I., Kane, D.M., Nikishkin, V.: Testing identity of structured distributions. In: Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, San Diego, CA, USA, January 4–6, 2015 (2015)
Diakonikolas, I., Kane, D.M., Stewart, A.: Nearly optimal learning and sparse covers for sums of independent integer random variables. CoRR, arXiv:1505.00662 (2015)
Diakonikolas, I., Kane, D.M., Stewart, A.: Efficient robust proper learning of log-concave distributions. CoRR, arXiv:1606.03077 (2016)
Diakonikolas, I., Kane, D.M., Stewart, A.: Optimal learning via the fourier transform for sums of independent integer random variables. In: COLT, volume 49 of JMLR Workshop and Conference Proceedings, pp. 831–849. JMLR.org, 2016. Full version in [29]
Dvoretzky, A., Kiefer, J., Wolfowitz, J.: Asymptotic minimax character of the sample distribution function and of the classical multinomial estimator. Ann. Math. Stat. 27(3), 642–669 (1956)
Fischer, E., Lachish, O., Vasudev, Y.: Improving and extending the testing of distributions for shape-restricted properties. arXiv:1609.06736 (2016)
Guha, S., McGregor, A., Venkatasubramanian, S.: Streaming and sublinear approximation of entropy and information distances. In: Proceedings of the Seventeenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2006, Miami, Florida, USA, January 22–26, 2006, pp. 733–742. Society for Industrial and Applied Mathematics (SIAM), Philadelphia (2006)
Goldreich, O., Ron, D.: On testing expansion in bounded-degree graphs. Technical Report TR00-020. In: Electronic Colloquium on Computational Complexity (ECCC) (2000)
Hougaard, P.: Survival models for heterogeneous populations derived from stable distributions. Biometrika 73, 397–96 (1986)
Indyk, P., Levi, R., Rubinfeld, R.: Approximating and testing k-histogram distributions in sub-linear time. In: Proceedings of PODS, pp. 15–22 (2012)
Keilson, J., Gerber, H.: Some results for discrete unimodality. J. Am. Stat. Assoc. 66(334), 386–389 (1971)
Mandelbrot, B.: New methods in statistical economics. J. Polit. Econ. 71(5), 421–440 (1963)
Massart, P.: The tight constant in the Dvoretzky–Kiefer–Wolfowitz inequality. Ann. Probab. 18(3), 1269–1283 (1990)
Massart, P., Picard, J.: Concentration inequalities and model selection. Lecture Notes in Mathematics, 33, 2003, Saint-Flour, Cantal. Springer (2007)
Paninski, L.: A coincidence-based test for uniformity given very sparsely sampled discrete data. IEEE Trans. Inf. Theory 54(10), 4750–4755 (2008)
Ron, D.: Property testing: a learning theory perspective. Found. Trends Mach. Learn. 1(3), 307–402 (2008)
Ron, D.: Algorithmic and analysis techniques in property testing. Found. Trends Theor. Comput. Sci. 5, 73–205 (2010)
Rubinfeld, R.: Taming big probability distributions. XRDS 19(1), 24–28 (2012)
Sengupta, D., Nanda, A.K.: Log-concave and concave distributions in reliability. Nav. Res. Logist. (NRL) 46(4), 419–433 (1999)
Silvapulle, M.J., Sen, P.K.: Constrained Statistical Inference. Wiley, New York (2001)
Tsallis, C., Levy, S.V.F, Souza, A.M.C., Maynard, R.: Statistical-mechanical foundation of the ubiquity of Lévy distributions in nature. Phys. Rev. Lett. 75, 3589–3593 (1995)
Valiant, P.: Testing symmetric properties of distributions. SIAM J. Comput. 40(6), 1927–1968 (2011)
Valiant, G., Valiant, P.: A CLT and tight lower bounds for estimating entropy. Electron. Colloq. Comput. Complex. (ECCC) 17, 179 (2010)
Valiant, G., Valiant, P.: Estimating the unseen: an \(n/\log n\)-sample estimator for entropy and support size, shown optimal via new clts. In: Proceedings of the 43rd ACM Symposium on Theory of Computing, STOC 2011, San Jose, CA, USA, 6–8 June 2011, pp. 685–694 (2011)
Valiant, G., Valiant, P.: The power of linear estimators. In: 52nd Annual IEEE Symposium on Foundations of Computer Science, FOCS 2011, Palm Springs, CA, USA, October 22–25, 2011, pp. 403–412 (2011)
Valiant, G., Valiant, P.: An automatic inequality prover and instance optimal identity testing. In: 55th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2014, Philadelphia, PA, USA, October 18–21, 2014 (2014)
Walther, G.: Inference and modeling with log-concave distributions. Stat. Sci. 24(3), 319–327 (2009)
Acknowledgements
Clément L. Canonne’s research was supported by NSF CCF-1115703 and NSF CCF-1319788. Ilias Diakonikolas was supported by NSF Award CCF-1652862 (CAREER) and a Sloan Research Fellowship. This work was performed in part while visiting CSAIL, MIT. Ronitt Rubinfeld was supported by NSF grants CCF-1420692 and CCF-1650733, and Israel Science Foundation (ISF) grant 1536/14.
Themis Gouleakis was supported by NSF grants CCF-1420692 and CCF-1650733.
Author information
Authors and Affiliations
Corresponding author
Additional information
This article is part of the Topical Collection on Theoretical Aspects of Computer Science
Appendices
Appendix A: Proof of Lemma 2.10
We now give the proof of Lemma 2.10, restated below:
Lemma 2.10 (Adapted from [28, Theorem 11])
There exists an algorithm Check-Small-ℓ 2 which, given parameters ε, δ ∈ (0, 1)and \(c\cdot {\sqrt {\left \lvert {I} \right \rvert }}/{\varepsilon ^{2}} \log (1/\delta )\) independent samples from a distribution D over I (for some absolute constant c > 0), outputs either yes or no , and satisfies the following.
-
If \({\lVert {{D}-{\mathcal {U}}_{I}}{\rVert }}_2 > {{\varepsilon }}/{\sqrt {\left \lvert I \right \rvert }}\), then the algorithm outputs no with probability at least 1 − δ;
-
If \({\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 − δ.
Proof
We first describe an algorithm that distinguishes between\({\lVert {{D}-{\mathcal {U}}}{\rVert }}_2^{2} \geq {\varepsilon }^{2}/{n}\)and \({\lVert {{{D}-{\mathcal {U}}}}{\rVert }}_2^{2} < \varepsilon ^{2}/(2n)\)with probability at least 2/3,using \(C\cdot \frac {\sqrt {n}}{\varepsilon ^{2}}\)samples. Boosting the success probability to 1 − δ at the price of a multiplicative \(\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\(\tau \overset {\text {def}}{=} \frac {3}{4}\frac {m^{2}\varepsilon ^{2}}{n}\)instead of\(\frac {4m}{\sqrt {n}}\)), define thequantities
and\(Z\overset {\text {def}}{=}{\sum }_{k=1}^{n} Z_{k}\), where the X k ’s (and thus the Z k ’s) are independent byPoissonization, and \(X_{k}\sim {\text {Poisson}\!\left ({m {D}(k)} \right ) }\). Itis not hard to see that \(\mathbb {E} Z_{k} = {{\Delta }_{k}^{2}}\),where \({\Delta }_{k}\overset {\text {def}}{=} (\frac {1}{n}-{D}(k))\), so that\(\mathbb {E} Z = m^{2}{\lVert {{{D}-{\mathcal {U}}}}{\rVert }}_2^{2}\). Furthermore, we alsoget
sothat
(after expanding and since \({\sum }_{k=1}^{n} {\Delta }_{k} = 0\)).
Soundness
Almost straight from [ 28 ], but the threshold has changed. Assume \({\Delta }^{2}\overset {\text {def}}{=}{\lVert {{D}-{\mathcal {U}}}{\rVert }}_2^{2} \geq {\varepsilon }^{2}/n\); we will show that \(\Pr \!\left [\, Z < \tau \, \right ] \leq 1/3\). By Chebyshev’s inequality, it is sufficient to show that \(\tau \leq \mathbb {E} Z - \sqrt {3}\sqrt {\text {Var}~Z}\), as
As \(\tau < \frac {3}{4}\mathbb {E} Z\), arguing that \(\sqrt {3}\sqrt {\text {Var}~Z} \leq \frac {1}{4}\mathbb {E} Z\) is enough, i.e. that \(48~\text {Var}~Z \leq (\mathbb {E} Z)^{2}\). From (2), this is equivalent to showing
We bound the LHS term by term.
-
As \({\Delta }^{2} \geq \frac {{\varepsilon }^{2}}{n}\), we get \(m^{2}{\Delta }^{2} \geq \frac {C^{2}}{{\varepsilon }^{2}}\), and thus \(\frac {m^{2}{\Delta }^{4}}{288} \geq \frac {C^{2}}{288\varepsilon ^{2}}{\Delta }^{2} \geq {\Delta }^{2}\) (as C ≥ 17 and ε ≤ 1).
-
Similarly, \(\frac {m^{2}{\Delta }^{4}}{288} \geq \frac {C^{2}}{288{\varepsilon }^{2}}\cdot \frac {{\varepsilon }^{2}}{n} \geq \frac {1}{n}\).
-
Finally, recalling thatFootnote 10
$$\sum\limits_{k=1}^{n} \left\lvert {\Delta}_{k} \right\rvert^{3} \leq \left( \sum\limits_{k=1}^{n} \left\lvert {\Delta}_{k} \right\rvert^{2} \right)^{3/2} = {\Delta}^{3} $$we get that \(\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 \(\frac {m{\Delta }}{2\cdot 288} \geq \frac {C}{576{\varepsilon }} \geq 1\) (by choice of C ≥ 576).
Overall, the LHS is at most \(3\cdot \frac {m^{2} {\Delta }^{4}}{288} = \frac {m^{2} {\Delta }^{4}}{96}\), as claimed.
Completeness
Assume \({\Delta }^{2}={\lVert {{D}-{\mathcal {U}}}{\rVert }}_2^{2} < {\varepsilon }^{2}/(4n)\). We need to show that \(\Pr \!\left [\, { Z \geq \tau }\, \right ] \leq 1/3\). Chebyshev’s inequality implies
and therefore it is sufficient to show that
Recalling the expressions of \(\mathbb {E} Z\) and Var Z from (2), this is tantamount to showing
or equivalently
Since \(\sqrt {1 + n{\Delta }^{2} -2 n m {\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 \(\sqrt {30/4} < 3\). All that remains is to show that \(m\sqrt {n}{\Delta }^{2} \geq 3m\frac {\varepsilon ^{2}}{4\sqrt {n}}-3\). But as Δ2 < ε 2/(4n), \(m\sqrt {n}{\Delta }^{2} \leq m\frac {\varepsilon ^{2}}{4\sqrt {n}}\); and our choice of \(m \geq C\cdot \frac {\sqrt {n}}{\varepsilon ^{2}}\) for some absolute constant C ≥ 6 ensures this holds. □
Appendix B: Proof of Theorem 4.5
In this section, we prove our structural result for MHR distributions, Theorem 4.5:
Theorem 4.5 (Monotone Hazard Rate)
For all γ, ζ > 0, the class \({\mathcal {MHR}}\) of MHR distributions on [n]is (γ, ζ, L)-decomposable for \(L \overset {\text {def}}{=} {O\left ({\frac {\log \frac {n}{\zeta }}{\gamma }} \right )}\) .
Proof
We reproduce and adapt the argument of [15, Section 5.1] to meetour definition of decomposability (which, albeit related, is incomparable to theirs). First,we modify the algorithm at the core of their constructive proof, in Algorithm 4: notethat the only two changes are in Steps 2 and 3, where we use parameters respectively\(\frac {\zeta }{n}\)and \(\frac {\zeta }{n^{2}}\).
Following the structure of their proof, we write\(\mathcal {Q}=\{I_{1},\dots ,I_{\left \lvert \mathcal {Q} \right \rvert }\}\)with I i = [a i ,b i ],and define \(\mathcal {Q}^{\prime }= \left \{ { I_{i}\in \mathcal {Q} } \;\colon \; { {D}(a_{i}) > {D}(a_{i+1})} \right \} \),\(\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:
Lemma B.1
We have \({\prod }_{I_{i}\in \mathcal {Q}^{\prime }} \frac {{D}(a_{i})}{{D}(a_{i+1})} \leq \frac {n}{\zeta }\) .
Lemma B.2
Step 4 of Algorithm 4 adds at most \({O\left (\frac {1}{\gamma }\log \frac {n}{\zeta } \right )}\) intervals to \(\mathcal {Q}\) .
Proof Sketch
This derives from observing that now \(D(I\cup I^{\prime }) \geq \zeta /n\),which as in [15, Lemma 5.3] in turnimplies
so that\(\left \lvert \mathcal {Q}^{\prime } \right \rvert = {O\left (\frac {1}{\gamma }\log \frac {n}{\zeta } \right )}\).
Again following their argument, we also get
by combining LemmaB.1 with the fact that \(D(a_{\left \lvert \mathcal {Q} \right \rvert +1} \leq 1\)andthat by construction D(a i ) ≥ ζ/n 2, weget
But since each term inthe product is at least (1 + γ)(byconstruction of \(\mathcal {Q}\)and thedefinition of \(\mathcal {Q}^{\prime \prime }\)), this leadsto
andthus \(\left \lvert \mathcal {Q}^{\prime \prime } \right \rvert = {O\left (\frac {1}{\gamma }\log \frac {n}{\zeta } \right )}\)aswell. □
It remains to show that \(\mathcal {Q}\cup \{I,I^{\prime },I^{\prime \prime }\}\) is indeed a good decomposition of [n] for D, as per Definition 3.1. Since by construction every interval in \(\mathcal {Q}\) satisfies item (ii), we only are left with the case of I, \(I^{\prime }\) and \(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 \(\frac {\zeta }{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^{\prime \prime }) \leq n\cdot \zeta /n^{2} = \zeta /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 t-piecewise degree-d (Theorem 4.13), monotone hazard rate (Lemma 4.14), and log-concave distributions (Lemma 4.15).
1.1 C.1 Proof of Theorem 4.13
In this section, we prove the following:
Theorem C.1 (Theorem 4.13, restated)
Let p be an ℓ -histogram over [−1, 1).There is an algorithm ProjectSinglePoly(d, ε)which runs in time poly(ℓ, d + 1, 1/ε), and outputs a degree- D polynomial q which defines a pdf over [−1, 1)such that \({\lVert {p-q}{\rVert }}_1 \leq 3 \ell _{1}(p,{\mathcal {P}_{d}}) + O({\varepsilon })\) .
As mentioned in Section 4, the proof of this statement is a rather straightforward adaptation of the proof of [16, Theorem 9], with two differences: first, in our setting there is no uncertainty or probabilistic argument due to sampling, as we are provided with an explicit description of the histogram p. Second, Chan et al. require some “well-behavedness” assumption on the distribution p (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.)
Proof
Some preliminary definitions will be helpful:
Definition C.2(Uniform partition)
Let p be a subdistribution on an interval \(I \subseteq [-1,1)\).A partition \(\mathcal {I} = \{I_{1}, \dots , I_{\ell }\}\)of I is (p, η)-uniform if p(I j ) ≤ η for all 1 ≤ j ≤ ℓ.
We will also use the following notation: For this subsection, let I = [−1, 1) (I will denote a subinterval of [−1, 1) when the results are applied in the next subsection). We write \(\|f\|^{(I)}_{1}\) to denote \({\int }_{I} |f(x)| dx\), and we write \(\operatorname {d_{\text {TV}}}^{(I)}(p,q)\) to denote \({\lVert {p-q}{\rVert }}_1^{(I)}/2\). We write \({\textsc {opt}}^{(I)}_{1,d}\) to denote the infimum of the distance \({\lVert {p-g}{\rVert }}_1^{(I)}\) between p and any degree-d subdistribution g on I that satisfies g(I) = p(I).
The key step of ProjectSinglePoly is Step 2 where it calls the FindSinglePoly procedure. In this procedure T i (x) denotes the degree-i Chebychev polynomial of the first kind. The function FindSinglePoly should be thought of as the CDF of a “quasi-distribution” f; we say that \(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). Step 2 of FindSinglePoly processes f slightly to obtain a polynomial q which is an actual distribution over [−1, 1).
The rest of this subsection gives the proof of Theorem 4.13. The claimed running time bound is obvious (the computation is dominated by solving the poly(d, 1/ε)-size LP in ProjectSinglePoly, with an additional term linear in ℓ when partitioning [−1, 1) in the initial first step), so it suffices to prove correctness.
Before launching into the proof we give some intuition for the linear program. Intuitively F(x) represents the cdf of a degree-d polynomial distribution f where \(f=F^{\prime }.\) Constraint (a) captures the endpoint constraints that any cdf must obey if it has the same total weight as p. Intuitively, constraint (b) ensures that for each interval [i j ,i k ), the value F(i k ) − F(i j ) (which we may alternately write as f([i j ,i k ))) is close to the weight p([i j ,i k )) that the distribution puts on the interval. Recall that by assumption p is opt1,d -close to some degree-d polynomial r. Intuitively the variable w ℓ represents \({\int }_{[i_{\ell }, i_{\ell +1})} (r-p)\) (note that these values sum to zero by constraint (c)(4), and y ℓ represents the absolute value of w ℓ (see constraint (c)(5)). The value τ, which by constraint (c)(6) is at least the sum of the y ℓ ’s, represents a lower bound on opt1,d . The constraints in (d) and (e) reflect the fact that as a cdf, F should be bounded between 0 and 1 (more on this below), and the (f) constraints reflect the fact that the pdf \(f=F^{\prime }\) should be everywhere nonnegative (again more on this below).
We begin by observing that ProjectSinglePoly calls FindSinglePoly with input parameters that satisfy FindSinglePoly’s input requirements:
-
(I)
the non-singleton intervals \(I_{0},\dots ,I_{z-1}\) are (p, η)-uniform; and
-
(II)
the singleton intervals each have weight at least \(\frac {\eta }{10}\).
We then proceed to show that, from there, FindSinglePoly’s LP is feasible and has a high-quality optimal solution.
Lemma C.3
Suppose p is an ℓ -histogram over [−1, 1), so that conditions (I) and (II) above hold; then the LP defined in Step 1 of FindSinglePoly is feasible; and the optimal solution τ is at most opt1,d .
Proof
As above, let r be a degree-d polynomial pdf such that\({\textsc {opt}}_{1,d}= {\lVert {p-r}{\rVert }}_1\)and r(I) = p(I).Weexhibit a feasible solution as follows: take F to be the cdf of r (a degree D polynomial). Take w ℓ to be \({\int }_{[i_{\ell },i_{\ell +1})} ({r-p})\),and take y ℓ to be \(\left \lvert w_{\ell } \right \rvert \).Finally, take τ to be \({\sum }_{0 \leq \ell < {z}} y_{\ell }.\)
We first argue feasibility of the above solution. We first take care of the easy constraints:since F is the cdf of a subdistribution over I it is clear that constraints (a) and (e) are satisfied, and since both r and p 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) = r and r satisfying \((\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 [5 Section 3].This analysis shows that since F is a cumulative distribution function (and in particulara function bounded between 0 and 1 on I) each of its Chebychev coefficients is at most\(\sqrt {2}\)in magnitude.
To conclude the proof of the lemma we need to argue that τ ≤opt1,d .Since \(w_{\ell } = {\int }_{[i_{\ell },i_{\ell +1})} ({r-p})\)it is easy to see that \(\tau = {\sum }_{0 \leq \ell < {z}} y_{\ell } = {\sum }_{0 \leq \ell < {z}} |w_{\ell }| \leq {\lVert {p-r}{\rVert }}_1\),and hence indeed τ ≤opt1,d as required. □
Having established that with high probability the LP is indeed feasible, henceforth we let τ denote the optimal solution to the LP and F, f, w ℓ , c i , y ℓ denote the values in the optimal solution. A simple argument (see e.g. the proof of [5 Theorem 8]) gives that \({\lVert {F}{\rVert }}_{\infty }\leq 2\). Given this bound on \({\lVert {F}{\rVert }}_{\infty }\), the Bernstein–Markov inequality implies that \({\lVert {f}{\rVert }}_{\infty } = {\lVert {F^{\prime }}{\rVert }}_{\infty }\leq O((d+1)^{2})\). Together with (f) this implies that f(z) ≥−ε/2 for all z ∈ [−1, 1). Consequently q(z) ≥ 0 for all z ∈ [−1, 1), and
So q(x) is indeed a degree-d pdf. To prove Theorem 4.13 it remains to show that \({\lVert {p-q}{\rVert }}_1 \leq 3 {\textsc {opt}}_{1,d} + O({\varepsilon }).\)
We sketch the argument that we shall use to bound \({\lVert {p-q}{\rVert }}_1\). A key step in achieving this bound is to bound the \(\lVert \cdot {\rVert }_{\mathcal {A}}\) distance between f and \(\widehat {p}_{m} + w\) where \({\mathcal {A}} = {\mathcal A_{d+1}}\) is the class of all unions of d + 1 intervals and w is a function based on the w ℓ values (see (9) below). If we can bound \(\lVert (p+w)- f{\rVert }_{\mathcal {A}} \leq O({\varepsilon })\) then it will not be difficult to show that \(\lVert <Emphasis Type="Italic">r</Emphasis> - f{\rVert }_{\mathcal {A}} \leq {\textsc {opt}}_{1,d} + O({\varepsilon })\). Since r and f are both degree-d polynomials we have \({\lVert {r - f}{\rVert }}_1 = 2\lVert <Emphasis Type="Italic">r</Emphasis> - f{\rVert }_{\mathcal {A}} \leq 2 {\textsc {opt}}_{1,d} + O({\varepsilon })\), so the triangle inequality (recalling that \({\lVert {p-r}{\rVert }}_1 = {\textsc {opt}}_{1,d}\)) gives \({\lVert {p-f}{\rVert }}_1 \leq 3 {\textsc {opt}}_{1,d}+O({\varepsilon }).\) From this point a simple argument (Proposition C.5) gives that \({\lVert {p-q}{\rVert }}_1 \leq {\lVert {p-f}{\rVert }}_1 + O({\varepsilon })\), which gives the theorem.
We will use the following lemma that translates \((\mathcal {I}, \eta ,{\varepsilon })\)-inequalities into a bound on \(\mathcal A_{d+1}\) distance.
Lemma C.4
Let \(\mathcal {I} = \{I_{0}=[i_{0}, i_{1}), \dots , I_{z-1}=[i_{z-1}, i_{z})\}\) be a (p, η)-uniform partition of I, possibly augmented with singleton intervals. If \(h\colon I\to {\mathbb {R}}\) and p satisfy the \((\mathcal {I}, \eta , {\varepsilon })\) -inequalities, then
where error = O((d + 1)η).
Proof
To analyze \(\lVert p-h{\rVert }_{\mathcal A_{d+1}}\),consider any union of d + 1disjoint non-overlapping intervals \(S = J_{1} \cup {\dots } \cup J_{d+1}\).We will bound \(\lVert p - h {\rVert }_{\mathcal A_{d+1}}\)by bounding \(\left \lvert p(S) - h(S) \right \rvert \).
We lengthen intervals in S slightly to obtain\(T = J^{\prime }_{1} \cup {\dots } \cup J^{\prime }_{{d+1}}\)so that each \(J^{\prime }_{j}\)is a union of intervals of the form [i ℓ ,i ℓ+1).Formally, if J j = [a, b),then \(J^{\prime }_{j} = [a^{\prime },b^{\prime })\),where \(a^{\prime } = \max _{\ell } \left \{\; i_{\ell } \;\colon \; i_{\ell } \leq a \; \right \} \)and \(b^{\prime } = \min _{\ell } \left \{\; i_{\ell } \;\colon \; i_{\ell } \geq b \; \right \} \).We claim that
Indeed, consider any interval of the form J = [i ℓ ,i ℓ+1)such that \(J \cap S \neq J \cap T\)(in particular, such an interval cannot be one of the singletons). We have
where the first inequality uses non-negativity of p and the second inequality follows from the bound p([i ℓ ,i ℓ+1)) ≤ η. The\((\mathcal {I}, \eta , {\varepsilon })\)-inequalities (betweenh and p) implies that the inequalities in (8) also hold with h in place of p. Now (7) follows by adding (8) acrossall J = [i ℓ ,i ℓ+1)such that\(J\cap S\neq J\cap T\)(there are at most 2(d + 1)such intervals J),since each interval J j in S can change at most two such J’s when lengthened.
Now rewrite T as a disjoint union of s ≤ d + 1intervals \([i_{L_{1}}, i_{R_{1}}) \cup {\dots } \cup [i_{L_{s}}, i_{R_{s}})\). Wehave
by\((\mathcal {I}, \eta , {\varepsilon })\)-inequalities between p and h.Now observing that that 0 ≤ L 1 ≤ R 1⋯ ≤ L s ≤ R s ≤ t = O((d + 1)/ε), we getthat the largest possible value of \({\sum }_{j=1}^{s} \sqrt {R_{j} - L_{j}}\)is \(\sqrt {sz} \leq {\sqrt {{(d+1)}z}}\), so the RHS of(7) is at most \(O({(d+1)}\eta ) + {\sqrt { {(d+1)}z{\varepsilon }}\eta }\),as desired. □
Recall from above that F, f, w ℓ , c i , y ℓ , τ denote the values in the optimal solution. We claim that
where w is the subdistribution which is constant on each [i ℓ ,i ℓ+1) and has weight w ℓ there, so in particular \({\lVert {w}{\rVert }}_1 \leq \tau \leq {\textsc {opt}}_{1,d}\). Indeed, this equality follows by applying Lemma C.4 with h = f − w. The lemma requires h and p to satisfy \((\mathcal {I}, \eta , {\varepsilon })\)-inequalities, which follows from constraint (b) (\((\mathcal {I}, \eta , {\varepsilon })\)-inequalities between p + w and f) and observing that (p + w) − f = p − (f − w). We have also used η = Θ(ε/(d + 1)) to bound the error term of the lemma by O(ε).
Next, by the triangle inequality we have (writing \({\mathcal {A}}\) for \({\mathcal {A}}_{d+1}\))
The last term on the RHS has just been shown to be O(ε). The first term is bounded by
Altogether, we get that \(\lVert r - f {\rVert }_{\mathcal {A}} \leq {\textsc {opt}}_{1,d}+ O({\varepsilon })\).
Since r and f are degree d polynomials, \({\lVert { <Emphasis Type="Italic">r</Emphasis> - f }{\rVert }}_1 = 2\lVert r - f {\rVert }_{\mathcal {A}} \leq 2{\textsc {opt}}_{1,d}+ O(\varepsilon )\). This implies \({\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 f which has value ≥−ε/2 everywhere into a distribution q (which is nonnegative), by redistributing the weight. The following simple proposition bounds the error incurred.
Proposition C.5
Let f and p be any sub-quasidistribution on I. If \(q = {{\varepsilon } f(I)/\left \lvert I \right \rvert + (1- {\varepsilon })f}\), then \(\lVert q - p{\rVert }_{1} \leq \lVert f - p{\rVert }_{1} + {{\varepsilon }(f(I)+p(I))}\) .
Proof
We have
Therefore
□
We now have \({\lVert { p - q }{\rVert }}_1 \leq {\lVert { p-f }{\rVert }}_1 + O({\varepsilon })\) by Proposition C.5, concluding the proof of Theorem 4.13. □
1.2 C.2 Proof of Lemma 4.14
Lemma 4.14 (Monotone Hazard Rate)
There exists a procedure \(\textsc {ProjectionDist}_{{\mathcal {MHR}}}^{\ast }\) that, on input n as well as the full specification of a k-histogram distribution D on [n]and of an ℓ -histogram distribution \(D^{\prime }\) on [n], runs in time poly(n, 1/ε), and satisfies the following.
-
If there is \(P\in {\mathcal {MHR}}\) such that \({\lVert {{D}-P}{\rVert }}_1 \leq {\varepsilon }\) and \({\lVert {D}^{\prime } - P{\rVert }_{\text {Kol}}} \leq {\varepsilon }^{3}\), then the procedure returns yes;
-
If \(\ell _{1}({D},{\mathcal {MHR}}) > 100{\varepsilon }\), then the procedure returns no.
Proof
For convenience, let \(\alpha \overset {\text {def}}{=} {\varepsilon }^{3}\);we also write [i, j]instead of \(\{i,\dots ,j\}\).
First, we note that it is easy to reduce our problem to the case where, in the completeness case, wehave \(P\in {\mathcal {MHR}}\)suchthat \({\lVert {{D}-P}{\rVert }}_1 \leq 2{\varepsilon }\)and\({\lVert {D} - P{\rVert }_{\text {Kol}}} \leq 2\alpha \); while in the soundness case\(\ell _{1}({D},{\mathcal {MHR}}) \geq 99{\varepsilon }\). Indeed, this can be done with a linear program on poly(k, ℓ)variables,asking to find a (k + ℓ)-histogram\(D^{\prime \prime }\) on a refinementof D and \(D^{\prime }\)minimizing the ℓ 1 distance to D, under the constraint that the Kolmogorov distance to \(D^{\prime }\)be boundedby ε. (Inthe completeness case, clearly a feasible solution exists, as p is one.) We therefore follow with thisnew formulation: either
-
(a) D is ε-closeto a monotone hazard rate distribution P (in ℓ 1distance) and D is α-closeto P (in Kolmogorov distance); and
-
(b) D is 32ε-farfrom monotone hazard rate
where D is a (k + ℓ)-histogram.
We then proceed by observing the following easy fact: suppose P is a MHR distribution on [n], i.e. such thatthe quantity \(h_{i} \overset {\text {def}}{=} \frac {P(i)}{{\sum }_{j=i}^{n} P(i)}\), i ∈ [n]isnon-increasing. Then, we have
and there is a bijective correspondence between P and (h i ) i∈[n].
We will write a linear program with variables\(y_{1},\dots ,y_{n}\), with thecorrespondence \(y_{i}\overset {\text {def}}{=}\ln (1-h_{i})\).Note that with this parameterization, we get that if the (y i ) i∈[n]correspond to a MHR distribution P, then for i ∈ [n]
and askingthat \(\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 thereexists \(P\in {\mathcal {MHR}}\)such\(P\in {\mathcal {MHR}}\)such that\({\lVert {{D}-P}{\rVert }}_1 \leq {\varepsilon }\)and\({\lVert {D}^{\prime } - P{\rVert }_{\text {Kol}}} \leq \alpha \). This impliesthat for all i ∈ [n],\(\left \lvert P([i,n]) - {D}([i,n]) \right \rvert \leq 2\alpha \). Define\(I=\{b+1,\dots ,n\}\)to be the longestinterval such that \(D(\{b+1,\dots ,n\})\leq \frac {{\varepsilon }}{2}\). Itfollows that for every i ∈ [n] ∖ I,
and similarly \(\frac {P([i,n])}{{D}([i,n])} \geq \frac {D([i,n])-2\alpha }{D([i,n]} \geq 1-{\varepsilon } \). This meansthat for the points i in [n] ∖ I,we can write constraints asking for multiplicative closeness (within 1 ± ε)between\(e^{{\sum }_{j=1}^{i-1} y_{j}}\)and D([i, n]),which is very easy to write down as linear constraints on the y i ’s.
The Linear Program
Let T and S be respectively the sets of “light” and “heavy” points, defined as \(T= \left \{\; i\in \{1,\dots ,b\} \;\colon \; {D}(i) \leq {\varepsilon }^{2} \; \right \} \) and \(S= \left \{\; i\in \{1,\dots ,b\} \;\colon \; {D}(i) > {\varepsilon }^{2} \; \right \} \), where b is as above. (In particular, \(\left \lvert S \right \rvert \leq 1/{\varepsilon }^{2}\).)
Given a solution to the linear program above, define \(\tilde {P}\) (a non-normalized probability distribution) by setting \(\tilde {P}(i) = (1-e^{y_{i}})e^{{\sum }_{j=1}^{i-1} y_{j}}\) for \(i\in \{1,\dots ,b\}\), and \(\tilde {P}(i) = 0\) for \(i\in I = \{b+1,\dots , n\}\). A MHR distribution is then obtained by normalizing \(\tilde {P}\).
Completeness
Suppose \(P\in {\mathcal {MHR}}\) is as promised. In particular, by the Kolmogorov distance assumption we know that every i ∈ T has P(i) ≤ ε 2 + 2α < 2ε 2.
-
For any i ∈ T, we have that \(\frac {P(i)}{P[i,n]} \leq \frac {2{\varepsilon }^{2}}{(1-{\varepsilon }){\varepsilon }} \leq 4{\varepsilon }\), and
$$ \frac{{D}(i)-{\varepsilon}_{i}}{(1+{\varepsilon}){D}[i,n]} \leq \frac{P(i)}{P[i,n]} \leq \underbrace{-\ln(1-\frac{P(i)}{P[i,n]})}_{-y_{i}} \leq (1+4{\varepsilon})\frac{P(i)}{P[i,n]} = (1+4{\varepsilon})\frac{{D}(i)+{\varepsilon}_{i}}{P[i,n]} \leq \frac{1+4{\varepsilon}}{1-{\varepsilon}}\frac{{D}(i)+{\varepsilon}_{i}}{{D}[i,n]} $$(12)where we used (11) for the two outer inequalities; and so (15), (16), and (17) would follow from setting \(\varepsilon _{i} \overset {\text {def}}{=} \left \lvert {P(i)-{D}(i)} \right \rvert \) (along with the guarantees on ℓ 1 and Kolmogorov distances between P and D).
-
For i ∈ S, Constraint (18) is also met, as \(\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 ]\).
Soundness
Assume a feasible solution to the linear program is found. We argue that this implies D is \({O\left ({\varepsilon } \right )}\)-close to some MHR distribution, namely to the distribution obtained by renormalizing \(\tilde {P}\).
In order to do so, we bound separately the ℓ 1 distance between D and \(\tilde {P}\), from I, S, and T. First, \({\sum }_{i\in I} \left \lvert {D}(i) - \tilde {P}(i) \right \rvert = {\sum }_{i\in I} {D}(i) \leq \frac {{\varepsilon }}{2}\) by construction. For i ∈ T, we have \(\frac {{D}(i)}{{D}[i,n]} \leq {\varepsilon }\), and
Now,
so that
which implies
so that \({\sum }_{i\in T} \left \lvert {D}(i) - \tilde {P}(i) \right \rvert \leq 10{\varepsilon } {\sum }_{i\in T} {D}(i) + (1+10{\varepsilon }){\sum }_{i\in T} {\varepsilon }_{i} \leq 10\varepsilon + (1+10\varepsilon )\varepsilon \leq 20\varepsilon \) where the last inequality follows from Constraint (16).
To analyze the contribution from S, we observe that Constraint (18) implies that, for any i ∈ S,
which combined with Constraint (14) guarantees
which in turn implies that \(\left \lvert \tilde {P}(i) - {D}(i) \right \rvert \leq 3{\varepsilon }\tilde {P}(i) + 2\alpha \). Recalling that \(\left \lvert S \right \rvert \leq \frac {1}{{\varepsilon }^{2}}\) and α = ε 3, this yields \({\sum }_{i\in S} \left \lvert {D}(i) - \tilde {P}(i) \right \rvert \leq 3{\varepsilon } {\sum }_{i\in S} \tilde {P}(i) + 2{\varepsilon } \leq 3{\varepsilon }(1+{\varepsilon }) + 2{\varepsilon } \leq 8{\varepsilon }\). Summing up, we get \( {\sum }_{i=1}^{n} \left \lvert {D}(i) - \tilde {P}(i) \right \rvert \leq 30{\varepsilon } \) which finally implies by the triangle inequality that the ℓ 1 distance between D and the normalized version of \(\tilde {P}\) (a valid MHR distribution) is at most 32ε.
Running Time
The running time is immediate, from executing the two linear programs on poly(n, 1/ε) variables and constraints. □
1.3 C.3 Proof of Lemma 4.15
Lemma 4.15 (Log-concavity)
There exists a procedure \(\textsc {ProjectionDist}_{{\mathcal {L}}}^{\ast }\) that, on input n as well as the full specifications of a k-histogram distribution D on [n]and an ℓ -histogram distribution \(D^{\prime }\) on [n], runs in time poly(n, k, ℓ, 1/ε), and satisfies the following.
-
If there is \(P\in {\mathcal {L}}\) such that \({\lVert {{D}-P}{\rVert }}_1\leq {\varepsilon }\) and \({\lVert {D}^{\prime } - P{\rVert }_{\text {Kol}}}\leq \frac {\varepsilon ^{2}}{\log ^{2}(1/\varepsilon )}\), then the procedure returns yes;
-
If \(\ell _{1}({D},{\mathcal {L}}) \geq 100{\varepsilon }\), then the procedure returns no.
Proof
We set \(\alpha \overset {\text {def}}{=} \frac {{\varepsilon }^{2}}{\log ^{2}(1/{\varepsilon })}\),\(\beta \overset {\text {def}}{=} \frac {{\varepsilon }^{2}}{\log (1/{\varepsilon })}\),and \(\gamma \overset {\text {def}}{=} \frac {\varepsilon ^{2}}{10}\)(so that α ≪ β ≪ γ ≪ ε),
Given the explicit description of a distribution D on [n], which a k-histogramover a partition \(\mathcal {I}=(I_{1},\dots , I_{k})\)of [n]with\(k=\text {poly}(\log n, 1/\varepsilon )\)and the explicit descriptionof a distribution \(D^{\prime }\)on [n],one must efficiently distinguish between:
-
(a) D is ε-closeto a log-concave P (in ℓ 1distance) and \(D^{\prime }\)is α-closeto P (in Kolmogorov distance); and
-
(b) D is 100ε-farfrom log-concave.
If we are willing to pay an extra factor of \({O\left (n \right )}\),we can assume without loss of generality that we know the mode of the closest log-concavedistribution (which is implicitly assumed in the following: the final algorithm will simply try allpossible modes).
Outline
First, we argue that we can simplify to the case where D is unimodal. Then, reduce to the case where where D and \(D^{\prime }\) are only one distribution, satisfying both requirements from the completeness case. Both can be done efficiently (Section C.3.1), and make the rest much easier. Then, perform some ad hoc partitioning of [n], using our knowledge of D, into \(\tilde {O}\left ({1/\varepsilon ^{2}} \right )\) pieces such that each piece is either a “heavy” singleton, or an interval I with weight very close (multiplicatively) to D(I)under the target log-concave distribution, if it exists (Section C.3.2). This in particular simplifies the type of log-concave distribution we are looking for: it is sufficient to look for distributions putting that very specific weight on each piece, up to a (1 + o(1)) factor. Then, in Section C.3.3, we write and solve a linear program to try and find such a “simplified” log-concave distribution, and reject if no feasible solution exists.
Note that the first two sections allow us to argue that instead of additive (in ℓ 1) closeness, we can enforce constraints on multiplicative (within a (1 + ε) factor) closeness between D and the target log-concave distribution. This is what enables a linear program with variables being the logarithm of the probabilities, which plays very nicely with the log-concavity constraints.
We will require the following result of Chan, Diakonikolas, Servedio, and Sun:
Theorem C.6 ([15, Lemma 4.1])
Let D be a distribution over [n], log-concave and non-decreasing over \(\{1,\dots ,b\} \subseteq [n]\) .Let a ≤ b such that \(\sigma = D(\{1,\dots ,a-1\}) > 0\), and write \(\tau ={D}(\{a,\dots ,b\})\) .Then \(\frac {{D}(b)}{{D}(a)} \leq 1+\frac {\tau }{\sigma }\).
1.3.1 C.3.1 Step 1
Reducing to D Unimodal
Using a linear program, find a closest unimodal distribution \(\tilde {{D}}\) to D (also a k-histogram on \(\mathcal {I}\)) under the constraint that \({\lVert {{D} - {P}}{\rVert }_{\text {Kol}}} \leq \alpha \): this can be done in time poly(k). If \(\|{{D}-\tilde {{D}}}\|_{1} > \varepsilon \), output reject.
-
If D is ε-close to a log-concave distribution P as above, then it is in particular ε-close to unimodal and we do not reject. Moreover, by the triangle inequality \(\|{\tilde {{D}}\|_{1} - P} \leq 2\varepsilon \) and \(\lVert {{\tilde {{D}}} - {P}}{\rVert }_{\text {Kol}} \leq \alpha \leq 2\alpha \).
-
If D is 100ε-far from log-concave and we do not reject, then \(\ell _{1}(\tilde {{D}},{\mathcal {L}}) \geq 99{\varepsilon }\).
Reducing to \(D={D}^{\prime }\)
First, we note that it is easy to reduce our problem to the case where, in the completeness case, we have \(P\in {\mathcal {L}}\) such that \({\lVert {{D}-P}{\rVert }}_1 \leq 4{\varepsilon }\) and \({\lVert {D} - P{\rVert }_{\text {Kol}}} \leq 4\alpha \); while in the soundness case \(\ell _{1}({D},{\mathcal {L}}) \geq 97{\varepsilon }\). Indeed, this can be done with a linear program on poly(k, ℓ) variables and constraints, asking to find a (k + ℓ)-histogram \(D^{\prime \prime }\) on a refinement of D and \(D^{\prime }\) minimizing the ℓ 1 distance to D, under the constraint that the Kolmogorov distance to \(D^{\prime }\) be bounded by 2α. (In the completeness case, clearly a feasible solution exists, as (the flattening on this (k + ℓ)-interval partition) of P is one.) We therefore follow with this new formulation: either
-
(a) D is 4ε-close to a log-concave P (in ℓ 1 distance) and D is 4α-close to P (in Kolmogorov distance); and
-
(b) D is 97ε-far from log-concave;
where D is a (k + ℓ)-histogram.
This way, we have reduced the problem to a slightly more convenient one, that of Section C.3.2.
Reducing to Knowing the Support [a, b]
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) as the interval {a,⋯ ,b} such that
-
\(D(\{1,\dots ,a-1\}) \leq \alpha \) but \(D(\{1,\dots ,a\}) > \alpha \); and
-
\(D(\{b+1,\dots ,\}n) \leq \alpha \) but \(D(\{b,\dots ,n\}) > \alpha \).
Any log-concave distribution that is α-close to D must include {a,⋯ ,b} in its support, since otherwise the ℓ 1 distance between D and P is already greater than α. Conversely, if P is a log-concave distribution α-close to D, it is easy to see that the distribution obtained by setting P to be zero outside {a,⋯ ,b} and renormalizing the result is still log-concave, and O(α)-close to D.
1.3.2 C.3.2 Step 2
Given the explicit description of a unimodal distribution D on [n], which a k-histogram over a partition \(\mathcal {I}=(I_{1},\dots , I_{k})\) of [n] with \(k=\text {poly}(\log n, 1/\varepsilon )\), one must efficiently distinguish between:
-
(a) D is ε-close to a log-concave P (in ℓ 1 distance) and α-close to P (in Kolmogorov distance); and
-
(b) D is 24ε-far from log-concave,
assuming we know the mode of the closest log-concave distribution, which has support [n].
In this stage, we compute a partition \(\mathcal {J}\) of [n] into \(\tilde {O}\left (1/{\varepsilon }^{2} \right )\) intervals (here, we implicitly use the knowledge of the mode of the closest log-concave distribution, in order to apply Theorem C.6 differently on two intervals of the support, corresponding to the non-decreasing and non-increasing parts of the target log-concave distribution).
As D is unimodal, we can efficiently (\({O\left (\log k \right )}\)) find the interval S of heavy points, that is
Each point in S will form a singleton interval in our partition. Let \(T\overset {\text {def}}{=} [n]\setminus S\) be its complement (T is the union of at most two intervals T 1,T 2 on which D 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” T 1 (on which D is non-decreasing).
-
1.
Greedily find \(J=\{1,\dots ,a\}\), the smallest prefix of the distribution satisfying \(D(J)\in \left [\frac {\varepsilon }{10}-\beta , \frac {\varepsilon }{10}\right ]\).
-
2.
Similarly, partition T 1 ∖ J into intervals \(I^{\prime }_{1},\dots ,I^{\prime }_{s}\) (with \(s={O\left ({1/\gamma } \right )}={O\left ({1/\varepsilon ^{2}} \right )}\)) such that \( \frac {\gamma }{10} \leq {D}(I^{\prime }_{j}) \leq \frac {9}{10}\gamma \) for all 1 ≤ j ≤ s − 1, and \(\frac {\gamma }{10} \leq {D}(I^{\prime }_{s}) \leq \gamma \). This is possible as all points not in S have weight less than β, and β ≪ γ.
Discussion: Why Doing This?
We focus on the completeness case: let \(P\in {\mathcal {L}}\) be a log-concave distribution such that \({\lVert {{D}-P}{\rVert }}_1 \leq {\varepsilon }\) and \({\lVert {D} - P{\rVert }_{\text {Kol}}} \leq \alpha \). Applying Theorem C.6 on J and the \(I^{\prime }_{j}\)’s, we obtain (using the fact that \(\left \lvert P(I^{\prime }_{j}) - {D}(I^{\prime }_{j}) \right \rvert \leq 2\alpha \)) that:
Moreover, we also get that each resulting interval \(I^{\prime }_{j}\) will satisfy
with \(\kappa _{j} \overset {\text {def}}{=} \frac {2\alpha }{{D}(I^{\prime }_{j})} = {\Theta \left (1/\log ^{2}(1/{\varepsilon }) \right )}\).
Summing up, we have a partition of [n] into \(\left \lvert S \right \rvert +2 = \tilde {O}\left (1/{\varepsilon }^{2} \right )\) intervals such that:
-
The (at most) two end intervals have \(D(J)\in \left [\frac {{\varepsilon }}{10}-\beta , \frac {{\varepsilon }}{10}\right ]\), and thus \(P(J)\in \left [\frac {\varepsilon }{10}-\beta -2\alpha , \frac {\varepsilon }{10}+2\alpha \right ]\);
-
the \(\tilde {O}\left (1/{\varepsilon }^{2} \right )\) singleton-intervals from S are points x with D(x) ≥ β, so that \(P(x) \geq \beta -2\alpha \geq \frac {\beta }{2}\);
-
each other interval \(I=I^{\prime }_{j}\) satisfies
$$ (1-\kappa_{j}) {D}(I) \leq P(I) \leq (1+\kappa_{j}) {D}(I) $$(20)with \(\kappa _{j}={O\left (1/\log ^{2}(1/{\varepsilon }) \right )}\); and
$$ \frac{\max_{x\in I}P(x)}{\min_{x\in I}P(x)} \leq 1+\kappa < 1+\frac{3}{2}{\varepsilon}. $$(21)
We will use in the constraints of the linear program the fact that \((1+\frac {3}{2}{\varepsilon })(1+\kappa _{j}) \leq 1+2{\varepsilon }\), and \(\frac {1-\kappa _{j}}{1+\frac {3}{2}\varepsilon } \geq \frac {1}{1+2\varepsilon }\).
1.3.3 C.3.3 Step 3
We start by computing the partition \(\mathcal {J}=(J_{1},\dots ,J_{\ell })\) as in Section C.3.2; with \(\ell =\tilde {O}\left ({1/\varepsilon ^{2}} \right )\); and write \(J_{j}=\{a_{j},\dots ,b_{j}\}\) for all j ∈ [ℓ]. We further denote by S and T the set of heavy and light points, following the notations from Section C.3.2; and let \(T^{\prime } \overset {\text {def}}{=} T_{1}\cup T_{2}\) be the set obtained by removing the two “end intervals” (called J in the previous section) from T.
Lemma C.7 (Soundness)
If the linear program (Algorithm 8) has a feasible solution, then \(\ell _{1}({D}, {\mathcal {L}})\leq {O\left (\varepsilon \right )}\) .
Proof
A feasible solution to this linear program will define (setting\(p_{i}=e^{x_{i}}\)) asequence \(p=(p_{1},\dots ,p_{n}) \in (0, 1]^{n}\)such that
-
p takes values in (0, 1](from (22));
-
p is log-concave (from (23));
-
p is “ (1 + O(ε))-multiplicatively constant” on each interval J j (from (24));
-
p puts roughly the right amount of weight on each J i :
-
weight (1 ± O(ε))D(J)on everyJ fromT (from (24)), so that the ℓ 1distance between D and P coming from\(T^{\prime }\)is at most O(ε);
-
it puts weight approximately D(J)on every singletonJ from S, i.e. such that D(J) ≥ β. To see why,observe that each ε i is in [0, 2α]by constraints (27). In particular, this means that\(\frac {\varepsilon _{i}}{{D}(i)} \leq 2\frac {\alpha }{\beta } \ll 1\), and wehave
$${D}(i) - 4{\varepsilon}_{i} \leq {D}(i)\cdot e^{-4\frac{{\varepsilon}_{i}}{{D}(i)}} \leq p_{i} = e^{x_{i}} \leq {D}(i)\cdot e^{2\frac{{\varepsilon}_{i}}{{D}(i)}} \leq {D}(i)+4{\varepsilon}_{i} $$and together with (26) this guarantees that the ℓ 1distance between D and p coming from S is at most ε.
-
Note that the solution obtained this way may not sum to one—i.e., is not necessarily a probabilitydistribution. However, it is easy to renormalize p to obtain a bona fide probability distribution\(\tilde {P}\)as follows:set \(\tilde {P} = \frac {p(i)}{{\sum }_{i\in S\cup T^{\prime }} p(i)}\)forall \(i\in S\cup T^{\prime }\), and p(i) = 0 for \(i\in T\setminus T^{\prime }\).
Since by the above discussion we know that\(p(S\cup T^{\prime })\)is within\({O\left ({\varepsilon } \right )}\)of\(D(S\cup T^{\prime })\)(itself in\([1-\frac {9\varepsilon }{5}, 1+\frac {9\varepsilon }{5}]\)by constructionof \(T^{\prime }\)),\(\tilde {P}\)is a log-concavedistribution such that \(\|{\tilde {P}-{D}}_{1} = {O\left ({\varepsilon } \right )}\). □
Lemma C.8 (Completeness)
If there is P in \({\mathcal {L}}\) such that \({\lVert {{D}-P}{\rVert }}_1\leq {\varepsilon }\) and \({\lVert {D} - P{\rVert }_{\text {Kol}}}\leq \alpha \), then the linear program (Algorithm 8) has a feasible solution.
Proof
Let \(P\in {\mathcal {L}}\)such that \({\lVert {{D} - P}{\rVert }}_1\leq {\varepsilon }\)and \({\lVert {D} - P{\rVert }_{\text {Kol}}}\leq \alpha \).Define \(x_{i}\overset {\text {def}}{=} \ln P(i)\)for all i ∈ [n].Constraints (22) and (23) are immediately satisfied, since P is log-concave. By the discussion from Section C.3.2(more specifically, (20) and (21)), constraint (24) holds as well.
Letting \({\varepsilon }_{i}\overset {\text {def}}{=} \left \lvert P(i)-{D}(i) \right \rvert \)for i ∈ S, we also immediately have (26) and (27) (since \({\lVert {P-{D}}{\rVert }}_1 \leq {\varepsilon }\)and \({\lVert {D} - P{\rVert }_{\text {Kol}}}\leq \alpha \)by assumption). Finally, to see why (25) is satisfied, werewrite
and use thefact that \(\ln (1+x) \leq x\)and \(\ln (1-x) \geq -2x\)(thelatter for \(x < \frac {1}{2}\),along with \(\frac {{\varepsilon }_{i}}{{D}(i)} \leq \frac {2\alpha }{\beta } \ll 1\)). □
1.3.4 C.3.4 Putting it All Together: Proof of Lemma 4.15
The algorithm is as follows (keeping the notations from Sections C.3.1 to C.3.3):
-
Set α, β, γ as above.
-
Follow Section C.3.1 to reduce it to the case where D is unimodal and satisfies the conditions for Kolmogorov and ℓ 1 distance; and a good [a, b] approximation of the support is known
-
For each of the \({O\left (n \right )}\) possible modes c ∈ [a, b]:
-
Run the linear program Algorithm 8, return accept if a feasible solution is found
-
-
None of the linear programs was feasible: return reject.
The correctness comes from Lemma C.7 and Lemma C.8 and the discussions in Sections C.3.1 to 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/ε) 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:
Theorem 6.3
There exists an absolute constant ε 0 > 0such that the following holds. Any algorithm which, given sampling access to an unknown distribution D on Ωand parameter ε ∈ (0,ε 0), distinguishes with probability at least 2/3between (i) \({\lVert {{D}-{\operatorname {Bin}\!\left (n, 1/2 \right )}}{\rVert }}_1 \leq {\varepsilon }\) and (ii) \({\lVert {{D}-{\operatorname {Bin}\!\left (n, 1/2 \right )}}{\rVert }}_1 \geq 100{\varepsilon }\) must use \({\Omega \left (\frac {1}{{\varepsilon }}\frac {\sqrt {n}}{\log n} \right )}\) samples.
The theorem will be a consequence of the (slightly) more general result below:
Theorem D.1
There exist absolute constants ε 0 > 0and λ > 0such that the following holds. Any algorithm which, given sample access to an unknown distribution D on Ωand parameter ε ∈ (0,ε 0), distinguishes with probability at least 2/3between (i) \({\lVert {{D}-{\operatorname {Bin}\!\left (n, \frac {1}{2} \right )}}{\rVert }}_1 \leq {\varepsilon }\) and (ii) \({\lVert {{D}-{\operatorname {Bin}\!\left (n, \frac {1}{2} \right )}}{\rVert }}_1 \geq \lambda {\varepsilon }^{1/3}-{\varepsilon }\) must use \({\Omega \left ({\varepsilon }\frac {\sqrt {n}}{\log ({\varepsilon } n)} \right )}\) samples.
By choosing a suitable ε and working out the corresponding parameters, this for instance enables us to derive the following:
Corollary D.2
There exists an absolute constant ε 0 ∈ (0, 1/1000)such that the following holds. Any algorithm which, given sample access to an unknown distribution D on Ω, distinguishes with probability at least 2/3between (i) \({\lVert {{D}-{\operatorname {Bin}\!\left (n, \frac {1}{2} \right )}}{\rVert }}_1 \leq {\varepsilon }_{0}\) and (ii) \({\lVert {{D}-{\operatorname {Bin}\!\left (n, \frac {1}{2} \right )}}{\rVert }}_1 \geq 100{\varepsilon }_{0}\) must use \({\Omega \left (\frac {\sqrt {n}}{\log n} \right )}\) samples.
By standard techniques, this will in turn imply Theorem 6.3.Footnote 11
Proof of Theorem D.1
Hereafter, we write for convenience \(B_{n}\overset {\text {def}}{=} {\operatorname {Bin}\!\left (n, \frac {1}{2} \right )}\).To prove this lower bound, we will rely on the following:
Theorem D.3([50, Theorem 1])
For any constant ϕ ∈ (0, 1/4), following holds. Any algorithm which, given sample access to an unknown distribution D on \(\{1,\dots ,N\}\), distinguishes with probability at least 2/3between (i) \({\lVert {{D} - {\mathcal {U}}_{N}}{\rVert }}_1 \leq \phi \) and (ii) \({\lVert {{D} - {\mathcal {U}}_{N}}{\rVert }}_1 \geq \frac {1}{2}-\phi \), must have sample complexity at least \(\frac {\phi }{32}\frac {N}{\log N}\) .
Without loss of generality, assume n is even (so that B n has only one mode located at \(\frac {n}{2}\)). For c > 0, we write I n, c for the interval \(\{\frac {n}{2}-c\sqrt {n},\dots ,\frac {n}{2}+c\sqrt {n}\}\) and \(J_{n,c}\overset {\text {def}}{=}{\Omega }\setminus I_{n,c}\).
Fact D.4
For any c > 0,
and
The reduction proceeds as follows: given sampling access to D on [N], we can simulate sampling access to a distribution \(D^{\prime }\) on [n] (where \(n={\Theta \left ({N^{2}} \right )}\)) such that
-
if \({\lVert {{D} - {\mathcal {U}}_{N}}{\rVert }}_1 \leq \phi \), then \({\lVert {{D}^{\prime } - B_{n}}{\rVert }}_1 < {\varepsilon }\);
-
if \({\lVert {{D} - {\mathcal {U}}_{N}}{\rVert }}_1 \geq \frac {1}{2}-\phi \), then \({\lVert {{D}^{\prime } - B_{n}}{\rVert }}_1 > {\varepsilon }^{\prime } - {\varepsilon }\)
for \({\varepsilon } \overset {\text {def}}{=} {\Theta }(\phi ^{3/2})\) and \({\varepsilon }^{\prime } \overset {\text {def}}{=} {\Theta }(\phi ^{\frac {1}{2}})\); in a way that preserves the sample complexity. The high-level idea is that (by the above fact) the Binomial distribution over Ω is almost uniform on the middle \(O(\sqrt {n})\) elements, and has a constant fraction of its probability mass there: we can therefore “embed” the tolerant uniformity testing lower bound (for support \(O(\sqrt {n})\)) into this middle interval.
More precisely, define \(c\overset {\text {def}}{=} \sqrt {\frac {1}{2}\ln \frac {1}{1-\phi }} ={\Theta \left (\sqrt {\phi } \right )}\) (so that \(\phi = 1 - e^{-2c^{2}}\)) and n such that \(\left \lvert {I_{n,c}} \right \rvert = N\) (that is, \(n=(N/(2c))^{2} = {\Theta \left ({N^{2}/\phi } \right )}\)). From now on, we can therefore identify [N] to I n, c in the obvious way, and see a draw from D as an element in I n, c .
Let \(p\overset {\text {def}}{=} B_{n}(I_{n,c}) = {\Theta \left (\sqrt {\phi } \right )}\), and B n, c , \(\bar {B}_{n,c}\) respectively denote the conditional distributions induced by B n on I n, c and J n, c . Intuitively, we want D to be mapped to the conditional distribution of \(D^{\prime }\) on I n, c , and the conditional distribution of \(D^{\prime }\) on J n, c to be exactly \(\bar {B}_{n,c}\). This is achieved by defining \(D^{\prime }\) by the process below:
-
with probability p, we draw a sample from D (seen as an element of I n, c );
-
with probability 1 − p, we draw a sample from \(\bar {B}_{n,c}\).
Let \(\tilde {B}_{n}\) be defined as the distribution which exactly matches B n on J n, c , but is uniform on I n, c :
From the above, we have that \({\|{D}^{\prime } - \tilde {B}_{n}}\|_{1} = p\cdot {\lVert {{D} - {\mathcal {U}}_{N}}{\rVert }}_1\). Furthermore, by Fact D.4, Lemma 2.9 and the definition of I n, c , we get that \(\|{B_{n} - \tilde {B}_{n}} = p\cdot \|{(B_{n})_{I_{n,c}} - {\mathcal {U}}_{I_{n,c}}} \leq p\cdot \phi \). Putting it all together,
-
If \({\lVert {{D} - {\mathcal {U}}_{N}}{\rVert }}_1 \leq \phi \), then by the triangle inequality \({\lVert {{D}^{\prime } - B_{n}}{\rVert }}_1 \leq p(\phi + \phi ) = 2p\phi \);
-
If \({\lVert {{D} - {\mathcal {U}}_{N}}{\rVert }}_1 \geq \frac {1}{2}-\phi \), then similarly \({\lVert {{D}^{\prime } - B_{n}}{\rVert }}_1 \geq p(\frac {1}{2}-\phi -\phi ) = \frac {p}{4}-2p\phi \).
Recalling that \(p= {\Theta \left (\sqrt {\phi } \right )}\) and setting \({\varepsilon } \overset {\text {def}}{=} 2p\phi \) concludes the reduction. From Theorem D.3, we conclude that
samples are necessary. □
Proof of Corollary D.2
The corollary follows from the proof of Theorem D.1, by choosing ε 0 > 0sufficiently small so that \(\frac {\lambda \varepsilon _{0}^{1/3}-\varepsilon _{0}}{\varepsilon _{0}} \geq 100\). □
Rights and permissions
About this article
Cite this article
Canonne, C.L., Diakonikolas, I., Gouleakis, T. et al. Testing Shape Restrictions of Discrete Distributions. Theory Comput Syst 62, 4–62 (2018). https://doi.org/10.1007/s00224-017-9785-6
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00224-017-9785-6