Testing Shape Restrictions of Discrete Distributions
Clément L. Canonne, Ilias Diakonikolas, Themis Gouleakis, Ronitt Rubinfeld
Introduction
Inferring information about the probability distribution that underlies a data sample is an essential question in Statistics, and one that has ramifications in every field of the natural sciences and quantitative research. In many situations, it is natural to assume that this data exhibits some simple structure because of known properties of the origin of the data, and in fact these assumptions are crucial in making the problem tractable. Such assumptions translate as constraints on the probability distribution – e.g., it is supposed to be Gaussian, or to meet a smoothness or “fat tail” condition (see e.g., [Man63, Hou86, TLSM95]).
As a result, the problem of deciding whether a distribution possesses such a structural property has been widely investigated both in theory and practice, in the context of shape restricted inference [BDBB72, SS01] and model selection [MP07]. Here, it is guaranteed or thought that the unknown distribution satisfies a shape constraint, such as having a monotone or log-concave probability density function [SN99, BB05, Wal09, Dia16]. From a different perspective, a recent line of work in Theoretical Computer Science, originating from the papers of Batu et al. [BFR+00, BFF+01, GR00] has also been tackling similar questions in the setting of property testing (see [Ron08, Ron10, Rub12, Can15] for surveys on this field). This very active area has seen a spate of results and breakthroughs over the past decade, culminating in very efficient (both sample and time-wise) algorithms for a wide range of distribution testing problems [BDKR05, GMV06, AAK+07, DDS+13, CDVV14, AD15, DKN15b]. In many cases, this led to a tight characterization of the number of samples required for these tasks as well as the development of new tools and techniques, drawing connections to learning and information theory [VV10, VV11a, VV14].
In this paper, we focus on the following general property testing problem: given a class (property) of distributions and sample access to an arbitrary distribution , one must distinguish between the case that (a) , versus (b) for all (i.e., is either in the class, or far from it). While many of the previous works have focused on the testing of specific properties of distributions or obtained algorithms and lower bounds on a case-by-case basis, an emerging trend in distribution testing is to design general frameworks that can be applied to several property testing problems [Val11, VV11a, DKN15b, DKN15a]. This direction, the testing analog of a similar movement in distribution learning [CDSS13, CDSS14b, CDSS14a, ADLS15], aims at abstracting the minimal assumptions that are shared by a large variety of problems, and giving algorithms that can be used for any of these problems. In this work, we make significant progress in this direction by providing a unified framework for the question of testing various properties of probability distributions. More specifically, we describe a generic technique to obtain upper bounds on the sample complexity of this question, which applies to a broad range of structured classes. Our technique yields sample near-optimal and computationally efficient testers for a wide range of distribution families. Conversely, we also develop a general approach to prove lower bounds on these sample complexities, and use it to derive tight or nearly tight bounds for many of these classes.
Moreover, for the specific problems of identity and closeness testing,Recall that the identity testing problem asks, given the explicit description of a distribution and sample access to an unknown distribution , to decide whether is equal to or far from it; while in closeness testing both distributions to compare are unknown. recent results of [DKN15b, DKN15a] describe a general algorithm which applies to a large range of shape or structural constraints, and yields optimal identity testers for classes of distributions that satisfy them. We observe that while the question they answer can be cast as a specialized instance of membership testing, our results are incomparable to theirs, both because of the distinction above (testing with versus testing for structure) and as the structural assumptions they rely on are fundamentally different from ours.
1 Results and Techniques
We then instantiate this result to obtain “out-of-the-box” computationally efficient testers for several classes of distributions, by showing that they satisfy the premise of our theorem (the definition of these classes is given in Section 2.1):
We remark that the aforementioned sample upper bounds are information-theoretically near-optimal in the domain size (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 can lead to such improvements.
To complement our upper bounds, we give a generic framework for proving lower bounds against testing classes of distributions. In more detail, we describe how to reduce – under a mild assumption on the property – the problem of testing membership to (“does ?”) to testing identity to (“does ?”), for any explicit distribution in . While these two problems need not in general be related,As a simple example, consider the class of all distributions, for which testing membership is trivial. we show that our reduction-based approach applies to a large number of natural properties, and obtain lower bounds that nearly match our upper bounds for all of them. Moreover, this lets us derive a simple proof of the lower bound of [AD15] on testing the class of PBDs. The reader is referred to Theorem 6.1 for the formal statement of our reduction-based lower bound theorem. In this section, we state the concrete corollaries we obtain for specific structured distribution families:
Testing log-concavity, convexity, concavity, MHR, unimodality, -modality, -histograms, and -piecewise degree- distributions each require samples (the last three for and , respectively), for any .
Testing the classes of Binomial and Poisson Binomial Distributions each require samples, for any .
There exist absolute constants and such that testing the class of -SIIRV distributions requires \Omega\big{(}k^{1/2}n^{1/4}\big{)} samples, for any and .
Tolerant testing of log-concavity, convexity, concavity, MHR, unimodality, and -modality can be performed with O\big{(}\frac{1}{(\varepsilon_{2}-\varepsilon_{1})^{2}}\frac{n}{\log n}\big{)} samples, for (where is an absolute constant).
Tolerant testing of the classes of Binomial and Poisson Binomial Distributions can be performed with O\big{(}\frac{1}{(\varepsilon_{2}-\varepsilon_{1})^{2}}\frac{\sqrt{n\log({1}/{\varepsilon_{1}})}}{\log n}\big{)} samples, for (where is an absolute constant).
Tolerant testing of log-concavity, convexity, concavity, MHR, unimodality, and -modality each require samples (the latter for ).
Tolerant testing of the classes of Binomial and Poisson Binomial Distributions each require samples.
We point out that our main theorem is likely to apply to many other classes of structured distributions, due to the mild structural assumptions it requires. However, we did not attempt here to be comprehensive; but rather to illustrate the generality of our approach. Moreover, for all properties considered in this paper the generic upper and lower bounds we derive through our methods turn out to be optimal up to at most polylogarithmic factors (with regard to the support size). The reader is referred to Table 1 for a summary of our results and related work.
2 Organization of the Paper
We start by giving the necessary background and definitions in Section 2, before turning to our main result, the proof of Theorem 1.1 (our general testing algorithm) in Section 3. In Section 4, we establish the necessary structural theorems for each classes of distributions considered, enabling us to derive the upper bounds of Table 1. Section 5 introduces a slight modification of our algorithm which yields stronger testing results for classes of distributions with small effective support, and use it to derive Section 1.1, our upper bound for Poisson Binomial distributions. Second, Section 6 contains the details of our lower bound methodology, and of its applications to the classes of Table 1. Finally, Section 6.2 is concerned with the extension of this methodology to tolerant testing, of which Section 7 describes a generic upper bound counterpart.
Notation and Preliminaries
We give here the formal descriptions of the classes of distributions involved in this work. Recall that a distribution over is monotone (non-increasing) if its probability mass function (pmf) satisfies . A natural generalization of the class of monotone distributions is the set of -modal distributions, i.e. distributions whose pmf can go “up and down” or “down and up” up to times:Note that this slightly deviates from the Statistics literature, where only the peaks are counted as modes (so that what is usually referred to as a bimodal distribution is, according to our definition, -modal).
Fix any distribution over , and integer . is said to have modes if there exists a sequence such that either for all , or for all . We call -modal if it has at most modes, and write for the class of all -modal distributions (omitting the dependence on ). The particular case of corresponds to the set of unimodal distributions.
A distribution over is said to be log-concave if it satisfies the following conditions: (i) for any such that , ; and (ii) for all , . We write for the class of all log-concave distributions (omitting the dependence on ).
A distribution over is said to be concave if it satisfies the following conditions: (i) for any such that , ; and (ii) for all such that , ; it is convex if the reverse inequality holds in (ii). We write (resp. ) for the class of all concave (resp. convex) distributions (omitting the dependence on ).
It is not hard to see that convex and concave distributions are unimodal; moreover, every concave distribution is also log-concave, i.e. . Note that in both Section 2.1 and Section 2.1, condition (i) is equivalent to enforcing that the distribution be supported on an interval.
A distribution over is said to have monotone hazard rate (MHR) if its hazard rate is a non-decreasing function. We write for the class of all MHR distributions (omitting the dependence on ).
It is known that every log-concave distribution is both unimodal and MHR (see e.g. [An96, Proposition 10]), and that monotone distributions are MHR. Two other classes of distributions have elicited significant interest in the context of density estimation, that of histograms (piecewise constant) and piecewise polynomial densities:
A distribution over is said to be a -piecewise degree- distribution if there is a partition of into disjoint intervals such that for all , where each is a univariate polynomial of degree at most . We write for the class of all -piecewise degree- distributions (omitting the dependence on ). (We note that -piecewise degree- distributions are also commonly referred to as -histograms, and write for .)
Finally, we recall the definition of the two following classes, which both extend the family of Binomial distributions : the first, by removing the need for each of the independent Bernoulli summands to share the same bias parameter.
It is not hard to show that Poisson Binomial Distributions are in particular log-concave. One can generalize even further, by allowing each random variable of the summation to be integer-valued:
2 Tools from previous work
Let be a distribution on a domain . (a) If , then . (b) If , then .
To check condition (b) above we shall rely on the following, which one can derive from the techniques in [DKN15b] and whose proof we defer to Appendix A:
If , then the algorithm outputs no with probability at least ;
If , then the algorithm outputs yes with probability at least .
Finally, we will also rely on a classical result from Probability, the Dvoretzky–Kiefer–Wolfowitz (DKW) inequality, restated below:
Let be a distribution over . Given independent samples from , define the empirical distribution as follows:
In particular, this implies that samples suffice to learn a distribution up to in Kolmogorov distance.
The General Algorithm
In this section, we obtain our main result, restated below: See 1.1
Turning to the proof, we start by defining formally the “structural criterion” we shall rely on, before describing the algorithm at the heart of our result in Section 3.1. (We note that a modification of this algorithm will be described in Section 5, and will allow us to derive Section 1.1.)
.
Further, if is dyadic (i.e., each is of the form for some integers , corresponding to the leaves of a recursive bisection of ), then is said to be -splittable.
If is -decomposable, then it is -splittable.
In order to complete the proof of the lemma, notice that the two conditions in Section 3 are closed under taking subsets. ∎
1 The algorithm
Theorem 1.1, and with it Section 1.1 and Section 1.1 will follow from the theorem below, combined with the structural theorems from Section 4:
Let be a class of distributions over for which the following holds.
is -splittable;
Then, the algorithm TestSplittable (Algorithm 1) is a -sample tester for , for . (Moreover, if is computationally efficient, then so is TestSplittable.)
2 Proof of Theorem 3.1
We now give the proof of our main result (Theorem 3.1), first analyzing the sample complexity of Algorithm 1 before arguing its correctness. For the latter, we will need the following simple lemma from [ILR12], restated below:
Let be a distribution over , and . Given independent samples from (for some absolute constant ), with probability at least we have that, for every interval :
if , then ;
if , then ;
if , then ;
where is the number of the samples falling into .
3 Sample complexity.
The sample complexity is immediate, and comes from Steps 6 and 22. The total number of samples is
4 Correctness.
Say an interval considered during the execution of the “Decomposition” step is heavy if is big enough on Step 9, and light otherwise; and let and denote the sets of heavy and light intervals respectively. By choice of and a union bound over all possible intervals, we can assume on one hand that with probability at least the guarantees of 3.2 hold simultaneously for all intervals considered. We hereafter condition on this event.
We first argue that if the algorithm does not reject in Step 15, then with probability at least we have . Indeed, we can write
If , then by our choice of threshold we can apply Section 2.2 with ; conditioning on all of the (at most ) events happening, which overall fails with probability at most by a union bound, we get
If , then we claim that . Clearly, this is true if , so it only remains to show that . But this follows from 3.2 i, as if we had then would have been big enough, and . Overall,
for a sufficiently big choice of constant in the definition of ; where we first used that , and then that by Jensen’s inequality.
Overall, this happens except with probability at most .
Assume . Then the choice of of and ensures the existence of a good dyadic partition in the sense of Section 3. For any in this partition for which i holds (), will have and be kept as a “light leaf” (this by contrapositive of 3.2 ii). For the other ones, ii holds: let be one of these (at most ) intervals.
If is too small on Step 9, then is kept as “light leaf.”
Structural Theorems
In this section, we show that a wide range of natural distribution families are succinctly decomposable, and provide efficient projection algorithms for each class.
For all , the class of monotone distributions on is -splittable for .
Note that this proof can already be found in [BKR04, Theorem 10], interwoven with the analysis of their algorithm. For the sake of being self-contained, we reproduce the structural part of their argument, removing its algorithmic aspects:
if , then is added as element of (“marked as leaf”);
else, if , then is added as element of (“marked as leaf”);
otherwise, bisect in , (with ) and add both and as elements of .
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 be the number of recursion steps the process goes through before converging to (height of the tree); as mentioned above, we have (as we start with an interval of size , and the length is halved at each step.). Observe further that if at any point an interval has , then it immediately (as well as all the ’s for by monotonicity) satisfies a and is no longer split (“becomes a leaf”). So at any , the number of intervals for which neither a nor b holds must satisfy
where denotes the beginning of the -th interval (again we use monotonicity to argue that the extrema were reached at the ends of each interval), so that . In particular, the total number of internal nodes is then
For all , the class of unimodal distributions on is -decomposable for .
For any , can be partitioned in two intervals , such that , are either monotone non-increasing or non-decreasing. Applying Theorem 4.1 to and and taking the union of both partitions yields a (no longer necessarily dyadic) partition of . ∎
The same argument yields an analogue statement for -modal distributions:
For any and all , the class of -modal distributions on is -decomposable for .
For all , the classes , and of log-concave, concave and convex distributions on are -decomposable for .
This is directly implied by Section 4.1, recalling that log-concave, concave and convex distributions are unimodal. ∎
For all , the class of MHR distributions on is -decomposable for .
For all , , the class of -piecewise degree- distributions on is -decomposable for . (Moreover, for the class of -histograms () one can take .)
The last part of the statement is obvious, so we focus on the first claim. Observing that each of the pieces of a distribution can be subdivided in at most intervals on which is monotone (being degree- polynomial on each such pieces), we obtain a partition of into at most intervals. 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 subintervals, yielding a good decomposition with pieces. ∎
2 Projection Step: computing the distances
We focus in this section on achieving the sample complexities stated in Section 1.1, Section 1.1, and Section 1.1. While almost all the distance estimation procedures we give in this section are efficient, running in time polynomial in all the parameters or even with only a polylogarithmic dependence on , there are two exceptions – namely, the procedures for monotone hazard rate (Section 4.2) and log-concave (Section 4.2) distributions. We do describe computationally efficient procedures for these two cases as well in Section 4.2.1, at a modest additive cost in the sample complexity.
We here give a naive algorithm for these two problems, based on an exhaustive search over a (huge) -cover of distributions over . Essentially, contains all possible distributions whose probabilities are of the form , for (so that ). 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 . To approximate the distance from an explicit distribution to the class (either or ), it is enough to go over every element of , checking (this time, efficiently) if and if there is a distribution close to (this time, pointwise, that is for all ) – which also implies and thus . 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. . Indeed, this formulation allows to rephrase the log-concave and MHR constraints as linear constraints, and pointwise approximation is simply enforcing that for all . At the end of this enumeration, the procedure accepts if and only if for some both and the corresponding linear program was feasible. ∎
Before proving it, we describe how this will enable us to get the desired time complexity for . Phrased differently, the claim above allows us to run our dynamic program using the endpoints of the instead of the points of the domain, paying only an additive error . Setting , the guarantee for follows.
Turning now to , we apply the same initial dynamic programming approach, which will result on a running time of , where is the time required to estimate (to sufficient accuracy) the distance of a given (sub)distribution over an interval onto the space of degree- polynomials. Specifically, we will invoke the following result, adapted from [CDSS14a] to our setting:
Combining these ideas yield the following distance estimation lemmas:
If there is such that and , then the procedure returns yes;
If there is such that and , then the procedure returns yes;
Going Further: Reducing the Support Size
Given , the -effective support of a distribution is the smallest interval such that .
The last definition we shall require is of the conditioned distributions of a class :
For any class of distributions over , define the set of conditioned distributions of (with respect to and interval ) as .
Finally, we will require the following simple result:
Let be a distribution over , and an interval such that . Then,
If , then ;
The first item is obvious. As for the second, let be any distribution with . By assumption, : but we have, writing ,
We now proceed to state and prove our result – namely, efficient testing of structured classes of distributions with nice concentration properties.
Let be a class of distributions over for which the following holds.
there is a function such that each has -effective support of size at most ;
for every and interval , is -splittable;
By the choice of and the DKW inequality, with probability at least the estimate satisfies . Conditioning on that from now on, we get that . Furthermore, denoting by and the two inner endpoints of and in Steps 6 and 7, we have (similarly for ), so that has size at most , where is the -effective support size of .
Finally, note that since by our conditioning, the simulation of samples by rejection sampling will succeed with probability at least and the algorithm will not output FAIL.
If , then by the setting of (set to be an upper bound on the -effective support size of any distribution in ) the algorithm will go beyond Step 8. The call to TestSplittable will then end up in the algorithm returning ACCEPT in Step 14, with probability at least by Section 5, Theorem 1.1 and our choice of parameters.
Similarly, if is -far from , then either its effective support is too large (and then the test on Step 8 fails), or the main tester will detect that its conditional distribution on is -far from and output REJECT in Step 14.
Overall, in either case the algorithm is correct except with probability at most (by a union bound). Repeating constantly many times and outputting the majority vote brings the probability of failure down to . ∎
2 Application: Testing Poisson Binomial Distributions
In this section, we illustrate the use of our generic two-stage approach to test the class of Poisson Binomial Distributions. Specifically, we prove the following result:
This is a direct consequence of Theorem 5.1 and the lemmas below. The first one states that, indeed, PBDs have small effective support:
For any , a PBD has -effective support of size .
It is clear that if (and therefore is unimodal), then for any interval the conditional distribution is still unimodal, and thus the class of conditioned PBDs falls under Section 4.1. The last piece we need to apply our generic testing framework is the existence of an algorithm to compute the distance between an (explicit) distribution and the class of conditioned PBDs. This is provided by our next lemma:
For all , there exists a set such that:
is a -cover of ; that is, for all there exists some such that
can be computed in time
and each is explicitly described by its set of parameters.
We further observe that the factor in both the size of the cover and running time can be easily removed in our case, as we know a good approximation of the support size of the candidate PBDs. (That is, we only need to enumerate over a subset of the cover of [DKS15], that of the PBDs with effective support compatible with our distribution .)
Combining the above, we invoke Theorem 5.1 with (5.2) and L(m,\gamma)=O\big{(}\frac{\log^{2}m}{\gamma}\big{)} (Section 4.1). This yields the claimed sample complexity; finally, the efficiency is a direct consequence of Section 5.2. ∎
Lower Bounds
We now turn to proving converses to our positive results – namely, that many of the upper bounds we obtain cannot be significantly improved upon. As in our algorithmic approach, we describe for this purpose a generic framework for obtaining lower bounds.
In order to state our results, we will require the usual definition of agnostic learning. Recall that an algorithm is said to be a semi-agnostic learner for a class if it satisfies the following. Given sample access to an arbitrary distribution and parameter , it outputs a hypothesis which (with high probability) does “almost as well as it gets”:
The motivation for our result is the observation of [BKR04] that “monotonicity is at least as hard as uniformity.” Unfortunately, their specific argument does not generalize easily to other classes of distributions, making it impossible to extend it readily. The starting point of our approach is to observe that while uniformity testing is hard in general, it becomes very easy under the promise that the distribution is monotone, or even only close to monotone (namely, samples suffice). This can give an alternate proof of the lower bound for monotonicity testing, via a different reduction: first, test if the unknown distribution is monotone; if it is, test whether it is uniform, now assuming closeness to monotone.
More generally, this idea applies to any class which (a) contains the uniform distribution, and (b) for which we have a -sample agnostic learner , as follows. Assuming we have a tester for with sample complexity , define a uniformity tester as below.
test if using ; if not, reject (as , cannot be uniform);
otherwise, agnostically learn with (since is close to ), and obtain hypothesis ;
check offline if is close to uniform.
By assumption, and each use samples, so does the whole process; but this contradicts the lower bound of [BFR+00, Pan08] on uniformity testing. Hence, must use samples.
This “testing-by-narrowing” reduction argument can be further extended to other properties than to uniformity, as we show below:
Let be a class of distributions over for which the following holds:
there exists a semi-agnostic learner for , with sample complexity and “agnostic constant” ;
there exists a subclass such that testing requires samples.
Suppose further that . Then, any tester for must use samples.
The above theorem relies on the reduction outlined above, which we rigorously detail here. Assuming , , as above (with semi-agnostic constant ), and a tester for with sample complexity , we define a tester for . On input and given sample access to a distribution on , acts as follows:
call with parameters , (where ) and failure probability , to -test if . If not, reject.
otherwise, agnostically learn a hypothesis for , with called with parameters , and failure probability ;
check offline if is -close to , accept if and only if this is the case.
Observing that the overall sample complexity is concludes the proof. ∎
Finally, we derive a lower bound on testing -SIIRVs from the agnostic learner of [DDO+13] (which has sample complexity samples, independent of ): See 1.1
2 Tolerant Testing
This lower bound framework from the previous section carries to tolerant testing as well, resulting in this analogue to Theorem 6.1:
Let be a class of distributions over for which the following holds:
there exists a semi-agnostic learner for , with sample complexity and “agnostic constant” ;
there exists a subclass such that tolerant testing requires samples for some parameters .
Suppose further that . Then, any tolerant tester for must use samples (for some explicit parameters ).
The argument follows the same ideas as for Theorem 6.1, up to the details of the parameters. Assuming , , as above (with semi-agnostic constant ), and a tolerant tester for with sample complexity , we define a tolerant tester for . On input with , and given sample access to a distribution on , acts as follows. After setting , , and ,
otherwise, agnostically learn a hypothesis for , with called with parameters , and failure probability ;
check offline if is -close to , accept if and only if this is the case.
Observing that the overall sample complexity is concludes the proof. ∎
There exists an absolute constant such that the following holds. Any algorithm which, given sampling access to an unknown distribution on and parameter , distinguishes with probability at least between (i) and (ii) must use samples.
The proof relies on a reduction from tolerant testing of uniformity, drawing on a result of Valiant and Valiant [VV10]; for the sake of conciseness, the details are deferred to Appendix D. With Theorem 6.3 in hand, we can apply Theorem 6.2 to obtain the desired lower bound: See 1.1
We observe that both Section 1.1 and Section 1.1 are tight (with regard to the dependence on ), as proven in the next section (Section 7).
A Generic Tolerant Testing Upper Bound
To conclude this work, we address the question of tolerant testing of distribution classes. In the same spirit as before, we focus on describing a generic approach to obtain such bounds, in a clean conceptual manner. The most general statement of the result we prove in this section is stated below, which we then instantiate to match the lower bounds from Section 6.2:
Let be a class of distributions over for which the following holds:
there exists a semi-agnostic learner for , with sample complexity and “agnostic constant” ;
for any , every distribution in has -effective support of size at most .
Applying now the theorem with (as per Section 5.2), we obtain an improved upper bound for Binomial and Poisson Binomial distributions: See 1.1
Somewhat similar to the lower bound framework developed in Section 6, the gist of the approach is to reduce the problem of tolerant testing membership of to the class to that of tolerant testing identity to a known distribution – namely, the distribution obtained after trying to agnostically learn . Intuitively, an agnostic learner for should result in a good enough hypothesis (i.e., close enough to both and ) when is -close to ; but output a that is significantly far from either or when is -far from – sufficiently for us to be able to tell. Besides the many technical details one has to control for the parameters to work out, one key element is the use of a tolerant testing algorithm for closeness of two distributions due to [VV11b], whose (tight) sample complexity scales as for a domain of size . In order to get the right dependence on the effective support (required in particular for Section 1.1), we have to perform a first test to identify the effective support of the distribution and check its size, in order to only call this tolerant closeness testing algorithm on this much smaller subset. (This additional preprocessing step itself has to be carefully done, and comes at the price of a slightly worse constant in the statement of the theorem.)
1 Proof of Theorem 7.1
As described in the preceding section, the algorithm will rely on the ability to perform tolerant testing of equivalence between two unknown distributions (over some known domain of size ). This is ensured by an algorithm of Valiant and Valiant, restated below:
There exists an algorithm which, given sampling access to two unknown distributions over , satisfies the following. On input , it takes samples from and , and outputs a value such that with probability . (Furthermore, runs in time .)
For the proof, we will also need this fact, similar to Section 5, which relates the distance of two distributions to that of their conditional distributions on a subset of the domain:
Let and be distributions over , and an interval such that and . Then,
(the last inequality for ); and
.
where we used the fact that . Turning now to the second item, we have:
With these two ingredients, we are in position to establish our theorem:
The algorithm proceeds as follows, where we set , , and :
invoke on with parameters and failure probability , to obtain a hypothesis ;
call (from Theorem 7.2) on , with parameter to get an estimate of ;
output REJECT is , 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., and ), which happens with probability at least by a union bound.
and the algorithm does not reject in Step 4. To conclude, one has by 7.3 that
Finally, the testing algorithm defined above is computationally efficient as long as both the learning algorithm (Step 2) and the estimation procedure (Step 5) are.
References
Appendix A Proof of Section 2.2
We now give the proof of Section 2.2, restated below: See 2.2
To do so, we first describe an algorithm that distinguishes between and with probability at least , using samples. Boosting the success probability to at the price of a multiplicative factor can then be achieved by standard techniques.
Similarly as in the proof of Theorem 11 (whose algorithm we use, but with a threshold instead of ), define the quantities
(after expanding and since ).
As , we get , and thus (as and ).
Similarly, .
we get that , using the fact that (by choice of ).
Overall, the LHS is at most , as claimed.
Assume . We need to show that . Chebyshev’s inequality implies
and therefore it is sufficient to show that
Since , we get that the second term is at most . All that remains is to show that . But as , ; and our choice of for some absolute constant ensures this holds. ∎
Appendix B Proof of Theorem 4.2
In this section, we prove our structural result for MHR distributions, Theorem 4.2: See 4.2
We reproduce and adapt the argument of [CDSS13, Section 5.1] to meet our definition of decomposability (which, albeit related, is incomparable to theirs). First, we modify the algorithm at the core of their constructive proof, in Algorithm 3: note that the only two changes are in Steps 3 and 4, where we use parameters respectively and .
Following the structure of their proof, we write with , and define , .
We immediately obtain the analogues of their Lemmas 5.2 and 5.3:
We have .
Step 5 of Algorithm 3 adds at most intervals to .
This derives from observing that now , which as in [CDSS13, Lemma 5.3] in turn implies
so that .
Again following their argument, we also get
by combining Appendix B with the fact that and that by construction , we get
But since each term in the product is at least (by construction of and the definition of ), this leads to
and thus as well. ∎
It remains to show that is indeed a good decomposition of for , as per Section 3. Since by construction every interval in satisfies item ii, we only are left with the case of , and . 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 (by the choice of parameters for Right-Interval) and thus item i is satisfied. Finally, it is immediate to see that by construction , 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 -piecewise degree- (Theorem 4.4), monotone hazard rate (Section 4.2.1), and log-concave distributions (Section 4.2.1).
As mentioned in Section 4, the proof of this statement is a rather straightforward adaption of the proof of [CDSS14a, Theorem 9], with two differences: first, in our setting there is no uncertainty nor probabilistic argument due to sampling, as we are provided with an explicit description of the histogram . Second, Chan et al. require some “well-behavedness” assumption on the distribution (for technical reasons essentially due to the sampling access), that we remove here. Besides these two points, the proof is almost identical to theirs, and we only reproduce (our modification of) it here for the sake of completeness. (Any error introduced in the process, however, is solely our responsibility.)
Some preliminary definitions will be helpful:
We will also use the following notation: For this subsection, let ( will denote a subinterval of when the results are applied in the next subsection). We write to denote , and we write to denote . We write to denote the infimum of the distance between and any degree- subdistribution on that satisfies .
The key step of ProjectSinglePoly is Step 4 where it calls the FindSinglePoly procedure. In this procedure denotes the degree- Chebychev polynomial of the first kind. The function FindSinglePoly should be thought of as the CDF of a “quasi-distribution” ; we say that is a “quasi-distribution” and not a bona fide probability distribution because it is not guaranteed to be non-negative everywhere on . Step 4 of FindSinglePoly processes slightly to obtain a polynomial which is an actual distribution over
We begin by observing that ProjectSinglePoly calls FindSinglePoly with input parameters that satisfy FindSinglePoly’s input requirements:
the non-singleton intervals are -uniform; and
the singleton intervals each have weight at least .
We then proceed to show that, from there, FindSinglePoly’s LP is feasible and has a high-quality optimal solution.
We first argue feasibility of the above solution. We first take care of the easy constraints: since is the cdf of a subdistribution over it is clear that constraints a and e are satisfied, and since both and 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 and satisfying -inequalities, therefore this constraint is satisfied.
To see that constraint d is satisfied we recall some of the analysis of Arora and Khot [AK03, Section 3]. This analysis shows that since is a cumulative distribution function (and in particular a function bounded between 0 and 1 on ) each of its Chebychev coefficients is at most in magnitude.
So is indeed a degree- pdf. To prove Theorem C.1 it remains to show that
We will use the following lemma that translates -inequalities into a bound on distance.
To analyze , consider any union of disjoint non-overlapping intervals . We will bound by bounding .
Now rewrite as a disjoint union of intervals . We have
by -inequalities between and . Now observing that that , we get that the largest possible value of is , so the RHS of (7) is at most , as desired. ∎
Next, by the triangle inequality we have (writing for )
The last term on the RHS has just been shown to be . The first term is bounded by
Altogether, we get that .
Since and are degree polynomials, . This implies . Finally, we turn our quasidistribution which has value everywhere into a distribution (which is nonnegative), by redistributing the weight. The following simple proposition bounds the error incurred.
Let and be any sub-quasidistribution on . If , then .
We now have by Section C.1, concluding the proof of Theorem C.1. ∎
C.2 Proof of Section 4.2.1
For convenience, let ; we also write instead of .
is -far from monotone hazard rate
We then proceed by observing the following easy fact: suppose is a MHR distribution on , i.e. such that the quantity , is non-increasing. Then, we have
and there is a bijective correspondence between and .
We will write a linear program with variables , with the correspondence . Note that with this parameterization, we get that if the correspond to a MHR distribution , then for
and asking that amounts to requiring
We focus first on the completeness case, to provide intuition for the linear program. Suppose there exists such such that and . This implies that for all , . Define to be the longest interval such that . It follows that for every ,
and similarly . This means that for the points in , we can write constraints asking for multiplicative closeness (within between and , which is very easy to write down as linear constraints on the ’s.
Let and be respectively the sets of “light” and “heavy” points, defined as and , where is as above. (In particular, .)
Suppose is as promised. In particular, by the Kolmogorov distance assumption we know that every has .
For any , we have that , and
For , Constraint (18) is also met, as .
To analyze the contribution from , we observe that Constraint (18) implies that, for any ,
which combined with Constraint (14) guarantees
The running time is immediate, from executing the two linear programs on variables and constraints. ∎
C.3 Proof of Section 4.2.1
We set , , and (so that ),
Given the explicit description of a distribution on , which a -histogram over a partition of with and the explicit description of a distribution on , one must efficiently distinguish between:
is -far from log-concave.
If we are willing to pay an extra factor of , we can assume without loss of generality that we know the mode of the closest log-concave distribution (which is implicitly assumed in the following: the final algorithm will simply try all possible modes).
We will require the following result of Chan, Diakonikolas, Servedio, and Sun:
Let be a distribution over , log-concave and non-decreasing over . Let such that , and write . Then .
C.3.1 Step 1
is -far from log-concave;
This way, we have reduced the problem to a slightly more convenient one, that of Section C.3.2.
The next step is to compute a good approximation of the support of any target log-concave distribution. This is easily obtained in time as the interval such that
but ; and
but .
C.3.2 Step 2
Given the explicit description of a unimodal distribution on , which a -histogram over a partition of with , one must efficiently distinguish between:
is -far from log-concave,
assuming we know the mode of the closest log-concave distribution, which has support .
As is unimodal, we can efficiently () find the interval of heavy points, that is
Each point in will form a singleton interval in our partition. Let be its complement ( is the union of at most two intervals on which 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” (on which is non-decreasing).
Greedily find , the smallest prefix of the distribution satisfying .
Similarly, partition into intervals (with ) such that for all , and . This is possible as all points not in have weight less than , and .
We focus on the completeness case: let be a log-concave distribution such that and . Applying Theorem C.2 on and the ’s, we obtain (using the fact that ) that:
Moreover, we also get that each resulting interval will satisfy
with .
The (at most) two end intervals have , and thus ;
each other interval satisfies
with ; and
We will use in the constraints of the linear program the fact that , and .
C.3.3 Step 3
A feasible solution to this linear program will define (setting ) a sequence such that
is “-multiplicatively constant” on each interval (from (24));
puts roughly the right amount of weight on each :
it puts weight approximately on every singleton from , i.e. such that . To see why, observe that each is in by constraints (27). In particular, this means that , and we have
If There is in such that and , then the linear program (Algorithm 7) has a feasible solution.
Let such that and . Define for all . Constraints (22) and (23) are immediately satisfied, since is log-concave. By the discussion from Section C.3.2 (more specifically, Eq. (20) and (21)), constraint (24) holds as well.
Letting for , we also immediately have (26) and (27) (since and by assumption). Finally, to see why (25) is satisfied, we rewrite
and use the fact that and (the latter for , along with ). ∎
C.3.4 Putting it all together: Proof of Section 4.2
The algorithm is as follows (keeping the notations from Section C.3.1 to Section C.3.3):
For each of the possible modes :
Run the linear program Algorithm 7, return ACCEPT if a feasible solution is found
None of the linear programs was feasible: return REJECT.
The correctness comes from Section C.3.3 and Section C.3.3 and the discussions in Section C.3.1 to Section C.3.3; as for the claimed running time, it is immediate from the algorithm and the fact that the linear program executed each step has constraints and variables.
Appendix D Proof of Theorem 6.3
In this section, we establish our lower bound for tolerant testing of the Binomial distribution, restated below:
See 6.3 The theorem will be a consequence of the (slightly) more general result below:
There exist absolute constants and such that the following holds. Any algorithm which, given access to an unknown distribution on and parameter , distinguishes with probability at least between (i) and (ii) must use samples.
By choosing a suitable and working out the corresponding parameters, this for instance enables us to derive the following:
There exists an absolute constant such that the following holds. Any algorithm which, given access to an unknown distribution on , distinguishes with probability at least between (i) and (ii) must use samples.
By standard techniques, this will in turn imply Theorem 6.3.
Hereafter, we write for convenience . To prove this lower bound, we will rely on the following:
For any constant , following holds. Any algorithm which, given access to an unknown distribution on , distinguishes with probability at least between (i) and (ii) , must have sample complexity at least .
Without loss of generality, assume is even (so that has only one mode located at ). For , we write for the interval and .
The reduction proceeds as follows: given sampling access to on , we can simulate sampling access to a distribution on (where ) such that
if , then ;
if , then
for and ; in a way that preserves the sample complexity.
More precisely, define (so that ) and such that (that is, ). From now on, we can therefore identify to in the obvious way, and see a draw from as an element in .
Let , and , respectively denote the conditional distributions induced by on and . Intuitively, we want to be mapped to the conditional distribution of on , and the conditional distribution of on to be exactly . This is done as by defining by the process below:
with probability , we draw a sample from (seen as an element of ;
with probability , we draw a sample from .
If , then by the triangle inequality ;
If , then similarly .
Recalling that and setting concludes the reduction. From Theorem D.2, we conclude that
The corollary follows from the proof of Appendix D, by taking and computing the corresponding and to check that indeed . ∎