Authors Constantinos Daskalakis, Ilias Diakonikolas, Rocco A. Servedio,
License CC-BY-3.0
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570
www.theoryofcomputing.org
Learning k-Modal Distributions via Testing
Constantinos Daskalakis∗ Ilias Diakonikolas† Rocco A. Servedio‡
Received April 11, 2013; Revised November 9, 2014; Published December 31, 2014
Abstract: A k-modal probability distribution over the discrete domain {1, . . . , n} is one
whose histogram has at most k “peaks” and “valleys.” Such distributions are natural gener-
alizations of monotone (k = 0) and unimodal (k = 1) probability distributions, which have
been intensively studied in probability theory and statistics.
In this paper we consider the problem of learning (i. e., performing density estimation
of) an unknown k-modal distribution with respect to the L1 distance. The learning algorithm
is given access to independent samples drawn from an unknown k-modal distribution p, and
it must output a hypothesis distribution pb such that with high probability the total variation
distance between p and pb is at most ε. Our main goal is to obtain computationally efficient
algorithms for this problem that use (close to) an information-theoretically optimal number
of samples.
We give an efficient algorithm for this problem that runs in time poly(k, log(n), 1/ε).
For k ≤ Õ(log n), the number of samples used by our algorithm is very close (within an
A preliminary version of this work appeared in the Proceedings of the Twenty-Third Annual ACM-SIAM Symposium on
Discrete Algorithms (SODA 2012) [8].
∗ costis@csail.mit.edu. Research supported by NSF CAREER award CCF-0953960 and by a Sloan Foundation
Fellowship.
† ilias.d@ed.ac.uk. Most of this research was done while the author was at UC Berkeley supported by a Simons
Postdoctoral Fellowship. Some of this work was done at Columbia University, supported by NSF grant CCF-0728736, and by
an Alexander S. Onassis Foundation Fellowship.
‡ rocco@cs.columbia.edu. Supported by NSF grants CNS-0716245, CCF-0915929, and CCF-1115703.
ACM Classification: F.2.2, G.3
AMS Classification: 68W20, 68Q25, 68Q32
Key words and phrases: computational learning theory, learning distributions, k-modal distributions
© 2014 Constantinos Daskalakis, Ilias Diakonikolas, and Rocco A. Servedio
c b Licensed under a Creative Commons Attribution License (CC-BY) DOI: 10.4086/toc.2014.v010a020
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
Õ(log(1/ε)) factor) to being information-theoretically optimal. Prior to this work computa-
tionally efficient algorithms were known only for the cases k = 0, 1 (Birgé 1987, 1997).
A novel feature of our approach is that our learning algorithm crucially uses a new
algorithm for property testing of probability distributions as a key subroutine. The learning
algorithm uses the property tester to efficiently decompose the k-modal distribution into k
(near-)monotone distributions, which are easier to learn.
1 Introduction
This paper considers a natural unsupervised learning problem involving k-modal distributions over the
discrete domain [n] ={1, . . . , n}. A distribution is k-modal if the plot of its probability density function
(pdf) has at most k “peaks” and “valleys” (see Section 2.1 for a precise definition). Such distributions
arise both in theoretical (see, e. g., [7, 19, 6]) and applied (see, e. g., [20, 1, 13]) research; they naturally
generalize the simpler classes of monotone (k = 0) and unimodal (k = 1) distributions that have been
intensively studied in probability theory and statistics (see the discussion of related work below).
Our main aim in this paper is to give an efficient algorithm for learning an unknown k-modal
distribution p to total variation distance ε, given access only to independent samples drawn from p. As
described below there is an information-theoretic lower bound of Ω(k log(n/k)/ε 3 ) samples for this
learning problem, so an important goal for us is to obtain an algorithm whose sample complexity is as
close as possible to this lower bound. An equally important goal is for our algorithm to be computationally
efficient, i. e., to run in time polynomial in the size of its input sample. Our main contribution in this
paper is a computationally efficient algorithm that has nearly optimal sample complexity for small (but
super-constant) values of k.
1.1 Background and relation to previous work
There is a rich body of work in the statistics and probability literatures on estimating distributions under
various kinds of “shape” or “order” restrictions. In particular, many researchers have studied the risk
of different estimators for monotone (k = 0) and unimodal (k = 1) distributions; see for example the
works of [23, 26, 17, 3, 4, 5], among many others. These and related papers from the probability/statistics
literature mostly deal with information-theoretic upper and lower bounds on the sample complexity of
learning monotone and unimodal distributions. In contrast, a central goal of the current work is to obtain
computationally efficient learning algorithms for larger values of k.
It should be noted that some of the works cited above do give efficient algorithms for the cases
k = 0 and k = 1; in particular we mention the results of Birgé [4, 5], which give computationally
efficient O(log(n)/ε 3 )-sample algorithms for learning unknown monotone or unimodal distributions over
[n] respectively. (Birgé [3] also showed that this sample complexity is asymptotically optimal, as we
discuss below; we describe the algorithm of [4] in more detail in Section 2.2, and indeed use it as an
ingredient of our approach throughout this paper.) However, for these relatively simple k = 0, 1 classes
of distributions the main challenge is in developing sample-efficient estimators, and the algorithmic
aspects are typically rather straightforward (as is the case in [4]). In contrast, much more challenging and
interesting algorithmic issues arise for the general values of k which we consider here.
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 536
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
1.2 Our results
Our main result is a highly efficient algorithm for learning an unknown k-modal distribution over [n]:
Theorem 1.1. Let p be any unknown k-modal distribution over [n]. There is an algorithm that uses1
k log(n/k) k2
k k
+ 3 · log · log log · Õ(log(1/δ ))
ε3 ε ε ε
samples from p, runs for poly(k, log n, 1/ε, log(1/δ )) bit operations, and with probability 1 − δ outputs a
(succinct description of a) hypothesis distribution h over [n] such that the total variation distance between
p and h is at most ε.
As alluded to earlier, Birgé [3] gave a sample complexity lower bound for learning monotone
distributions. The lower bound in [3] is stated for continuous distributions but the arguments are easily
adapted to the discrete case; [3] shows that (for ε ≥ 1/nΩ(1) )2 any algorithm for learning an unknown
monotone distribution over [n] to total variation distance ε must use Ω(log(n)/ε 3 ) samples. By a simple
construction which concatenates k copies of the monotone lower bound construction over intervals of
length n/k, using the monotone lower bound it is possible to show:
Proposition 1.2. Any algorithm for learning an unknown k-modal distribution over [n] to variation
distance ε (for ε ≥ 1/nΩ(1) ) must use Ω(k log(n/k)/ε 3 ) samples.
Thus our learning algorithm is nearly optimal in its sample complexity; more precisely, for k ≤
Õ(log n) (and ε as bounded above), our sample complexity in Theorem 1.1 is asymptotically optimal up to
a factor of Õ(log(1/ε)). Since each draw from a distribution over [n] is a log(n)-bit string, Proposition 1.2
implies that the running time of our algorithm is optimal up to polynomial factors. As far as we are
aware, prior to this work no learning algorithm for k-modal distributions was known that simultaneously
had poly(k, log n) sample complexity and even running time q(n) for a fixed polynomial q(n) (where the
exponent does not depend on k).
1.3 Our approach
As mentioned in Section 1.1 Birgé, gave a highly efficient algorithm for learning a monotone distribution
in [4]. Since a k-modal distribution is simply a concatenation of k + 1 monotone distributions (first
non-increasing, then non-decreasing, then non-increasing, etc.), it is natural to try to use Birgé’s algorithm
as a component of an algorithm for learning k-modal distributions, and indeed this is what we do.
The most naive way to use Birgé’s algorithm would be to guess all possible nk locations of the k
“modes” of p. While such an approach can be shown to have good sample complexity, the resulting Ω(nk )
running time is grossly inefficient. A “moderately naive” approach, which we analyze in Section 3.1,
is to partition [n] into roughly k/ε intervals each of weight roughly ε/k, and run Birgé’s algorithm
1 We write Õ(·) to hide factors which are poly-logarithmic in the argument to Õ(·); thus for example Õ(a log b) denotes a
quantity which is O((a log b) · (log(a log b))c ) for some absolute constant c.
2 For ε sufficiently small the generic upper bound of Fact A.1, which says that any distribution over [n] can be learned to
variation distance ε using O(n/ε 2 ) samples, provides a better bound.
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 537
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
separately on each such interval. Since the target distribution is k-modal, at most k of the intervals can
be non-monotone; Birgé’s algorithm can be used to obtain an ε-accurate hypothesis on each monotone
interval, and even if it fails badly on the (at most) k non-monotone intervals, the resulting total contribution
towards the overall error from those failures is at most O(ε). This approach is much more efficient than
the totally naive approach, giving running time polynomial in k, log n, and 1/ε, but its sample complexity
turns out to be polynomially worse than the O(k log(n)/ε 3 ) that we are shooting for. (Roughly speaking,
this is because the approach involves running Birgé’s O(log(n)/ε 3 )-sample algorithm Ω(k/ε) times, so
it uses at least k log(n)/ε 4 samples.)
Our main learning result is achieved by augmenting the “moderately naive” algorithm sketched above
with a new property testing algorithm. Unlike a learning algorithm, a property testing algorithm for
probability distributions need not output a high-accuracy hypothesis; instead, it has the more modest goal
of successfully (with high probability) distinguishing between probability distributions that have a given
property of interest, versus distributions that are far (in total variation distance) from every distribution
that has the property. See [16, 25, 14] for broad overviews of property testing.
We give a property testing algorithm for the following problem: given samples from a distribution p
over [n] which is promised to be k-modal, output “yes” (with high probability) if p is monotone and “no”
(with high probability) if p is ε-far in total variation distance from every monotone distribution. Crucially,
our testing algorithm uses O(k/ε 2 ) samples independent of n for this problem. Roughly speaking, by
using this algorithm O(k/ε) times we are able to identify k + 1 intervals that (i) collectively contain
almost all of p’s mass, and (ii) are each (close to) monotone and thus can be handled using Birgé’s
algorithm. Thus the overall sample complexity of our approach is (roughly) O(k2 /ε 3 ) (for the O(k/ε)
runs of the tester) plus O(k log(n)/ε 3 ) (for the k runs of Birgé’s algorithm), which gives Theorem 1.1 and
is very close to optimal for k not too large.
1.4 Discussion
Our learning algorithm highlights a novel way that property testing algorithms can be useful for learning.
Much research has been done on understanding the relation between property testing algorithms and
learning algorithms, see, e. g., [16, 18] and the lengthy survey [24]. As Goldreich has noted [15], an
often-invoked motivation for property testing is that (inexpensive) testing algorithms can be used as
a “preliminary diagnostic” to determine whether it is appropriate to run a (more expensive) learning
algorithm. In contrast, in this work we are using property testing rather differently, as an inexpensive way
of decomposing a “complex” object (a k-modal distribution) which we do not a priori know how to learn,
into a collection of “simpler” objects (monotone or near-monotone distributions) which can be learned
using existing techniques. We are not aware of prior learning algorithms that successfully use property
testers in this way; we believe that this high-level approach to designing learning algorithms, by using
property testers to decompose “complex” objects into simpler objects that can be efficiently learned, may
find future applications elsewhere.
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 538
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
2 Preliminaries
2.1 Notation and problem statement
For n ∈ Z+ , denote by [n] the set {1, . . . , n}; for i, j ∈ Z+ , i ≤ j, denote by [i, j] the set {i, i + 1, . . . , j}.
We write v(i) to denote the i-th element of vector v ∈ Rn . For v = (v(1), . . . , v(n)) ∈ Rn denote by
n
kvk1 = ∑ |v(i)|
i=1
its L1 -norm.
We consider discrete probability distributions over [n], which are functions p : [n] → [0, 1] such that
n
∑i=1 p(i) = 1. For S ⊆ [n] we write p(S) to denote ∑i∈S p(i). For S ⊆ [n], we write pS to denote the
conditional distribution over S that is induced by p. We use the notation P for the cumulative distribution
j
function (cdf) corresponding to p, i. e., P : [n] → [0, 1] is defined by P( j) = ∑i=1 p(i).
A distribution p over [n] is non-increasing (resp. non-decreasing) if p(i + 1) ≤ p(i) (resp. p(i + 1) ≥
p(i)), for all i ∈ [n − 1]; p is monotone if it is either non-increasing or non-decreasing. We call a nonempty
interval I = [a, b] ⊆ [2, n − 1] a max-interval of p if p(i) = c for all i ∈ I and max{p(a − 1), p(b + 1)} < c;
in this case, we say that the point a is a left max point of p. Analogously, a min-interval of p is an interval
I = [a, b] ⊆ [2, n − 1] with p(i) = c for all i ∈ I and min{p(a − 1), p(b + 1)} > c; the point a is called a
left min point of p. If I = [a, b] is either a max-interval or a min-interval (it cannot be both) we say that I
is an extreme-interval of p, and a is called a left extreme point of p. Note that any distribution uniquely
defines a collection of extreme-intervals (hence, left extreme points). We say that p is k-modal if it has at
most k extreme-intervals. We write Dn (resp. Mkn ) to denote the set of all distributions (resp. k-modal
distributions) over [n].
Let p, q be distributions over [n] with corresponding cdfs P, Q. The total variation distance between
p and q is
dTV (p, q) := max |p(S) − q(S)| = (1/2) · kp − qk1 .
S⊆[n]
The Kolmogorov distance between p and q is defined as
dK (p, q) := max |P( j) − Q( j)| .
j∈[n]
Note that dK (p, q) ≤ dTV (p, q).
We will also need a more general distance measure that captures the above two metrics as special
cases. Fix a family of subsets A over [n]. We define the A–distance between p and q by
kp − qkA := max |p(A) − q(A)| .
A∈A
(Note that if A = 2[n] , the powerset of [n], then the A–distance is identified with the total variation
distance, while when A = {[1, j], j ∈ [n]} it is identified with the Kolmogorov distance.) Also recall
that the VC–dimension of A is the maximum size of a subset X ⊆ [n] that is shattered by A (a set X is
shattered by A if for every Y ⊆ X some A ∈ A satisfies A ∩ X = Y ).
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 539
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
Learning k-modal Distributions. Given independent samples from an unknown k-modal distribution
p ∈ Mkn and ε > 0, the goal is to output a hypothesis distribution h such that with probability 1 − δ we
have dTV (p, h) ≤ ε. We say that such an algorithm A learns p to accuracy ε and confidence δ . The
parameters of interest are the number of samples and the running time required by the algorithm.
2.2 Basic tools
We recall some useful tools from probability theory.
The VC inequality. Given m independent samples s1 , . . . , sm , drawn from p : [n] → [0, 1], the empirical
distribution pbm : [n] → [0, 1] is defined as follows: for all i ∈ [n],
|{ j ∈ [m] | s j = i}|
pbm (i) = .
m
Fix a family of subsets A over [n] of VC–dimension d. The VC inequality states that for m = Ω(d/ε 2 ),
with probability 9/10 the empirical distribution pbm will be ε-close to p in A-distance. This sample bound
is asymptotically optimal.
Theorem 2.1 (VC inequality, [12, p.31]). Let pbm be an empirical distribution of m samples from p. Let
A be a family of subsets of VC–dimension d. Then
p
E [kp − pbm kA ] ≤ O( d/m) .
Uniform convergence. We will also use the following uniform convergence bound:
Theorem 2.2 ([12, p.17]). Let A be a family of subsets over [n], and pbm be an empirical distribution of
m samples from p. Let X be the random variable kp − pbm kA . Then we have
2
Pr [X − E[X] > η] ≤ e−2mη .
Our second tool, due to Birgé [4], provides a sample-optimal and computationally efficient algorithm
to learn monotone distributions to ε-accuracy in total variation distance. Before we state the relevant
theorem, we need a definition. We say that a distribution p is δ -close to being non-increasing (resp. non-
decreasing) if there exists a non-increasing (resp. non-decreasing) distribution q such that dTV (p, q) ≤ δ .
We are now ready to state Birgé’s result:
Theorem 2.3 ([4], Theorem 1). (semi-agnostic learner) There is an algorithm L↓ with the following
performance guarantee: Given m independent samples from a distribution p over [n] which is opt-close
to being non-increasing, L↓ performs
Õ m · log n + m1/3 · (log n)5/3
bit operations and outputs a (succinct description of a) hypothesis distribution pe over [n] that satisfies
1/3
E[dTV ( pe, p)] ≤ 2 · opt + O log n/(m + 1) .
The aforementioned algorithm partitions the domain [n] in O(m1/3 · (log n)2/3 ) intervals and outputs a
hypothesis distribution that is uniform within each of these intervals.
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 540
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
By taking m = Ω(log n/ε 3 ), one obtains a hypothesis such that E[dTV ( pe, p)] ≤ 2 · opt + ε. We stress
that Birgé’s algorithm for learning non-increasing distributions [4] is in fact “semi-agnostic,” in the sense
that it also learns distributions that are close to being non-increasing; this robustness will be crucial for
us later (since in our final algorithm we will use Birgé’s algorithm on distributions identified by our
tester, that are close to monotone but not necessarily perfectly monotone). This semi-agnostic property
is not explicitly stated in [4] but it can be shown to follow easily from his results. We show how the
semi-agnostic property follows from Birgé’s results in Appendix A. Let L↑ denote the corresponding
semi-agnostic algorithm for learning non-decreasing distributions.
Our final tool is a routine to do hypothesis testing, i. e., to select a high-accuracy hypothesis distribution
from a collection of hypothesis distributions one of which has high accuracy. The need for such a routine
arises in several places; in some cases we know that a distribution is monotone, but do not know whether
it is non-increasing or non-decreasing. In this case, we can run both algorithms L↑ and L↓ and then choose
a good hypothesis using hypothesis testing. Another need for hypothesis testing is to “boost confidence”
that a learning algorithm generates a high-accuracy hypothesis. Our initial version of the algorithm for
Theorem 1.1 generates an ε-accurate hypothesis with probability at least 9/10; by running it O(log(1/δ ))
times using a hypothesis testing routine, it is possible to identify an O(ε)-accurate hypothesis with
probability 1 − δ . Routines of the sort that we require have been given in, e. g., [12] and [9]; we use the
following theorem from [9]:
Theorem 2.4. There is an algorithm Choose-Hypothesis p (h1 , h2 , ε 0 , δ 0 ) which is given sample access
to p, two hypothesis distributions h1 , h2 for p, an accuracy parameter ε 0 , and a confidence parameter
δ 0 . It makes m = O(log(1/δ 0 )/ε 02 ) draws from p and returns a hypothesis h ∈ {h1 , h2 }. If one of h1 , h2
has dTV (hi , p) ≤ ε 0 then with probability 1 − δ 0 the hypothesis h that Choose-Hypothesis returns has
dTV (h, p) ≤ 6ε 0 .
For the sake of completeness, we describe and analyze the Choose-Hypothesis algorithm in Ap-
pendix B.
3 Learning k-modal distributions
In this section, we present our main result: a nearly sample-optimal and computationally efficient
algorithm to learn an unknown k-modal distribution. In Section 3.1 we present a simple learning
algorithm with a suboptimal sample complexity. In Section 3.2 we present our main result which involves
a property testing algorithm as a subroutine.
3.1 Warm-up: A simple learning algorithm
In this subsection, we give an algorithm that runs in time poly(k, log n, 1/ε, log(1/δ )) and learns an
unknown k-modal distribution to accuracy ε and confidence δ . The sample complexity of the algorithm
is essentially optimal as a function of k (up to a logarithmic factor), but suboptimal as a function of ε, by
a polynomial factor.
In the following pseudocode we give a detailed description of the algorithm Learn-kmodal-simple
(a precise description appears as Algorithm 1, below); the algorithm outputs an ε-accurate hypothesis
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 541
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
with confidence 9/10 (see Theorem 3.3). We explain how to boost the confidence to 1 − δ after the proof
of the theorem.
Algorithm Learn-kmodal-simple works as follows: We start by partitioning the domain [n] into
consecutive intervals of mass “approximately ε/k.” To do this, we draw Θ(k/ε 3 ) samples from p and
greedily partition the domain into disjoint intervals of empirical mass roughly ε/k. (Some care is needed
in this step, since there may be “heavy” points in the support of the distribution; however, we gloss over
this technical issue for the sake of this intuitive explanation.) Note that we do not have a guarantee
that each such interval will have true probability mass Θ(ε/k). In fact, it may well be the case that the
additive error δ between the true probability mass of an interval and its empirical mass (roughly ε/k)
is δ = ω(ε/k). The error guarantee of the partitioning is more “global” in that the sum of these errors
across all such intervals is at most ε. In particular, as a simple corollary of the VC inequality, we can
deduce the following statement that will be used several times throughout the paper:
Fact 3.1. Let p be any distribution over [n] and pbm be the empirical distribution of m samples from p.
For
m = Ω (d/ε 2 ) log(1/δ ) ,
with probability at least 1 − δ , for any collection J of (at most) d disjoint intervals in [n], we have that
∑ |p(J) − pbm (J)| ≤ ε .
J∈J
Proof. Note that
∑ |p(J) − pbm (J)| = 2|p(A) − pbm (A)| , (3.1)
J∈J
where
A = {J ∈ J : p(J) > pbm (J)} .
Since J is a collection of at most d intervals, it is clear that A is a union of at most d intervals. If Ad is the
family of all unions of at most d intervals, then the right hand side of (3.1) is at most 2kp − pbm kAd . Since
the VC–dimension of Ad is 2d, Theorem 2.1 implies that the quantity (3.1) has expected value at most
ε/2. The claim now follows by an application of Theorem 2.2 with η = ε/2.
If this step is successful, we have partitioned the domain into a set of O(k/ε) consecutive intervals of
probability mass “roughly ε/k.” The next step is to apply Birgé’s monotone learning algorithm to each
interval.
A caveat comes from the fact that not all such intervals are guaranteed to be monotone (or even close
to being monotone). However, since our input distribution is assumed to be k-modal, all but (at most) k
of these intervals are monotone. Call a non-monotone interval “bad.” Since all intervals have empirical
probability mass at most ε/k and there are at most k bad intervals, it follows from Fact 3.1 that these
intervals contribute at most O(ε) to the total mass. So even though Birgé’s algorithm gives no guarantees
for bad intervals, these intervals do not affect the error by more than O(ε).
Let us now focus on the monotone intervals. For each such interval, we do not know if it is monotone
increasing or monotone decreasing. To overcome this difficulty, we run both monotone algorithms L↓
and L↑ for each interval and then use hypothesis testing to choose the correct candidate distribution.
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 542
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
Also, note that since we have O(k/ε) intervals, we need to run each instance of both the monotone
learning algorithms and the hypothesis testing algorithm with confidence 1 − O(ε/k), so that we can
guarantee that the overall algorithm has confidence 9/10. Note that Theorem 2.3 and Markov’s inequality
imply that if we draw Ω(log n/ε 3 ) samples from a non-increasing distribution p, the hypothesis pe output
by L↓ satisfies dTV ( pe, p) ≤ ε with probability 9/10. We can boost the confidence to 1 − δ with an
overhead of
O(log(1/δ ) log log(1/δ ))
in the sample complexity:
Fact 3.2. Let p be a non-increasing distribution over [n]. There is an algorithm L↓ δ with the following
performance guarantee: Given
(log n/ε 3 ) · Õ(log(1/δ )))
samples from p, L↓ δ performs
Õ (log2 n/ε 3 ) · log2 (1/δ )
bit operations and outputs a (succinct description of a) hypothesis distribution pe over [n] that satisfies
dTV ( pe, p) ≤ ε with probability at least 1 − δ .
Algorithm L↓ δ runs L↓ O(log(1/δ )) times and performs a tournament among the candidate hypothe-
ses using Choose-Hypothesis. Let L↑ δ denote the corresponding algorithm for learning non-decreasing
distributions with confidence δ . We postpone further details on these algorithms to Appendix C.
Theorem 3.3. Algorithm Learn-kmodal-simple (Algorithm 1) uses
k log n
· Õ (log(k/ε))
ε4
samples, performs poly(k, log n, 1/ε) bit operations, and learns a k-modal distribution to accuracy O(ε)
with probability 9/10.
Proof. First, it is easy to see that the algorithm has the claimed sample complexity. Indeed, the algorithm
draws a total of r + m + m0 samples in Steps 1, 4 and 5. The running time is also easy to analyze, as it is
easy to see that every step can be performed in polynomial time (in fact, nearly linear time) in the sample
size.
We need to show that with probability 9/10 (over its random samples), algorithm Learn-kmodal-
simple outputs a hypothesis h such that dTV (h, p) ≤ O(ε).
Since r = Θ(d/ε 2 ) samples are drawn in Step 1, Fact 3.1 implies that with probability of failure at
most 1/100, for each family J of at most d disjoint intervals from [n], we have
∑ |p(J) − pbm (J)| ≤ ε . (3.2)
J∈J
For the rest of the analysis of Learn-kmodal-simple we condition on this “good” event.
Since every atomic interval I ∈ I has pb(I) ≥ ε/(10k) (except potentially the rightmost one), it follows
that the number ` of atomic intervals constructed in Step 2 satisfies ` ≤ 10 · (k/ε). By the construction
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 543
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
Algorithm 1 Learn-kmodal-simple
Inputs: ε > 0; sample access to k-modal distribution p over [n]
1. Fix d := d20k/εe. Draw r = Θ(d/ε 2 ) samples from p and let pb denote the resulting empirical
distribution.
2. Greedily partition the domain [n] into ` atomic intervals I := {Ii }`i=1 as follows:
(a) I1 := [1, j1 ], where j1 := min{ j ∈ [n] | pb([1, j]) ≥ ε/(10k)}.
Si
(b) For i ≥ 1, if j=1 I j = [1, ji ], then Ii+1 := [ ji + 1, ji+1 ], where ji+1 is defined as follows:
• If pb([ ji + 1, n]) ≥ ε/(10k), then ji+1 := min{ j ∈ [n] | pb([ ji + 1, j]) ≥ ε/(10k)}.
• Otherwise, ji+1 := n.
3. Construct a set of ` light intervals I0 := {Ii0 }`i=1 and a set {bi }ti=1 of t ≤ ` heavy points as follows:
(a) For each interval Ii = [a, b] ∈ I, if pb(Ii ) ≥ ε/(5k) define Ii0 := [a, b − 1] and make b a heavy
point. (Note that it is possible to have Ii0 = 0.)
/
(b) Otherwise, define Ii0 := Ii .
Fix δ 0 := ε/(500k).
4. Draw m = (k/ε 4 ) · log(n) · Θ̃(log(1/δ 0 )) samples s = {si }m i=1 from p. For each light interval Ii ,
0
↓ ↑ 0 ↓
i ∈ [`], run both L δ 0 and L δ 0 on the conditional distribution pIi0 using the samples in s ∩ Ii . Let peI 0 ,
i
pe↑I 0 be the corresponding conditional hypothesis distributions.
i
0
5. Draw m0 = Θ((k/ε 4 ) · log(1/δ 0 )) samples s0 = {s0i }m 0
i=1 from p. For each light interval Ii , i ∈ [`],
p ↑ ↓ 0 0 0
run Choose-Hypothesis ( peI 0 , peI 0 , ε, δ ) using the samples in s ∩ Ii . Denote by peIi0 the returned
i i
conditional distribution on Ii0 .
6. Output the hypothesis h = ∑`j=1 pb(I 0j ) · peI 0j + ∑tj=1 pb(b j ) · 1b j .
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 544
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
in Steps 2 and 3, every light interval I 0 ∈ I0 has pb(I 0 ) ≤ ε/(5k). Note also that every heavy point b has
pb(b) ≥ ε/(10k) and the number of heavy points t is at most `.
Since the light intervals and heavy points form a partition of [n], we can write
` t
p = ∑ p(I 0j ) · pI 0j + ∑ p(b j ) · 1b j .
j=1 j=1
Therefore, we can bound the variation distance as follows:
` t `
dTV (h, p) ≤ ∑ | pb(I 0j ) − p(I 0j )| + ∑ | pb(b j ) − p(b j )| + ∑ p(I 0j ) · dTV ( peI 0j , pI 0j ) . (3.3)
j=1 j=1 j=1
Since ` + t ≤ d, by Fact 3.1 and our conditioning, the contribution of the first two terms to the sum is
upper bounded by ε.
We proceed to bound the contribution of the third term. Since p is k-modal, at most k of the light
intervals I 0j are not monotone for p. Call these intervals “bad” and denote by B as the set of bad intervals.
Even though we have not identified the bad intervals, we know that all such intervals are light. Therefore,
their total empirical probability mass (under pbm ) is at most k · ε/(5k) = ε/5, i. e., ∑I∈B pb(I) ≤ ε/5. By
our conditioning (see equation (3.2)) and the triangle inequality it follows that
∑ p(I) − ∑ pb(I) ≤ ∑ |p(I) − pb(I)| ≤ ε
I∈B I∈B I∈B
which implies that the true probability mass of the bad intervals is at most ε/5 + ε = 6ε/5. Hence, the
contribution of bad intervals to the third term of the right hand side of (3.3) is at most O(ε). (Note that
this statement holds true independent of the samples s we draw in Step 4.)
It remains to bound the contribution of monotone intervals to the third term. Let `0 ≤ ` be the number
0
of monotone light intervals and assume after renaming the indices that they are e I := {I 0j }`j=1 . To bound
from above the right hand side of (3.3), it suffices to show that with probability at least 19/20 (over the
samples drawn in Steps 4-5) it holds
`0
∑ p(I 0j ) · dTV ( peI , pI ) = O(ε) .
0
j
0
j
(3.4)
j=1
To prove (3.4) we partition the set eI into three subsets based on their probability mass under p. Note that
we do not have a lower bound on the probability mass of intervals in e I. Moreover, by our conditioning (see
equation (3.2)) and the fact that each interval in I is light, it follows that any I ∈ e
e I has p(I) ≤ pb(I) +ε ≤ 2ε.
We define the partition of eI into the following three sets:
Ie1 = {I ∈ e
I : p(I) ≤ ε 2 /(20k)} ,
Ie2 = {I ∈ e
I : ε 2 /(20k) < p(I) ≤ ε/k} , and
Ie3 = {I ∈ e
I : ε/k < p(I) ≤ 2ε} .
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 545
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
We bound the contribution of each subset in turn. It is clear that the contribution of Ie1 to (3.4) is at
most
∑ p(I) ≤ |Ie1 | · ε 2 /(20k) ≤ `0 · ε 2 /(20k) ≤ ` · ε 2 /(20k) ≤ ε/2 .
I∈Ie1
To bound from above the contribution of Ie2 to (3.4), we partition Ie2 into
g2 = dlog2 (20/ε)e = Θ(log(1/ε))
groups. For i ∈ [g2 ], the set (Ie2 )i consists of those intervals in Ie2 that have mass under p in the range
2−i · (ε/k), 2−i+1 · (ε/k) . The following statement establishes the variation distance closeness between
the conditional hypothesis for an interval in the i-th group (Ie2 )i and the corresponding conditional
distribution.
Claim 3.4. With probability at least 19/20 (over the sample s, s0 ), for each i ∈ [g2 ] and each monotone
light interval I 0j ∈ (Ie2 )i we have dTV (f
pI 0j , pI 0j ) = O(2i/3 · ε).
Proof. Since in Step 4 we draw m samples, and each interval I 0j ∈ (Ie2 )i has
p(I 0j ) ∈ 2−i · (ε/k), 2−i+1 · (ε/k) ,
a standard coupon collector argument [22] tells us that with probability 99/100, for each (i, j) pair, the
interval I 0j will get at least 2−i · (log(n)/ε 3 ) · Ω̃(log(1/δ 0 )) many samples. Let’s rewrite this as
log(n)/(2i/3 · ε)3 · Ω̃(log(1/δ 0 ))
samples. We condition on this event.
Fix an interval I 0j ∈ (Ie2 )i . We first show that with failure probability at most ε/(500k) after Step 4,
either pe↓I 0 or pe↑I 0 will be (2i/3 · ε)-accurate. Indeed, by Fact 3.2 and taking into account the number of
j j
samples that landed in I 0j , with probability 1 − ε/(500k) over s,
dTV ( peαI 0i , pI 0j ) ≤ 2i/3 ε ,
j
where αi =↓ if pI 0j is non-increasing and αi =↑ otherwise. By a union bound over all (at most ` many)
(i, j) pairs, it follows that with probability at least 49/50, for each interval I 0 ∈ (Ie2 )i one of the two
j
candidate hypothesis distributions is (2i/3 ε)-accurate. We condition on this event.
Now consider Step 5. Since this step draws m0 samples, and each interval I 0j ∈ (eI2 )i has
p(I 0j ) ∈ 2−i · (ε/k), 2−i+1 · (ε/k) ,
as before a standard coupon collector argument [22] tells us that with probability 99/100, for each (i, j)
pair, the interval I 0j will get at least
1/(2i/3 · ε)3 · Ω̃(log(1/δ 0 ))
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 546
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
many samples in this step; we henceforth assume that this is indeed the case for each I 0j . Thus, Theorem 2.4
applied to each fixed interval I 0j implies that the algorithm Choose-Hypothesis will output a hypothesis
that is 6 · (2i/3 ε)-close to pI 0j with probability 1 − ε/(500k). By a union bound, it follows that with
probability at least 49/50, the above condition holds for all monotone light intervals under consideration.
Therefore, except with failure probability 19/20, the statement of the claim holds.
Given the claim, we exploit the fact that for intervals I 0j such that p(I 0j ) is small we can afford larger
error on the total variation distance. More precisely, let ci = |(Ie2 )i |, the number of intervals in (Ie2 )i , and
note that ∑g2 ci ≤ `. Hence, we can bound the contribution of Ie2 to (3.4) by
i=1
g2 g2
∑ ci · (ε/k) · 2−i+1 · O(2i/3 · ε) ≤ O(1) · (2ε 2 /k) · ∑ ci · 2−2i/3 .
i=1 i=1
Since ∑gi=1
2
ci = |Ie2 | ≤ `, the above expression is maximized for c1 = |Ie2 | ≤ ` and ci = 0, i > 1, and the
maximum value is at most
O(1) · (ε 2 /k) · ` = O(ε) .
Bounding the contribution of Ie3 to (3.4) is very similar. We partition Ie3 into
g3 = dlog2 ke + 1 = Θ(log(k))
groups. For i ∈ [g3], the set (Ie3 )i consists of those intervals in Ie3 that have mass under p in the range
2−i+1 · ε, 2−i+2 · ε . The following statement is identical to Claim 3.4 albeit with different parameters:
Claim 3.5. With probability at least 19/20 (over the sample s, s0 ), for each i ∈ [g3 ] and each monotone
light interval I 0j ∈ (Ie3 )i , we have dTV (f
pI 0j , pI 0j ) = O(2i/3 · ε · k−1/3 ).
Let fi = |(Ie3 )i |, the number of intervals in (Ie3 )i . Each interval I ∈ (Ie3 )i has p(I) ∈ (di , 2di ], where
di := 2−i+1 · ε. We therefore have
g3
∑ di fi ≤ p(Ie3 ) ≤ 1 . (3.5)
i=1
We can now bound from above the contribution of Ie3 to (3.4) by
g3 g3
∑ 2di fi · O 2i/3 · ε · k−1/3 ≤ O(1) · ε/k1/3 · ∑ di fi · 2i/3 .
i=1 i=1
By (3.5) it follows that the above expression is maximized for dg3 fg3 = 1 and di fi = 0, i < g3 . The
maximum value is at most
O(1) · (ε/k1/3 ) · 2g3 /3 = O(ε)
where the final equality uses the fact that 2g3 ≤ 4k as follows by our definition of g3 . This proves (3.4)
and completes the proof of Theorem 3.3.
In order to obtain an O(ε)-accurate hypothesis with probability 1 − δ , we can simply run Learn-
kmodal-simple O(log(1/δ )) times and then perform a tournament using Theorem 2.4. This increases
the sample complexity by a Õ(log(1/δ )) factor. The running time increases by a factor of O(log2 (1/δ )).
We postpone the details for Appendix C.
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 547
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
3.2 Main result: Learning k-modal distributions using testing
Here is some intuition to motivate our k-modal distribution learning algorithm and give a high-level idea
of why the dominant term in its sample complexity is O(k log(n/k)/ε 3 ).
Let p denote the target k-modal distribution to be learned. As discussed above, optimal (in terms
of time and sample complexity) algorithms are known for learning a monotone distribution over [n],
so if the locations of the k modes of p were known then it would be straightforward to learn p very
efficiently by running the monotone distribution learner over k + 1 separate intervals. But it is clear that in
general we cannot hope to efficiently identify the modes of p exactly (for instance it could be the case that
p(a) = p(a + 2) = 1/n while p(a + 1) = 1/n + 1/2n ). Still, it is natural to try to decompose the k-modal
distribution into a collection of (nearly) monotone distributions and learn those. At a high level that is
what our algorithm does, using a novel property testing algorithm.
More precisely, we give a distribution testing algorithm with the following performance guarantee:
Let q be a k-modal distribution over [n]. Given an accuracy parameter τ, our tester takes poly(k/τ)
samples from q and outputs “yes” with high probability if q is monotone and “no” with high probability if
q is τ-far from every monotone distribution. (We stress that the assumption that q is k-modal is essential
here, since an easy argument given in [2] shows that Ω(n1/2 ) samples are required to test whether a
general distribution over [n] is monotone versus Θ(1)-far from monotone.)
With some care, by running the above-described tester O(k/ε) times with accuracy parameter τ, we
can decompose the domain [n] into
• at most k + 1 “superintervals,” which have the property that the conditional distribution of p over
each superinterval is almost monotone (τ-close to monotone);
• at most k + 1 “negligible intervals,” which have the property that each one has probability mass at
most O(ε/k) under p (so ignoring all of them incurs at most O(ε) total error); and
• at most k + 1 “heavy” points, each of which has mass at least Ω(ε/k) under p.
We can ignore the negligible intervals, and the heavy points are easy to handle; however some care must
be taken to learn the “almost monotone” restrictions of p over each superinterval. A naive approach,
using a generic log(n)/ε 3 -sample monotone distribution learner that has no performance guarantees
if the target distribution is not monotone, leads to an inefficient overall algorithm. Such an approach
would require that τ (the closeness parameter used by the tester) be at most 1/(the sample complexity
of the monotone distribution learner), i. e., τ < ε 3 / log(n). Since the sample complexity of the tester is
poly(k/τ) and the tester is run Ω(k/ε) times, this approach would lead to an overall sample complexity
that is unacceptably high.
Fortunately, instead of using a generic monotone distribution learner, we can use the semi-agnostic
monotone distribution learner of Birgé (Theorem 2.3) that can handle deviations from monotonicity far
more efficiently than the above naive approach. Recall that given draws from a distribution q over [n] that
is τ-close to monotone, this algorithm uses O(log(n)/ε 3 ) samples and outputs a hypothesis distribution
that is (2τ + ε)-close to monotone. By using this algorithm we can take the accuracy parameter τ for
our tester to be Θ(ε) and learn the conditional distribution of p over a given superinterval to accuracy
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 548
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
O(ε) using O(log(n)/ε 3 ) samples from that superinterval. Since there are k + 1 superintervals overall, a
careful analysis shows that O(k log(n)/ε 3 ) samples suffice to handle all the superintervals.
We note that the algorithm also requires an additional additive poly(k/ε) samples (independent of n)
besides this dominant term (for example, to run the tester and to estimate accurate weights with which to
combine the various sub-hypotheses). The overall sample complexity we achieve is stated in Theorem 3.6
below.
Theorem 3.6 (Main). Algorithm Learn-kmodal (Algorithm 2) uses
O k log(n/k)/ε 3 + (k2 /ε 3 ) · log(k/ε) · log log(k/ε)
samples, performs poly(k, log n, 1/ε) bit operations, and learns any k-modal distribution to accuracy ε
and confidence 9/10.
Theorem 1.1 follows from Theorem 3.6 by running Learn-kmodal O(log(1/δ )) times and using
hypothesis testing to boost the confidence to 1 − δ . We give details in Appendix C.
Algorithm Learn-kmodal makes essential use of an algorithm T↑ for testing whether a k-modal
distribution over [n] is non-decreasing. Algorithm T↑ (ε, δ ) uses O(log(1/δ )) · (k/ε 2 ) samples from a
k-modal distribution p over [n], and behaves as follows:
• (Completeness) If p is non-decreasing, then T↑ outputs “yes” with probability at least 1 − δ ;
• (Soundness) If p is ε-far from non-decreasing, then T↑ outputs “yes” with probability at most δ .
Let T↓ denote the analogous algorithm for testing whether a k-modal distribution over [n] is non-increasing
(we will need both algorithms). The description and proof of correctness for T↑ is postponed to the
following subsection (Section 3.4).
3.3 Algorithm Learn-kmodal and its analysis
Algorithm Learn-kmodal (Algorithm 2) is described in detail below. The analysis of the algorithm is
the topic of Theorem 3.6, proved next.
Proof of Theorem 3.6. Before entering into the proof we record two observations; we state them explicitly
here for the sake of the exposition.
Fact 3.7. Let R ⊆ [n]. If pR is neither non-increasing nor non-decreasing, then R contains at least one
left extreme point.
Fact 3.8. Suppose that R ⊆ [n] does not contain a left extreme point. For any ε, τ, if T↑ (ε, τ) and T↓ (ε, τ)
are both run on pR , then the probability that both calls return “no” is at most τ.
Proof of Fact 3.8. By Fact 3.7 pR is either non-decreasing or non-increasing. If pR is non-decreasing
then T↑ will output “no” with probability at most τ, and similarly, if pR is non-increasing then T↓ will
output “no” with probability at most τ.
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 549
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
Algorithm 2 Learn-kmodal
Inputs: ε > 0; sample access to k-modal distribution p over [n]
1. Fix τ := ε/(100k). Draw r = Θ(1/τ 2 ) samples from p and let pb denote the empirical distribution.
2. Greedily partition the domain [n] into ` atomic intervals I := {Ii }`i=1 as follows:
(a) I1 := [1, j1 ], where j1 := min{ j ∈ [n] | pb([1, j]) ≥ ε/(10k)}.
Si
(b) For i ≥ 1, if j=1 I j = [1, ji ], then Ii+1 := [ ji + 1, ji+1 ], where ji+1 is defined as follows:
• If pb([ ji + 1, n]) ≥ ε/(10k), then ji+1 := min{ j ∈ [n] | pb([ ji + 1, j]) ≥ ε/(10k)}.
• Otherwise, ji+1 := n.
3. Set τ 0 := ε/(2000k). Draw r0 = Θ((k2 /ε 3 ) · log(1/τ 0 ) log log(1/τ 0 )) samples s from p to use in
Steps 4-5.
4. Run both T↑ (ε, τ 0 ) and T↓ (ε, τ 0 ) over pS j for j = 1, 2, . . ., to find the leftmost atomic interval I j1
i=1 Ii
such that both T↑ and T↓ return “no” over pS j1 I .
i=1 i
Let I j1 = [a j1 , b j1 ]. We consider two cases:
Case 1: If pb[a j1 , b j1 ] ≥ 2ε/(10k), define I 0j1 := [a j1 , b j1 − 1] and b j1 is a heavy point.
Case 2: If pb[a j1 , b j1 ] < 2ε/(10k) then define I 0j1 := I j1 .
j1 −1
Call I 0j1 a negligible interval. If j1 > 1 then define the first superinterval S1 to be i=1
S
Ii , and set
↑ ↓
a1 ∈ {↑, ↓} to be a1 =↑ if T returned “yes” on pS j1 −1 I and to be a1 =↓ if T returned “yes” on
i=1 i
pS j1 −1 I .
i=1 i
5. Repeat Step 3 starting with the next interval I j1 +1 , i. e., find the leftmost atomic interval I j2 such
that both T↑ and T↓ return “no” over pS j2 I . Continue doing this until all intervals through I`
i= j1 +1 i
have been used.
Let S1 , . . . , St be the superintervals obtained through the above process and
(a1 , . . . , at ) ∈ {↑, ↓}t
be the corresponding string of bits.
6. Draw m = Θ(k · log(n/k)/ε 3 ) samples s0 from p. For each superinterval Si , i ∈ [t], run Aai on the
conditional distribution pSi of p using the samples in s0 ∩ Si . Let peSi be the hypothesis thus obtained.
7. Output the hypothesis h = ∑ti=1 pb(Si ) · peSi + ∑ j pb({b j }) · 1b j .
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 550
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
Since r = Θ(1/τ 2 ) samples are drawn in the first step, Fact 3.1 (applied for d = 1) implies that with
probability of failure at most 1/100 each interval I ⊆ [n] has | pb(I) − p(I)| ≤ 2τ. For the rest of the proof
we condition on this good event.
Since every atomic interval I ∈ I has pb(I) ≥ ε/(10k) (except potentially the rightmost one), it follows
that the number ` of atomic intervals constructed in Step 2 satisfies ` ≤ 10 · (k/ε). Moreover, by our
conditioning, each atomic interval Ii has p(Ii ) ≥ 8ε/(100k).
Note that in Case (1) of Step 4, if pb[a j1 , b j1 ] ≥ 2ε/(10k) then it must be the case that pb(b j1 ) ≥ ε/(10k)
(and thus p(b j1 ) ≥ 8ε/(100k)). In this case, by definition of how the interval I j1 was formed, we must
have that I 0j1 = [a j1 , b j1 − 1] satisfies pb(I 0j1 ) < ε/(10k). So both in Case 1 and Case 2, we now have that
pb(I 0j1 ) ≤ 2ε/(10k), and thus p(I 0j1 ) ≤ 22ε/(100k). Entirely similar reasoning shows that every negligible
interval constructed in Steps 4 and 5 has mass at most 22ε/(100k) under p.
In Steps 4–5 we invoke the testers T↓ and T↑ on the conditional distributions of (unions of contiguous)
atomic intervals. Note that we need enough samples in every atomic interval, since otherwise the testers
provide no guarantees. We claim that with probability at least 99/100 over the sample s of Step 3, each
2 0
atomic interval gets b = Ω (k/ε ) · log(1/τ ) samples. This follows by a standard coupon collector’s
argument, which we now provide. As argued above, each atomic interval has probability mass Ω(ε/k)
under p. So, we have ` = O(k/ε) bins (atomic intervals), and we want each bin to contain b balls
(samples). It is well-known [22] that after taking Θ(` · log ` + ` · b · log log `) samples from p, with
probability 99/100 each bin will contain the desired number of balls. The claim now follows by our
choice of parameters. Conditioning on this event, any execution of the testers T↑ (ε, τ 0 ) and T↓ (ε, τ 0 ) in
Steps 4 and 5 will have the guaranteed completeness and soundness properties.
In the execution of Steps 4 and 5, there are a total of at most ` occasions when T↑ (ε, τ 0 ) and T↓ (ε, τ 0 )
are both run over some union of contiguous atomic intervals. By Fact 3.8 and a union bound, the
probability that (in any of these instances the interval does not contain a left extreme point and yet both
calls return “no”) is at most (10k/ε)τ 0 ≤ 1/200. So with failure probability at most 1/200 for this step,
each time Step 4 identifies a group of consecutive intervals I j , . . . , I j+r such that both T↑ and T↓ output
S j+r
“no,” there is a left extreme point in i= j Ii . Since p is k-modal, it follows that with failure probability at
most 1/200 there are at most k + 1 total repetitions of Step 4, and hence the number t of superintervals
obtained is at most k + 1.
We moreover claim that with very high probability each of the t superintervals Si is very close to
non-increasing or non-decreasing (with its correct orientation given by ai ):
Claim 3.9. With failure probability at most 1/100, each i ∈ [t] satisfies the following: if ai =↑ then pSi is
ε-close to a non-decreasing distribution and if ai =↓ then pSi is ε-close to a non-increasing distribution.
Proof. There are at most 2` ≤ 20k/ε instances when either T↓ or T↑ is run on a union of contiguous
intervals. For any fixed execution of T↓ over an interval I, the probability that T↓ outputs “yes” while pI
is ε-far from every non-increasing distribution over I is at most τ 0 , and similarly for T↑ . A union bound
and the choice of τ 0 conclude the proof of the claim.
Thus we have established that with overall failure probability at most 5/100, after Step 5 the interval
[n] has been partitioned into:
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 551
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
1. A set {Si }ti=1 of t ≤ k + 1 superintervals, with p(Si ) ≥ 8ε/(100k) and pSi being ε-close to either
non-increasing or non-decreasing according to the value of bit ai .
0
2. A set {Ii0 }ti=1 of t 0 ≤ k + 1 negligible intervals, such that p(Ii0 ) ≤ 22ε/(100k).
00
3. A set {bi }ti=1 of t 00 ≤ k + 1 heavy points, each with p(bi ) ≥ 8ε/(100k).
We condition on the above good events, and bound from above the expected total variation distance (over
the sample s0 ). In particular, we have the following lemma:
Lemma 3.10. Conditioned on the above good events 1–3, we have that Es0 [dTV (h, p)] =O(ε).
Proof of Lemma 3.10. By the discussion preceding the lemma statement, the domain [n] has been parti-
tioned into a set of superintervals, a set of negligible intervals and a set of heavy points. As a consequence,
we can write
t t 00 t0
p = ∑ p(S j ) · pS j + ∑ p({b j }) · 1b j + ∑ p(I 0j ) · pI 0j .
j=1 j=1 j=1
Therefore, we can bound the total variation distance as follows:
t t 00
dTV (h, p) ≤ ∑ | pb(S j ) − p(S j )| + ∑ | pb(b j ) − p(b j )|
j=1 j=1
t0 t
+ ∑ p(I 0j ) + ∑ p(S j ) · dTV ( peS j , pS j ) .
j=1 j=1
Recall that each term in the first two sums is bounded from above by 2τ. Hence, the contribution of these
terms to the RHS is at most 2τ · (2k + 2) ≤ ε/10. Since each negligible interval I 0j has p(I 0j ) ≤ 22ε/(100k),
the contribution of the third sum is at most t 0 ·22ε/(100k) ≤ ε/4. It thus remains to bound the contribution
of the last sum.
We will show that " #
t
E0
s
∑ p(S j ) · dTV ( peS , pS ) = O(ε) .
j j
j=1
Denote ni = |Si |. Clearly, ∑ti=1 ni ≤ n. Since we are conditioning on the good events (1)-(3), each
superinterval is ε-close to monotone with a known orientation (non-increasing or non-decreasing) given
by ai . Hence we may apply Theorem 2.3 for each superinterval.
Recall that in Step 5 we draw a total of m samples. Let mi , i ∈ [t] be the number of samples that land
in Si ; observe that mi is a binomially distributed random variable with mi ∼ Bin(m, p(Si )). We apply
Theorem 2.3 for each ε-monotone interval, conditioning on the value of mi , and get
dTV ( peSi , pSi ) ≤ 2ε + O (log ni /(mi + 1))1/3 .
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 552
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
Hence, we can bound from above the desired expectation as follows
!
t t
∑ p(S j ) · E0 dTV ( peS j , pS j ) ≤ ∑ 2ε · p(S j ) +
s
j=1 j=1
!
t
1/3 −1/3
O ∑ p(S j ) · (log n j ) · E0 [(m j + 1)
s
] .
j=1
Since ∑ j p(S j ) ≤ 1, to prove the lemma, it suffices to show that the second term is bounded, i. e., that
t
∑ p(S j ) · (log n j )1/3 · Es [(m j + 1)−1/3 ] = O(ε) .
0
j=1
To do this, we will first need the following claim:
Claim 3.11. For a binomial random variable X ∼ Bin(m, q) it holds E[(X + 1)−1/3 ] < (mq)−1/3 .
Proof. Jensen’s inequality implies that
E[(X + 1)−1/3 ] ≤ (E[1/(X + 1)])1/3 .
We claim that E[1/(X + 1)] < 1/ E[X]. This can be shown as follows: We first recall that E[X] = m · q.
For the expectation of the inverse, we can write:
m
1 m j
E [1/(X + 1)] = ∑ q (1 − q)m− j
j=0 j + 1 j
m
1 m+1 j
= ·∑ q (1 − q)m− j
m + 1 j=0 j+1
m+1
1 m+1 i
= ·∑ q (1 − q)m+1−i
q · (m + 1) i=1 i
1 − (1 − q)m+1 1
= < .
q · (m + 1) m·q
The claim now follows by the monotonicity of the mapping x 7→ x1/3 .
By Claim 3.11, applied to mi ∼ Bin(m, p(Si )), we have that
E0 [(mi + 1)−1/3 ] < m−1/3 · (p(Si ))−1/3 .
s
Therefore, our desired quantity can be bounded from above by
t t 1/3
p(S j ) · (log n j )1/3
2/3 log n j
∑ 1/3 · (p(S j ))1/3 = O(ε) · ∑ (p(S j )) · k · log(n/k) .
j=1 m j=1
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 553
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
We now claim that the second term in the RHS above is upper bounded by 2. Indeed, this follows by an
application of Hölder’s inequality for the vectors
t
t log n j 1/3
p(S j )2/3 j=1
and ,
k · log(n/k) j=1
with Hölder conjugates 3/2 and 3. That is,
1/3 !2/3 !1/3
t t t
2/3 log n j log n j
∑ (p(S j )) · ≤ ∑ p(S j ) · ∑ k · log(n/k) ≤ 2.
j=1 k · log(n/k) j=1 j=1
The first inequality is Hölder and the second uses the fact that
t t
∑ p(S j ) ≤ 1 and ∑ log(n j ) ≤ t · log(n/t) ≤ (k + 1) · log(n/k) .
j=1 j=1
This last inequality is a consequence of the concavity of the logarithm and the fact that ∑ j n j ≤ n. This
completes the proof of the lemma.
By applying Markov’s inequality and a union bound, we get that with probability 9/10 the algorithm
Learn-kmodal outputs a hypothesis h that has dTV (h, p)=O(ε) as required.
It is clear that the algorithm has the claimed sample complexity. The running time is also easy to
analyze, as it is easy to see that every step can be performed in polynomial time in the sample size. This
completes the proof of Theorem 3.6.
3.4 Testing whether a k-modal distribution is monotone
In this section we describe and analyze the testing algorithm T↑ (Algorithm 3). Given sample access to a
k-modal distribution q over [n] and τ > 0, our tester T↑ uses O(k/τ 2 ) many samples from q and has the
following properties:
• If q is non-decreasing, T↑ outputs “yes” with probability at least 2/3.
• If q is τ-far from non-decreasing, T↑ outputs “no” with probability at least 2/3.
(Algorithm T↑ (τ, δ ) is obtained by repeating T↑ O(log(1/δ )) times and taking the majority vote.)
Before we describe the algorithm we need some notation. Let q be a distribution over [n]. For
a ≤ b < c ∈ [n] define
q([a, b]) q([b + 1, c])
E(q, a, b, c) := − .
(b − a + 1) (c − b)
We also denote
E(q, a, b, c)
T (q, a, b, c) := 1 1
.
(b−a+1) + (c−b)
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 554
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
Intuitively, the quantity E(q, a, b, c) captures the difference between the average value of q over [a, b]
versus over [b + 1, c]; it is negative iff the average value of q is higher over [b + 1, c] than it is over [a, b].
The quantity T (q, a, b, c) is a scaled version of E(q, a, b, c).
The idea behind tester T↑ is simple. It is based on the observation that if q is a non-decreasing
distribution, then for any two consecutive intervals [a, b] and [b + 1, c] the average of q over [b + 1, c]
must be at least as large as the average of q over [a, b]. Thus any non-decreasing distribution will pass
a test that checks “all” pairs of consecutive intervals looking for a violation. Our tester T↑ checks “all”
sums of (at most) k consecutive intervals looking for a violation. Our analysis shows that in fact such a
test is complete as well as sound if the distribution q is guaranteed to be k-modal. The key ingredient
is a structural result (Lemma 3.13 below), which is proved using a procedure reminiscent of “Myerson
ironing” [21] to convert a k-modal distribution to a non-decreasing distribution.
Algorithm 3 Tester T↑ (τ)
Inputs: τ > 0; sample access to k-modal distribution q over [n]
1. Draw r = Θ(k/τ 2 ) samples s from q and let qb be the resulting empirical distribution.
2. If there exists ` ∈ [k] and {ai , bi , ci }`i=1 ∈ s ∪ {n} with ai ≤ bi < ci < ai+1 , i ∈ [` − 1], such that
`
∑ T (bq, ai , bi , ci −1) ≥ τ/4 (3.6)
i=1
then output “no,” otherwise output “yes.”
The following theorem establishes correctness of the tester.
Theorem 3.12. Algorithm T↑ (Algorithm 3) uses O(k/τ 2 ) samples from q, performs poly(k/τ) · log n bit
operations and satisfies the desired completeness and soundness properties.
Proof. We start by showing that the algorithm has the claimed completeness and soundness properties.
Let us say that the sample s is good if for every collection I of (at most) 3k intervals in [n] it holds
∑ |q(I) − qb(I)| ≤ τ/20 .
I∈I
By Fact 3.1 with probability at least 2/3 the sample s is good. We henceforth condition on this event.
For a ≤ b < c ∈ [n] let us denote γ = |q([a, b]) − qb([a, b])| and γ 0 = |q([b + 1, c]) − qb([b + 1, c])|. Then
we can write
γ0
γ 0 1 1
|E(q, a, b, c) − E(b
q, a, b, c)| ≤ + ≤ (γ + γ ) · +
b−a+1 c−b b−a+1 c−b
which implies that
q, a, b, c)| ≤ γ + γ 0 .
|T (q, a, b, c) − T (b (3.7)
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 555
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
Now consider any {ai , bi , ci }`i=1 ∈ [n], for some ` ≤ k, with ai ≤ bi < ci < ai+1 , i ∈ [` − 1]. Similarly
denote γi = |q([ai , bi ]) − qb([ai , bi ])| and γi0 = |q([bi + 1, ci ]) − qb([bi + 1, ci ])|. With this notation we have
` ` ` `
∑ T (q, ai , bi , ci ) − ∑ T (bq, ai , bi , ci ) ≤ ∑ |T (q, ai , bi , ci ) − T (bq, ai , bi , ci )| ≤ ∑ (γi + γi0 )
i=1 i=1 i=1 i=1
where we used the triangle inequality and (3.7). Note that the rightmost term is the sum of the “additive
errors” for the collection {[ai , bi ], [bi + 1, ci ]}`i=1 of 2` intervals. Hence, it follows from our conditioning
that the last term is bounded from above by τ/20, i. e.,
` `
∑ T (q, ai , bi , ci ) − ∑ T (bq, ai , bi , ci ) ≤ τ/20 . (3.8)
i=1 i=1
We first establish completeness. Suppose that q is non-decreasing. Then the average probability
value in any interval [a, b] is a non-decreasing function of a. That is, for all a ≤ b < c ∈ [n] it holds
E(q, a, b, c) ≤ 0, hence T (q, a, b, c) ≤ 0. This implies that for any choice of {ai , bi , ci }`i=1 ∈ [n] with
ai ≤ bi < ci < ai+1 , we will have ∑`i=1 T (q, ai , bi , ci ) ≤ 0. By (3.8) we now get that
`
∑ T (bq, ai , bi , ci ) ≤ τ/20 ,
i=1
i. e., the tester says “yes” with probability at least 2/3.
To prove soundness, we will crucially need the following structural lemma:
Lemma 3.13. Let q be a k-modal distribution over [n] that is τ-far from being non-decreasing. Then
there exists ` ∈ [k] and {ai , bi , ci }`i=1 ⊆ [n]3` with ai ≤ bi < ci < ai+1 , i ∈ [` − 1], such that
`
∑ T (q, ai , bi , ci ) ≥ τ/2 . (3.9)
i=1
We first show how the soundness follows from the lemma. Let q be a k-modal distribution over [n]
that is τ-far from non-decreasing. Denote s0 := s ∪ {n} = {s1 , s2 , . . . , sr0 } with r0 ≤ r + 1 and s j < s j+1 .
We want to show that there exist points in s0 that satisfy (3.6). Namely, that there exists ` ∈ [k] and
{sai , sbi , sci }`i=1 ∈ s0 with sai ≤ sbi < sci < sai+1 , i ∈ [` − 1], such that
`
∑ T (bq, sa , sb , sc −1) ≥ τ/4 .
i i i (3.10)
i=1
By Lemma 3.13, there exists ` ∈ [k] and {ai , bi , ci }`i=1 ∈ [n] with ai ≤ bi < ci < ai+1 , i ∈ [` − 1], such that
∑`i=1 T (q, ai , bi , ci ) ≥ τ/2. Combined with (3.8) the latter inequality implies that
`
∑ T (bq, ai , bi , ci ) ≥ τ/2 − τ/20 > τ/4 . (3.11)
i=1
First note that it is no loss of generality to assume that qb([ai , bi ]) > 0 for all i ∈ [`]. (If there is some
j ∈ [`] with qb([a j , b j ]) = 0, then by definition we have T (b
q, a j , b j , c j ) ≤ 0; hence, we can remove this
term from the above sum and the RHS does not decrease.)
Given the domain points {ai , bi , ci }`i=1 we define the sample points sai , sbi , sci such that:
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 556
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
(i) [sai , sbi ] ⊆ [ai , bi ],
(ii) [sbi + 1, sci − 1] ⊇ [bi + 1, ci ],
(iii) qb([sai , sbi ]) = qb([ai , bi ]) and
(iv) qb([sbi + 1, sci − 1]) = qb([bi + 1, ci ]).
To achieve these properties we select:
• sai to be the leftmost point of the sample in [ai , bi ]; sbi to be the rightmost point of the sample in
[ai , bi ] (note that by our assumption that qb([ai , bi ]) > 0 at least one sample falls in [ai , bi ]);
• sci to be the leftmost point of the sample in [ci + 1, n]; or the point n if [ci + 1, n] has no samples or
is empty.
We can rewrite (3.11) as follows:
` `
qb([ai , bi ]) qb([bi + 1, ci ])
∑ 1 + b −a +1 ≥ τ/4 + ∑ 1 + c −b
i i i i
. (3.12)
i=1 ci −bi i=1 bi −ai +1
Now note that by properties (i) and (ii) above it follows that
bi − ai + 1 ≥ sbi − sai + 1 and ci − bi ≤ sci − sbi − 1 .
Combining with properties (iii) and (iv) we get
qb([ai , bi ]) qb([sai , sbi ]) qb([sai , sbi ])
bi −ai +1
= bi −ai +1
≤ s −s +1
(3.13)
1 + ci −bi 1 + ci −bi 1 + bi ai sci −sbi −1
and similarly
qb([bi + 1, ci ]) qb([sbi + 1, sci − 1]) qb([sbi + 1, sci − 1])
= ≥ s −s −1
. (3.14)
i −bi i −bi
1 + bic−a i +1
1 + bic−a i +1
1 + ci bi sbi −sai +1
A combination of (3.12), (3.13), (3.14) yields the desired result (3.10).
It thus remains to prove Lemma 3.13.
Proof of Lemma 3.13. We will prove the contrapositive. Let q be a k-modal distribution over [n] such
that for any ` ≤ k and {ai , bi , ci }`i=1 ⊆ [n]3` such that ai ≤ bi < ci < ai+1 , i ∈ [` − 1], we have
`
∑ T (q, ai , bi , ci ) ≤ τ/2 . (3.15)
i=1
We will construct a non-decreasing distribution qe that is τ-close to q.
The high level idea of the argument is as follows: the construction of qe proceeds in (at most) k
stages where in each stage, we reduce the number of modes by at least one and incur small error in
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 557
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
the total variation distance. In particular, we iteratively construct a sequence of distributions {q(i) }`i=0 ,
q(0) = q and q(`) = qe, for some ` ≤ k, such that for all i ∈ [`] we have that q(i) is (k − i)-modal and
dTV (q(i−1) , q(i) ) ≤ 2τi , where the quantities τi will be defined in the course of the analysis below. By
appropriately using (3.15), we will show that
`
∑ τi ≤ τ/2 . (3.16)
i=1
Assuming this, it follows from the triangle inequality that
` `
q, q) ≤ ∑ dTV (q(i) , q(i−1) ) ≤ 2 · ∑ τi ≤ τ
dTV (e
i=1 i=1
as desired, where the last inequality uses (3.16).
Consider the graph (histogram) of the discrete density q. The x-axis represents the n points of the
domain and the y-axis the corresponding probabilities. We first informally describe how to obtain q(1)
from q. The construction of q(i) from q(i−1) , i ∈ [`], is essentially identical. Let j1 be the leftmost (i. e.,
having minimum x-coordinate) left-extreme point (mode) of q, and assume that it is a local maximum with
height (probability mass) q( j1 ). (A symmetric argument works for the case that it is a local minimum.)
The idea of the proof is based on the following simple process (reminiscent of Myerson’s ironing
process [21]): We start with the horizontal line y = q( j1 ) and move it downwards until we reach a height
h1 < q( j1 ) so that the total mass “cut-off” equals the mass “missing” to the right; then we make the
distribution “flat” in the corresponding interval (hence, reducing the number of modes by at least one).
We now proceed with the formal argument, assuming as above that the leftmost left-extreme point
j1 of q is a local maximum. We say that the line y = h intersects a point i ∈ [n] in the domain of q
if q(i) ≥ h. The line y = h, h ∈ [0, q( j1 )], intersects the graph of q at a unique interval I(h) ⊆ [n] that
contains j1 . Suppose I(h) = [a(h), b(h)], where a(h), b(h) ∈ [n] depend on h. By definition this means
that q(a(h)) ≥ h and q(a(h) − 1) < h (since q is supported on [n], we adopt the convention that q(0) = 0).
Recall that the distribution q is non-decreasing in the interval [1, j1 ] and that j1 ≥ a(h). The term “the
mass cut-off by the line y = h” means the quantity
A(h) = q (I(h)) − h · (b(h) − a(h) + 1) ,
i. e., the “mass of the interval I(h) above the line.”
The height h of the line y = h defines the points a(h), b(h) ∈ [n] as described above. We consider
values of h such that q is unimodal (increasing then decreasing) over I(h). In particular, let j10 be the
leftmost mode of q to the right of j1 , i. e., j10 > j1 and j10 is a local minimum. We consider values of h ∈
(q( j10 ), q( j1 )). For such values, the interval I(h) is indeed unimodal (as b(h) < j10 ). For h ∈ (q( j10 ), q( j1 ))
we define the point c(h) ≥ j10 as follows: It is the rightmost point of the largest interval containing j10
whose probability mass does not exceed h. That is, all points in [ j10 , c(h)] have probability mass at most h
and q(c(h) + 1) > h (or c(h) = n).
Consider the interval J(h) = [b(h) + 1, c(h)]. This interval is non-empty, since b(h) < j10 ≤ c(h).
(Note that J(h) is not necessarily a unimodal interval; it contains at least one mode j10 of q, but it may
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 558
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
also contain more modes.) The term “the mass missing to the right of the line y = h” means the quantity
B(h) = h · (c(h) − b(h)) − q (J(h)) .
Consider the function C(h) = A(h) − B(h) over [q( j10 ), q( j1 )]. This function is continuous in its
domain; moreover, we have that
C (q( j1 )) = A (q( j1 )) − B (q( j1 )) < 0 ,
as A (q( j1 )) = 0, and
C q( j10 ) = A q( j10 ) − B q( j10 ) > 0 ,
as B (q( j10 )) = 0. Therefore, by the intermediate value theorem, there exists a value h1 ∈ (q( j10 ), q( j1 ))
such that
A(h1 ) = B(h1 ) .
The distribution q(1) is constructed as follows: We move the mass τ1 = A(h1 ) from I(h1 ) to J(h1 ).
Note that the distribution q(1) is identical to q outside the interval [a(h1 ), c(h1 )], hence the leftmost mode
of q(1) is in (c(h1 ), n]. It is also clear that
dTV (q(1) , q) ≤ 2τ1 .
Let us denote a1 = a(h1 ), b1 = b(h1 ) and c1 = c(h1 ). We claim that q(1) has at least one mode less
than q. Indeed, q(1) is non-decreasing in [1, a1 − 1] and constant in [a1 , c1 ]. (By our “flattening” process,
all the points in the latter interval have probability mass exactly h1 .) Recalling that
q(1) (a1 ) = h1 ≥ q(1) (a1 − 1) = q(a1 − 1) ,
we deduce that q(1) is non-decreasing in [1, c1 ].
We will now argue that
τ1 = T (q, a1 , b1 , c1 ) . (3.17)
Recall that we have A(h1 ) = B(h1 ) = τ1 , which can be written as
q([a1 , b1 ]) − h1 · (b1 − a1 + 1) = h1 · (c1 − b1 ) − q([b1 + 1, c1 ]) = τ1 .
From this, we get
q([a1 , b1 ]) q([b1 + 1, c1 ]) τ1 τ1
− = +
(b1 − a1 + 1) (c1 − b1 ) (b1 − a1 + 1) (c1 − b1 )
or equivalently
τ1 τ1
E (q, a1 , b1 , c1 ) = +
(b1 − a1 + 1) (c1 − b1 )
which gives (3.17).
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 559
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
We construct q(2) from q(1) using the same procedure. Recalling that the leftmost mode of q(1) lies in
the interval (c1 , n] an identical argument as above implies that
dTV (q(2) , q(1) ) ≤ 2τ2
where
τ2 = T (q(1) , a2 , b2 , c2 )
for some a2 , b2 , c2 ∈ [n] satisfying c1 < a2 ≤ b2 < c2 . Since q(1) is identical to q in (c1 , n], it follows that
τ2 = T (q, a2 , b2 , c2 ) .
We continue this process iteratively for ` ≤ k stages until we obtain a non-decreasing distribution q(`) .
(Note that we remove at least one mode in each iteration, hence it may be the case that ` < k.) It
follows inductively that for all i ∈ [`], we have that dTV (q(i) , q(i−1) ) ≤ 2τi where τi = T (q, ai , bi , ci ), for
ci−1 < ai ≤ bi < ci .
We therefore conclude that
` `
∑ τi = ∑ T (q, ai , bi , ci )
i=1 i=1
which is bounded from above by τ/2 by (3.15). This establishes (3.16) completing the proof of
Lemma 3.13.
The upper bound on the sample complexity of the algorithm is straightforward, since only Step 1 uses
samples.
It remains to analyze the running time. The only non-trivial computation is in Step 2 where we need
to decide whether there exist ` ≤ k “ordered triples” {ai , bi , ci }`i=1 ∈ s0 with ai ≤ bi < ci < ai+1 , i ∈ [` − 1],
such that ∑`i=1 T (b
q, ai , bi , ci − 1) ≥ τ/4. Even though a naive brute-force implementation would need
k
time Ω(r ) · log n, there is a simple dynamic programming algorithm that runs in poly(r, k) · log n time.
We now provide the details. Consider the objective function
( )
`
T(`) = max ∑ T (bq, ai , bi , ci − 1) {ai , bi , ci }`i=1 ∈ s0 with ai ≤ bi < ci < ai+1 , i ∈ [` − 1] ,
i=1
for ` ∈ [k]. We want to decide whether max`≤k T(`) ≥ τ/4. For ` ∈ [k] and j ∈ [r0 ], we use dynamic
programming to compute the quantities
( )
`
{ai , bi , ci }`i=1 ∈ s0 with ai ≤ bi < ci < ai+1 ,
T(`, j) = max ∑ T (b q, ai , bi , ci − 1) .
i=1
i ∈ [` − 1] and c` = s j
(This clearly suffices as T(`) = max j∈[r0 ] T(`, j).) The dynamic program is based on the recursive identity
T(` + 1, j) = max T(`, j0 ) + T 0 ( j0 + 1, j) ,
j0 ∈[r0 ], j0 < j
where we define
T 0 (α, β ) = max{T (b
q, a, b, β ) | a, b ∈ s0 , α ≤ a ≤ b < β } .
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 560
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
Note that all the values T 0 ( j0 + 1, j) (where j0 , j ∈ [r0 ] and j0 < j) can be computed in O(r3 ) time. Fix
` ∈ [k]. Suppose we have computed all the values T(`, j0 ), j0 ∈ [r0 ]. Then, for fixed j ∈ [r0 ], we can
compute the value T(` + 1, j) in time O(r) using the above recursion. Hence, the total running time of
the algorithm is O(kr2 + r3 ). This completes the run time analysis and the proof of Theorem 3.12.
4 Conclusions and future work
At the level of techniques, this work illustrates the viability of a new general strategy for developing
efficient learning algorithms, namely by using “inexpensive” property testers to decompose a complex
object (for us these objects are k-modal distributions) into simpler objects (for us these are monotone
distributions) that can be more easily learned. It would be interesting to apply this paradigm in other
contexts such as learning Boolean functions.
At the level of the specific problem we consider—learning k-modal distributions—our results show
that k-modality is a useful type of structure which can be strongly exploited by sample-efficient and
computationally efficient learning algorithms. Our results motivate the study of computationally ef-
ficient learning algorithms for distributions that satisfy other kinds of “shape restrictions.” Possible
directions here include multivariate k-modal distributions, log-concave distributions, monotone hazard
rate distributions and more.
At a technical level, any improvement in the sample complexity of our property testing algorithm of
Section 3.4 would directly improve the “extraneous” additive Õ(k2 /ε 3 ) term in the sample complexity of
our algorithm. We suspect√ that it may be possible to improve our testing algorithm (although we note that
it is easy to give an Ω( k/ε 2 ) lower bound using standard constructions).
Our learning algorithm is not proper, i. e., it outputs a hypothesis that is not necessarily k-modal.
Obtaining an efficient proper learning algorithm is an interesting question. Finally, it should be noted that
our approach for learning k-modal distributions requires a priori knowledge of the parameter k. We leave
the case of unknown k as an intriguing open problem.
Acknowledgement
We thank the anonymous reviewers for their helpful comments.
A Birgé’s algorithm as a semi-agnostic learner
In this section we briefly explain why Birgé’s algorithm [4] also works in the semi-agnostic setting, thus
justifying the claims about its performance made in the statement of Theorem 2.3. To do this, we need to
explain his approach. For this, we will need the following fact (which follows as a special case of the
VC inequality, Theorem 2.1), which gives a tight bound on the number of samples required to learn an
arbitrary distribution with respect to total variation distance.
p
Fact A.1. Let p be any distribution over [n]. We have: E[dTV (p, pbm )] = O( n/m).
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 561
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
Let p be a non-increasing distribution over [n]. (The analysis for the non-decreasing case is identical.)
Conceptually, we view algorithm L↓ as working in three steps:
• In the first step, it partitions the set [n] into a carefully chosen set I1 , . . . , I` of consecutive intervals,
with ` = O(m1/3 · (log n)2/3 ). Consider the flattened distribution p f over [n] obtained from p by
averaging the weight that p assigns to each interval over the entire interval. That is, for j ∈ [`] and
i ∈ I j , p f (i) = ∑t∈I j p(t)/|I j |. Then a simple argument given in [4] gives that
dTV (p f , p) = O (log n/(m + 1))1/3 .
• Let pr be the reduced distribution corresponding to p and the partition I1 , . . . , I` . That is, pr is
a distribution over [`] with pr (i) = p(Ii ) for i ∈ [`]. In the second step, the algorithm uses the m
samples to learn pr . (Note that pr is not necessarily monotone.) After m samples, one obtains a
hypothesis pbr such that
p
E[dTV (pr , pbr )] = O `/m = O (log n/(m + 1))1/3 .
The first equality follows from Fact A.1 (since pr is distribution over ` elements) and the second
inequality follows from the choice of `.
• Finally, the algorithm outputs the flattened hypothesis ( pbr ) f over [n] corresponding to pbr , i. e.,
obtained by pbr by subdividing the mass of each interval uniformly within the interval. It follows
from the above two steps that
E[dTV (( pbr ) f , p f )] = O (log n/(m + 1))1/3 .
• The combination of the first and third steps yields that
E[dTV (( pbr ) f , p)] = O (log n/(m + 1))1/3 .
The above arguments are entirely due to Birgé [4]. We now explain how his analysis can be extended
to show that his algorithm is in fact a semi-agnostic learner as claimed in Theorem 2.3. To avoid clutter
in the expressions below let us fix
1/3
δ := O (log n/(m + 1)) .
The second and third steps in the algorithm description above are used to learn the distribution p f
to variation distance δ . Note that these steps do not use the assumption that p is non-increasing. The
following claim, which generalizes Step 1 above, says that if p is τ-close to non-increasing, the flattened
distribution p f (defined as above) is (2τ + δ )-close to p. Therefore, it follows that, for such a distribution
p, algorithm L↓ succeeds with expected (total variation distance) error (2τ + δ ) + δ .
We have:
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 562
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
Claim A.2. Let p be a distribution over [n] that is τ-close to non-increasing. Then, the flattened
distribution p f (obtained from p by averaging its weight on every interval I j ) satisfies
dTV (p f , p) ≤ (2τ + δ ) .
Proof. Let p↓ be the non-increasing distribution that is τ-close to p. Let τ j denote the L1 -distance
between p and p↓ in the interval I j . Then, we have that
`
∑ τj ≤ τ . (A.1)
j=1
By Birgé’s arguments, it follows that the flattened distribution (p↓ ) f corresponding to p↓ is δ -close
to p↓ , hence (τ + δ )-close to p. That is,
dTV (p↓ ) f , p ≤ τ + δ . (A.2)
We want to show that
dTV (p↓ ) f , p f ≤ τ . (A.3)
Assuming (A.3) holds, we can conclude by the triangle inequality that
dTV (p, p f ) ≤ 2τ + δ
as desired.
Observe that, by assumption, p and p↓ have L1 -distance at most τ j in each I j interval. In particular,
this implies that, for all j ∈ [`], it holds
p(I j ) − p↓ (I j ) ≤ τ j .
Now note that, within each interval I j , p f and (p↓ ) f are both uniform. Hence, the contribution of I j to the
variation distance between p f and (p↓ ) f is at most |p(I j ) − p↓ (I j )|.
Therefore, by (A.1) we deduce
dTV (p f , (p↓ ) f ) ≤ τ
which completes the proof of the claim.
B Hypothesis testing
Our hypothesis testing routine Choose-Hypothesis p runs a simple “competition” to choose a winner
between two candidate hypothesis distributions h1 and h2 over [n] that it is given in the input either
explicitly, or in some succinct way. We show that if at least one of the two candidate hypotheses
is close to the target distribution p, then with high probability over the samples drawn from p the
routine selects as winner a candidate that is close to p. This basic approach of running a competition
between candidate hypotheses is quite similar to the “Scheffé estimate” proposed by Devroye and Lugosi
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 563
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
(see [10, 11] and Chapter 6 of [12]), which in turn built closely on the work of [27], but there are some
small differences between our approach and theirs; the [12] approach uses a notion of the “competition”
between two hypotheses which is not symmetric under swapping the two competing hypotheses, whereas
our competition is symmetric.
We now prove Theorem 2.4.
Proof of Theorem 2.4. Let W be the support of p. To set up the competition between h1 and h2 , we define
the following subset of W:
W1 = W1 (h1 , h2 ) := {w ∈ W h1 (w) > h2 (w)} . (B.1)
Let then p1 = h1 (W1 ) and q1 = h2 (W1 ). Clearly, p1 > q1 and dTV (h1 , h2 ) = p1 − q1 .
The competition between h1 and h2 is carried out as follows:
1. If p1 − q1 ≤ 5ε 0 , declare a draw and return either hi . Otherwise:
2. Draw
log(1/δ 0 )
m=O
ε 02
samples s1 , . . . , sm from p, and let
1
τ= {i | si ∈ W1 }
m
be the fraction of samples that fall inside W1 .
3. If τ > p1 − 23 ε 0 , declare h1 as winner and return h1 ; otherwise,
4. if τ < q1 + 23 ε 0 , declare h2 as winner and return h2 ; otherwise,
5. declare a draw and return either hi .
It is not hard to check that the outcome of the competition does not depend on the ordering of the pair
of distributions provided in the input; that is, on inputs (h1 , h2 ) and (h2 , h1 ) the competition outputs the
same result for a fixed sequence of samples s1 , . . . , sm drawn from p.
The correctness of Choose-Hypothesis is an immediate consequence of the following lemma.
Lemma B.1. Suppose that dTV (p, h1 ) ≤ ε 0 . Then:
(i) If dTV (p, h2 ) > 6ε 0 , then the probability that the competition between h1 and h2 does not declare
02
h1 as the winner is at most e−mε /2 . (Intuitively, if h2 is very bad then it is very likely that h1 will
be declared winner.)
(ii) If dTV (p, h2 ) > 4ε 0 , the probability that the competition between h1 and h2 declares h2 as the
02
winner is at most e−mε /2 . (Intuitively, if h2 is only moderately bad then a draw is possible but it is
very unlikely that h2 will be declared winner.)
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 564
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
Proof. Let r = p(W1 ). The definition of the total variation distance implies that |r − p1 | ≤ ε 0 . Let us
define the 0/1 (indicator) random variables {Z j }mj=1 as Z j = 1 iff s j ∈ W1 . Clearly,
1 m
τ= ∑ Zj and E[τ] = E[Z j ] = r .
m j=1
Since the Z j ’s are mutually independent, it follows from the Chernoff bound that
02
Pr[τ ≤ r − ε 0 /2] ≤ e−mε /2 .
Using |r − p1 | ≤ ε 0 we get that
02
Pr[τ ≤ p1 − 3ε 0 /2] ≤ e−mε /2 .
• For part (i): If dTV (p, h2 ) > 6ε 0 , from the triangle inequality we get that p1 −q1 = dTV (h1 , h2 ) > 5ε 0 .
02
Hence, the algorithm will go beyond Step 1, and with probability at least 1 − e−mε /2 , it will stop
at Step 3, declaring h1 as the winner of the competition between h1 and h2 .
• For part (ii): If p1 − q1 ≤ 5ε 0 then the competition declares a draw, hence h2 is not the winner.
Otherwise we have p1 − q1 > 5ε 0 and the above arguments imply that the competition between h1
02
and h2 will declare h2 as the winner with probability at most e−mε /2 .
This concludes the proof of Lemma B.1.
The proof of the theorem is now complete.
C Using the hypothesis tester
In this section, we explain in detail how we use the hypothesis testing algorithm Choose-Hypothesis
throughout this paper. In particular, the algorithm Choose-Hypothesis is used in the following places:
• In Step 4 of algorithm Learn-kmodal-simple we need an algorithm L↓ δ 0 (resp. L↑ δ 0 ) that learns
a non-increasing (resp. non-increasing) distribution within total variation distance ε and confidence
δ 0 . Note that the corresponding algorithms L↓ and L↑ provided by Theorem 2.3 have confidence
9/10. To boost the confidence of L↓ (resp. L↑ ) we run the algorithm O(log(1/δ 0 )) times and
use Choose-Hypothesis in an appropriate tournament procedure to select among the candidate
hypothesis distributions.
• In Step 5 of algorithm Learn-kmodal-simple we need to select among two candidate hypothesis
distributions (with the promise that at least one of them is close to the true conditional distribution).
In this case, we run Choose-Hypothesis once to select between the two candidates.
• Also note that both algorithms Learn-kmodal-simple and Learn-kmodal generate an ε-accurate
hypothesis with probability 9/10. We would like to boost the probability of success to 1 − δ .
To achieve this we again run the corresponding algorithm O(log(1/δ )) times and use Choose-
Hypothesis in an appropriate tournament to select among the candidate hypothesis distributions.
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 565
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
We now formally describe the “tournament” algorithm to boost the confidence to 1 − δ .
Lemma C.1. Let p be any distribution over a finite set W. Suppose that Dε is a collection of N
distributions over W such that there exists q ∈ Dε with dTV (p, q) ≤ ε. Then there is an algorithm that
uses O(ε −2 log N log(1/δ )) samples from p and with probability 1 − δ outputs a distribution p0 ∈ Dε
that satisfies dTV (p, p0 ) ≤ 6ε.
Devroye and Lugosi (Chapter 7 of [12]) prove a similar result by having all pairs of distributions
in the cover compete against each other using their notion of a competition, but again there are some
small differences: their approach chooses a distribution in the cover which wins the maximum number of
competitions, whereas our algorithm chooses a distribution that is never defeated (i. e., won or achieved a
draw against all other distributions in the cover). Instead we follow the approach from [9].
Proof. The algorithm performs a tournament by running the competition Choose-Hypothesis p (hi , h j , ε,
δ /(2N)) for every pair of distinct distributions hi , h j in the collection Dε . It outputs a distribution q? ∈ Dε
that was never a loser (i. e., won or achieved a draw in all its competitions). If no such distribution exists
in Dε then the algorithm outputs “failure.”
By definition, there exists some q ∈ Dε such that dTV (p, q) ≤ ε. We first argue that with high
probability this distribution q never loses a competition against any other q0 ∈ Dε (so the algorithm does
not output “failure”). Consider any q0 ∈ Dε . If dTV (p, q0 ) > 4ε, by Lemma B.1(ii) the probability that q
2
loses to q0 is at most 2e−mε /2 = O(1/N). On the other hand, if dTV (p, q0 ) ≤ 4δ , the triangle inequality
gives that dTV (q, q0 ) ≤ 5ε and thus q draws against q0 . A union bound over all N distributions in Dε
shows that with probability 1 − δ /2, the distribution q never loses a competition.
We next argue that with probability at least 1 − δ /2, every distribution q0 ∈ Dε that never loses has
small variation distance from p. Fix a distribution q0 such that dTV (q0 , p) > 6ε; Lemma B.1(i) implies
2
that q0 loses to q with probability 1 − 2e−mε /2 ≥ 1 − δ /(2N). A union bound gives that with probability
1 − δ /2, every distribution q0 that has dTV (q0 , p) > 6ε loses some competition.
Thus, with overall probability at least 1 − δ , the tournament does not output “failure” and outputs
some distribution q? such that dTV (p, q? ) is at most 6ε. This proves the lemma.
We now explain how the above lemma is used in our context: Suppose we perform O(log(1/δ ))
runs of a learning algorithm that constructs an ε-accurate hypothesis with probability at least 9/10.
Then, with failure probability at most δ /2, at least one of the hypotheses generated is ε-close to
the true distribution in variation distance. Conditioning on this good event, we have a collection of
distributions with cardinality O(log(1/δ )) that satisfies the assumption of the lemma. Hence, using
O (1/ε 2 ) · log log(1/δ ) · log(1/δ ) samples we can learn to accuracy 6ε and confidence 1 − δ /2. The
overall sample complexity is O(log(1/δ )) times the sample complexity of the learning algorithm run
with confidence 9/10, plus this additional O (1/ε 2 ) · log log(1/δ ) · log(1/δ ) term.
In terms of running time,we make the following easily verifiable remarks: When the hypothesis
testing algorithm Choose-Hypothesis is run on a pair of distributions that are produced by Birgé’s
algorithm, its running time is polynomial in the succinct description of these distributions, i. e., in
log2 (n)/ε. Similarly, when Choose-Hypothesis is run on a pair of outputs of Learn-kmodal-simple
or Learn-kmodal, its running time is polynomial in the succinct description of these distributions. More
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 566
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
specifically, in the former case, the succinct description has bit complexity O k · log2 (n)/ε 2 (since
the output consists of O(k/ε) monotone intervals, and the conditional distribution on each interval is
the output of Birgé’s algorithm for that interval). In the latter case, the succinct description has bit
2
complexity O k · log (n)/ε , since the algorithm Learn-kmodal constructs only k monotone intervals.
Hence, in both cases, each execution of the testing algorithm performs poly(k, log n, 1/ε) bit operations.
Since the tournament invokes the algorithm Choose-Hypothesis O(log2 (1/δ )) times (for every pair of
distributions in our pool of O(log(1/δ )) candidates) the upper bound on the running time follows.
References
[1] G UILLERMO A LVAREZ DE T OLEDO AND J ULIO M. F ERNANDEZ: Patch-clamp measurements
reveal multimodal distribution of granule sizes in rat mast cells. J. Cell Biology, 110(4):1033–1039,
1990. [doi:10.1083/jcb.110.4.1033] 536
[2] T U ĞKAN BATU , R AVI K UMAR , AND RONITT RUBINFELD: Sublinear algorithms for testing
monotone and unimodal distributions. In Proc. 36th STOC, pp. 381–390. ACM Press, 2004.
[doi:10.1145/1007352.1007414] 548
[3] L UCIEN B IRGÉ: Estimating a density under order restrictions: Nonasymptotic minimax risk. Annals
of Statistics, 15(3):995–1012, 1987. Available at JSTOR. 536, 537
[4] L UCIEN B IRGÉ: On the risk of histograms for estimating decreasing densities. Annals of Statistics,
15(3):1013–1022, 1987. Available at JSTOR. 536, 537, 540, 541, 561, 562
[5] L UCIEN B IRGÉ: Estimation of unimodal densities without smoothness assumptions. Annals of
Statistics, 25(3):970–981, 1997. Available at JSTOR. 536
[6] K UNG -S IK C HAN AND H OWELL T ONG: Testing for multimodality with dependent data.
Biometrika, 91(1):113–123, 2004. [doi:10.1093/biomet/91.1.113] 536
[7] L OREN C OBB , P ETER KOPPSTEIN , AND N ENG H SIN C HEN: Estimation and moment recursion
relations for multimodal distributions of the exponential family. J. American Statistical Association,
78(381):124–130, 1983. [doi:10.1080/01621459.1983.10477940] 536
[8] C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO: Learning
k-modal distributions via testing. In Proc. 23rd Ann. ACM-SIAM Symp. on Discrete Algorithms
(SODA’12), pp. 1371–1385. ACM Press, 2012. Available at ACM DL. 535
[9] C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO: Learn-
ing Poisson binomial distributions. In Proc. 44th STOC, pp. 709–728. ACM Press, 2012.
[doi:10.1145/2213977.2214042, arXiv:1107.2702] 541, 566
[10] L UC D EVROYE AND G ÁBOR L UGOSI: A universally acceptable smoothing factor for kernel density
estimates. Annals of Statistics, 24(6):2499–2512, 1996. Available at JSTOR. 564
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 567
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
[11] L UC D EVROYE AND G ÁBOR L UGOSI: Nonasymptotic universal smoothing factors, kernel com-
plexity and Yatracos classes. Annals of Statistics, 25(6):2626–2637, 1997. Available at JSTOR.
564
[12] L UC D EVROYE AND G ÁBOR L UGOSI: Combinatorial Methods in Density Estimation. Springer,
2001. 540, 541, 564, 566
[13] F RANCESCO R. F ERRARO , BARBARA PALTRINIERI , F LAVIO F USI P ECCI , ROBERT T. ROOD ,
AND B EN D ORMAN : Multimodal distributions along the horizontal branch. The Astrophysical
Journal, 500(1):311–319, 1998. [doi:10.1086/305712] 536
[14] O DED G OLDREICH, editor. Property Testing: Current Research and Surveys. Springer, 2010.
LNCS 6390. 538
[15] O DED G OLDREICH: Highlights of the Bertinoro workshop on Sublinear Algorithms (unpublished
comments). Available at author’s website, 2011. 538
[16] O DED G OLDREICH , S HAFI G OLDWASSER , AND DANA RON: Property testing and its connection
to learning and approximation. J. ACM, 45(4):653–750, 1998. Preliminary version at FOCS’96.
[doi:10.1145/285055.285060] 538
[17] P IET G ROENEBOOM: Estimating a monotone density. In Proc. of the Berkeley Conference in Honor
of Jerzy Neyman and Jack Kiefer, pp. 539–555, 1985. Available at CWI. 536
[18] M ICHAEL J. K EARNS AND DANA RON: Testing problems with sublearning sample com-
plexity. J. Comput. System Sci., 61(3):428–456, 2000. Preliminary version in COLT’98.
[doi:10.1006/jcss.1999.1656] 538
[19] J OHANNES H. B. K EMPERMAN: Mixtures with a limited number of modal intervals. Annals of
Statistics, 19(4):2120–2144, 1991. Available at JSTOR. 536
[20] E DMOND A. M URPHY: One cause? many causes?: The argument from the bimodal distribution. J.
Chronic Diseases, 17(4):301–324, 1964. [doi:10.1016/0021-9681(64)90073-6] 536
[21] ROGER B. M YERSON: Optimal auction design. Mathematics of Operations Research, 6(1):58–73,
1981. [doi:10.1287/moor.6.1.58] 555, 558
[22] D ONALD J. N EWMAN AND L AWRENCE S HEPP: The double dixie cup problem. American
Mathematical Monthly, 67(1):58–61, 1960. [doi:10.2307/2308930] 546, 551
[23] B. L. S. P RAKASA R AO: Estimation of a unimodal density. Sankhya Ser. A, 31(1):23–36, 1969.
Available at JSTOR. 536
[24] DANA RON: Property Testing: A Learning Theory Perspective. Foundations and Trends in Machine
Learning, 1(3):307–402, 2008. [doi:10.1561/2200000004] 538
[25] DANA RON: Algorithmic and analysis techniques in property testing. Foundations and Trends in
Theoretical Computer Science, 5:73–205, 2010. [doi:10.1561/0400000029] 538
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 568
L EARNING k-M ODAL D ISTRIBUTIONS VIA T ESTING
[26] E DWARD J. W EGMAN: Maximum likelihood estimation of a unimodal density. I. and II. Ann. Math.
Statist., 41:457–471, 2169–2174, 1970. Available at JSTOR. 536
[27] YANNIS G. YATRACOS: Rates of convergence of minimum distance estimators and Kolmogorov’s
entropy. Annals of Statistics, 13(2):768–774, 1985. Available at JSTOR. 564
AUTHORS
Constantinos Daskalakis
Associate professor
Department of Electrical Engineering and Computer Science
Massachussetts Institute of Technology
costis csail mit edu
http://people.csail.mit.edu/costis/
Ilias Diakonikolas
Assistant professor
School of Informatics
University of Edinburgh
ilias.d ed ac uk
http://www.iliasdiakonikolas.org
Rocco A. Servedio
Associate professor
Department of Computer Science Columbia University
rocco cs columbia edu
http://www.cs.columbia.edu/~rocco
ABOUT THE AUTHORS
C ONSTANTINOS DASKALAKIS (addressed as “Costis” by friends and colleagues) is an
associate professor in the Department of Electrical Engineering and Computer Science
at MIT. He holds a diploma in Electrical and Computer Engineering from the National
Technical University of Athens, and a Ph. D. in Electrical Engineering and Computer
Sciences from UC Berkeley, where his Ph. D. was supervised by Christos Papadimitriou.
His research interests lie in the interface of computation with economics and probability,
in particular the complexity of equilibria and fixed points, mechanism design, and
machine learning.
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 569
C ONSTANTINOS DASKALAKIS , I LIAS D IAKONIKOLAS , AND ROCCO A. S ERVEDIO
I LIAS D IAKONIKOLAS is an assistant professor in the School of Informatics at the University
of Edinburgh. He obtained a diploma in Electrical and Computer Engineering from
the National Technical University of Athens, and a Ph. D. in Computer Science from
Columbia University advised by Mihalis Yannakakis. His research interests lie in
algorithms, learning, statistics, and game theory. The current focus of his work is on
algorithms for machine learning.
ROCCO S ERVEDIO is an associate professor in the Department of Computer Science at
Columbia University. He graduated from Harvard University, where his Ph. D. was su-
pervised by Les Valiant. He is interested in computational learning theory, computational
complexity, and property testing, with the study of Boolean functions as an underlying
theme tying these topics together. He enjoys spending time with his family and hopes to
share a bottle of Cutty Sark with H. M. in the afterlife.
T HEORY OF C OMPUTING, Volume 10 (20), 2014, pp. 535–570 570