Dirichlet process

Intermediate

What you need first. Nothing else on this path comes first. This page is part of Bayesian statistics.

In Bayesian statistics, the Dirichlet process is a distribution over probability distributions whose draws are discrete, used as a prior when the number of mixture components is not fixed in advance. The Dirichlet process is a prior distribution over probability distributions. Where an ordinary Bayesian model places a prior on a finite-dimensional parameter — a mean, a coefficient, a vector of category probabilities — a Dirichlet process prior places a prior on the unknown distribution GG itself, and observations are modelled as drawn from GG. The prior is specified by a probability distribution G0G_0, the base measure, which is the prior mean of GG, and a positive number α\alpha, the concentration parameter, which controls how tightly GG concentrates around G0G_0. The framework is the founding example of Bayesian nonparametrics. Ferguson introduced the process in 1973, setting two requirements for such a prior: its support should be large, and its posterior given a sample should be manageable analytically .[1]

Three facts organise what follows. First, the process is defined by a consistency requirement: on every finite partition, the random cell probabilities follow a Dirichlet distribution with parameters determined by G0G_0 and α\alpha. Second, a draw from a Dirichlet process is discrete with probability one, even when G0G_0 is continuous — a theorem, not an approximation. Third, the prior is conjugate: the posterior of GG given a sample is again a Dirichlet process, with parameters combining G0G_0 with the empirical distribution .[1]

Dirichlet process

Dirichlet process
Fact Value
Topic Bayesian statistics
Listed on Bayesian statistics
Worked example 1

Why a prior on distributions?

Consider estimating an unknown distribution from a sample, without assuming it belongs to a named family. A Bayesian answer requires a probability distribution over the candidate distributions, so that Bayes’ rule can update it in the light of the sample. Ferguson states the difficulty directly: in nonparametric problems the parameter space is a set of probability distributions, and workable priors on such a space were hard to find. His two desirable properties were that “(I) The support of the prior distribution should be large — with respect to some suitable topology on the space of probability distributions on the sample space” and that “(II) Posterior distributions given a sample of observations from the true probability distribution should be manageable analytically” .[1] The properties pull in opposite directions: a prior diffuse enough to reach every plausible distribution usually has an uncomputable posterior, and a prior chosen for convenience excludes most distributions in advance.

The Dirichlet process was designed to satisfy both. Property (II) is delivered by the conjugacy proved below. Property (I) holds in this sense: for any fixed probability measure QQ absolutely continuous with respect to the parameter measure, and any finite collection of sets, GG falls within any stated tolerance of QQ on all of them simultaneously with positive probability .[1] On the real line, with the topology of convergence in distribution, the support is all probability measures supported inside the support of the base measure .[1] A base measure with full support thus gives a prior supported on the whole space of distributions: no shape is excluded in advance. What the prior does exclude, with probability one, is continuity of the drawn distribution itself.

This is the sense in which the process is nonparametric: the parameter, GG, is infinite-dimensional, and a fitted model’s effective complexity — the number of distinct values or components in use — grows with the sample size rather than being fixed in advance, provided G0G_0 has infinite support. If G0G_0 is carried by finitely many points, the picture collapses to the finite analogue: GG is then a Dirichlet-distributed weight vector on those points, and the number of distinct values can never exceed the size of that support, however large the sample grows. The finite-dimensional analogue is Dirichlet–multinomial conjugacy: counts add to Dirichlet parameters on a fixed partition. The Dirichlet process extends that construction to all finite partitions at once, which is why the same conjugacy reappears as its posterior result.

Dirichlet marginals on every finite partition

Let the sample space be a set X\mathcal{X} with a collection of measurable subsets. A random probability measure GG is a random object whose realisations are probability measures: for each measurable set AA, G(A)G(A) is a random variable in [0,1][0, 1], and with probability one the realised function A↦G(A)A \mapsto G(A) is a probability measure. Let G0G_0 be a fixed probability measure on X\mathcal{X} and α>0\alpha > 0. Then GG follows a Dirichlet process with concentration α\alpha and base measure G0G_0, written

G∼DP(α,G0),G \sim \mathrm{DP}(\alpha, G_0),

if, for every finite measurable partition A1,…,AkA_1, \dots, A_k of X\mathcal{X} — disjoint measurable sets whose union is X\mathcal{X}, for any k≥1k \geq 1 — the random vector of cell probabilities has the Dirichlet distribution

(G(A1),…,G(Ak))∼Dirichlet(αG0(A1),…,αG0(Ak)).(G(A_1), \dots, G(A_k)) \sim \mathrm{Dirichlet}(\alpha G_0(A_1), \dots, \alpha G_0(A_k)).

Ferguson’s original definition uses a single finite non-null measure α(⋅)\alpha(\cdot) in place of the pair (α,G0)(\alpha, G_0), with Dirichlet parameters (α(A1),…,α(Ak))(\alpha(A_1), \dots, \alpha(A_k)) .[1] The formulations coincide, with α(A)=αG0(A)\alpha(A) = \alpha G_0(A): α\alpha is the total mass and G0G_0 the normalised measure — where the mass of GG is expected to lie, and how strongly that expectation is held.

Two points require care. First, the requirement is imposed for every finite partition simultaneously, and the Dirichlet family is coherent under refinement and coarsening: aggregating cells gives a Dirichlet vector with aggregated parameters. That coherence makes the definition consistent — the law of (G(A1),…,G(Ak))(G(A_1), \dots, G(A_k)) does not depend on which larger partition the sets came from — and Ferguson verifies the Kolmogorov consistency conditions .[1] Second, the definition specifies distributions rather than a realisation; Sethuraman notes a gap in passing to a countably additive random measure, which his constructive definition, below, removes .[2]

The definition determines the prior mean and variance of G(A)G(A) for any set AA: the partition {A,Ac}\{A, A^c\} gives G(A)∼Beta(αG0(A),α(1−G0(A)))G(A) \sim \mathrm{Beta}(\alpha G_0(A), \alpha(1 - G_0(A))), since a two-component Dirichlet vector is a beta distribution. The Dirichlet moments recorded by Ferguson ,[1] applied to this marginal, give

E[G(A)]=G0(A),Var(G(A))=G0(A)(1−G0(A))α+1.\mathbb{E}[G(A)] = G_0(A), \qquad \mathrm{Var}(G(A)) = \frac{G_0(A)(1 - G_0(A))}{\alpha + 1}.

The expectation is Ferguson’s Proposition 1: E[P(A)]=α(A)/α(X)\mathbb{E}[P(A)] = \alpha(A)/\alpha(\mathcal{X}) .[1] The variance formula is exact: the prior mean of G(A)G(A) does not depend on α\alpha, and its variance is the largest possible for a probability with that mean, G0(A)(1−G0(A))G_0(A)(1 - G_0(A)), divided by α+1\alpha + 1. As α\alpha grows, GG concentrates around G0G_0; as α\alpha shrinks towards zero, it concentrates on distributions carried by very few atoms, as stick-breaking will show. Numerically, if G0(A)=1/2G_0(A) = 1/2, then Var(G(A))\mathrm{Var}(G(A)) is 1/8=0.1251/8 = 0.125 when α=1\alpha = 1, 1/16=0.06251/16 = 0.0625 when α=3\alpha = 3, and 1/40=0.0251/40 = 0.025 when α=9\alpha = 9. So α\alpha is a prior sample size: G0G_0 enters the posterior with the weight of α\alpha pseudo-observations, against nn real ones.

Discreteness, stick-breaking, the urn, and conjugacy

Draws are discrete: the atoms come first

A realisation of a Dirichlet process is, with probability one, a discrete probability measure: GG places all its mass on a countable collection of points. This holds without any condition on G0G_0. If G0G_0 is the standard normal distribution — with a density, no atoms, and G0({x})=0G_0(\{x\}) = 0 for every point xx — a draw G∼DP(α,G0)G \sim \mathrm{DP}(\alpha, G_0) still has the form G=∑kπkδθkG = \sum_k \pi_k \delta_{\theta_k}, where δθ\delta_{\theta} places mass one at θ\theta. Ferguson’s abstract states the conclusion of his Section 4 alternative definition, which “exhibits a version of the Dirichlet process that gives probability one to the set of discrete probability measures” ;[1] his Section 4 construction, normalising a gamma process’s jumps, produces the discrete realisation directly .[1] Sethuraman’s abstract records the same property as the second of his three basic results ,[2] and Neal states it as the starting point for mixture modelling: “Since realizations of the Dirichlet process are discrete with probability one, these models can be viewed as countably infinite mixtures” .[3]

Discreteness has an immediate consequence for sampling: draws from a realised GG coincide with positive probability, because two draws may select the same atom. Antoniak computes the first instance exactly: for a nonatomic parameter measure, the probability that the second draw equals the first is 1/(α+1)1/(\alpha + 1) [4] — 1/21/2 when α=1\alpha = 1, 1/31/3 when α=2\alpha = 2, against zero under any continuous sampling distribution. Ferguson flags the cost: the disadvantage appears “mainly because in sampling from a PP chosen by a Dirichlet process, we expect eventually to see one observation exactly equal to another”, and his goodness-of-fit example shows such a prior turning a test of uniformity into a test of continuity against discreteness .[1] The standard remedy, convolving GG with a continuous kernel, is the Dirichlet process mixture treated under ‘Dirichlet process mixtures: recovering continuous densities’ below.

The stick-breaking construction

The partition definition specifies distributions but does not exhibit a realisation. Sethuraman’s constructive definition does. Let V1,V2,…V_1, V_2, \dots be independent with Vk∼Beta(1,α)V_k \sim \mathrm{Beta}(1, \alpha), independently of independent draws θ1,θ2,…\theta_1, \theta_2, \dots from G0G_0. Define weights by

π1=V1,πk=Vk∏j<k(1−Vj)for k≥2,\pi_1 = V_1, \qquad \pi_k = V_k \prod_{j < k} (1 - V_j) \quad \text{for } k \geq 2,

and set G=∑k=1∞πkδθkG = \sum_{k=1}^{\infty} \pi_k \delta_{\theta_k}. In Sethuraman’s notation the break variables are independent Beta(1,α(X))(1, \alpha(\mathcal{X})) — α\alpha the total mass — the atoms are drawn from the normalised measure β=α(⋅)/α(X)\beta = \alpha(\cdot)/\alpha(\mathcal{X}), and ∑1≤m≤npm=1−∏1≤m≤n(1−θm)\sum_{1 \leq m \leq n} p_m = 1 - \prod_{1 \leq m \leq n} (1 - \theta_m) tends to one with probability one .[2] In the (α,G0)(\alpha, G_0) parametrisation, β\beta is G0G_0. Sethuraman proves the constructed GG has the required Dirichlet finite-dimensional distributions; built from point masses, it is discrete by construction .[2]

The name describes the arithmetic. Begin with a stick of unit length. Break off a fraction V1V_1; that piece, of length π1=V1\pi_1 = V_1, is the weight of θ1\theta_1. From the remainder, of length 1−V11 - V_1, break off a fraction V2V_2; that piece, of length π2=V2(1−V1)\pi_2 = V_2(1 - V_1), is the weight of θ2\theta_2. Continue indefinitely. The mass remaining after KK breaks, ∏j≤K(1−Vj)\prod_{j \leq K} (1 - V_j), tends to zero with probability one, so the weights sum to one. The expected weights are exact: E[Vk]=1/(1+α)\mathbb{E}[V_k] = 1/(1 + \alpha) and independence gives E[πk]=11+α(α1+α)k−1\mathbb{E}[\pi_k] = \frac{1}{1 + \alpha} \left(\frac{\alpha}{1 + \alpha}\right)^{k-1}, a geometric sequence; for α=2\alpha = 2, E[π1]=1/3\mathbb{E}[\pi_1] = 1/3 and E[π2]=2/9\mathbb{E}[\pi_2] = 2/9. Large α\alpha spreads mass over many atoms; small α\alpha makes the first few breaks large, so a draw is dominated by a handful of atoms.

The Pólya urn and the Chinese restaurant process

Integrating out GG changes the viewpoint from the random measure to the observations, and gives the description most useful for clustering. Let X1,X2,…X_1, X_2, \dots be drawn from G∼DP(α,G0)G \sim \mathrm{DP}(\alpha, G_0), independently conditionally on GG: sampling independence holds given the shared random measure, and it is the integration over GG that makes the sequence dependent. The sequence is exchangeable, so it can be described by its successive conditionals, which have a closed form. Blackwell and MacQueen define a Pólya sequence by P(X1∈B)=α(B)/α(X)\mathbb{P}(X_1 \in B) = \alpha(B)/\alpha(\mathcal{X}) and

P(Xn+1∈B∣X1,…,Xn)=α(B)+∑i=1nδXi(B)α(X)+n\mathbb{P}(X_{n+1} \in B \mid X_1, \dots, X_n) = \frac{\alpha(B) + \sum_{i=1}^{n} \delta_{X_i}(B)}{\alpha(\mathcal{X}) + n}

for every measurable set BB, where δx(B)\delta_{x}(B) is one if x∈Bx \in B and zero otherwise .[5] In (α,G0)(\alpha, G_0) notation, the conditional distribution of Xn+1X_{n+1} given the past is αα+nG0+1α+n∑i=1nδXi\frac{\alpha}{\alpha + n} G_0 + \frac{1}{\alpha + n} \sum_{i=1}^{n} \delta_{X_i}: a weighted average of the base measure and the empirical distribution so far. Blackwell and MacQueen prove the converse as well: a Pólya sequence’s empirical distribution converges with probability one to a limiting discrete measure with Ferguson’s Dirichlet distribution, and given the limit the observations are independent with that distribution .[5] Urn and process are two descriptions of one object: a ball is drawn, returned, and a second ball of the same colour added, so seen colours become more likely to recur. Neal records the same conditional as his equation (2.2) .[3]

The Chinese restaurant process is this same urn scheme retold as a seating rule; it is not a second model, and not a separate invention layered on top of the Dirichlet process. Customers arrive one at a time; the first sits at a new table, and each later customer either joins an occupied table, with probability proportional to the number already seated there, or starts a new table, with probability proportional to α\alpha. If nn customers are seated at tables with occupancies n1,…,nKn_1, \dots, n_K, the next joins table jj with probability nj/(α+n)n_j/(\alpha + n) and starts a new table with probability α/(α+n)\alpha/(\alpha + n). These are the urn probabilities grouped by table: joining table jj is the event Xn+1=θj∗X_{n+1} = \theta_j^{*}, where θj∗\theta_j^{*} is the shared value at that table; a new table is a fresh draw from G0G_0. The tables are the clusters of the model, with one caveat: a fresh draw from G0G_0 can coincide with an existing table’s value when G0G_0 has atoms, so the number of tables and the number of distinct values among the observations can differ. The implication between the two descriptions runs one way only: joining a specific table implies sharing that table’s value, but sharing a value does not imply sharing a table — two tables can carry the same value, opened by separate fresh draws that happened to coincide. The two counts agree when G0G_0 is nonatomic, since a fresh draw then differs from every previous value with probability one. The same distinction governs ties: for two draws, the probability of a tie is 1α+1+αα+1Pr⁡(Y=Y′)\frac{1}{\alpha + 1} + \frac{\alpha}{\alpha + 1} \Pr(Y = Y'), where YY and Y′Y' are independent draws from G0G_0 — the first term is the chance the second draw joins the first draw’s table, the second the chance that a fresh draw from G0G_0 lands on the same value. For nonatomic G0G_0, Pr⁡(Y=Y′)=0\Pr(Y = Y') = 0 and the formula reduces to the 1/(α+1)1/(\alpha + 1) computed above; for a point-mass G0G_0, Pr⁡(Y=Y′)=1\Pr(Y = Y') = 1 and a tie is certain. Antoniak’s sampling calculations are the restaurant arithmetic without the metaphor: at step ii the draw opens a new table — takes a fresh draw from G0G_0 — with probability α/(α+i−1)\alpha/(\alpha + i - 1), whatever the pattern of repetitions so far .[4] A new table is not automatically a new value. When G0G_0 is nonatomic, Antoniak’s setting, a fresh draw is a new distinct value with probability one, and α/(α+i−1)\alpha/(\alpha + i - 1) is also the probability that the draw at step ii is distinct from all previous draws. When G0G_0 has atoms it need not be: if G0G_0 is a point mass, every observation has the same value, new tables keep opening at rate α/(α+i−1)\alpha/(\alpha + i - 1), and after the first observation the probability of a new distinct value is zero.

The seating rule is also the prior on partitions, and it is not neutral: arrivals prefer large tables, so partitions with a few large clusters are favoured over balanced ones with the same number of tables. Its strength is controlled entirely by α\alpha: the rate of new tables depends only on the magnitude α\alpha of the parameter measure, not on its shape G0G_0, and in the nonatomic case Antoniak treats, the same is true of the rate of new distinct values .[4]

The posterior: conjugacy

The conjugacy promised by property (II) is exact. Let G∼DP(α,G0)G \sim \mathrm{DP}(\alpha, G_0) and let X1,…,XnX_1, \dots, X_n be a sample from GG. Then the conditional distribution of GG given the sample is again a Dirichlet process,

G∣X1,…,Xn∼DP(α+n, αG0+∑i=1nδXiα+n).G \mid X_1, \dots, X_n \sim \mathrm{DP}\left(\alpha + n,\ \frac{\alpha G_0 + \sum_{i=1}^{n} \delta_{X_i}}{\alpha + n}\right).

This is Ferguson’s main theorem: the posterior, given a sample, is a Dirichlet process with parameter α+∑i=1nδXi\alpha + \sum_{i=1}^{n} \delta_{X_i} .[1] Sethuraman lists the same closure as his third basic property: “the posterior distribution is also a Dirichlet measure” .[2]

The posterior concentration is α+n\alpha + n: pseudo-observations and real observations count identically. The posterior base measure is the weighted average of G0G_0 and the empirical distribution, with weights α/(α+n)\alpha/(\alpha + n) and n/(α+n)n/(\alpha + n), so every prior result transfers. In particular,

E[G(A)∣X1,…,Xn]=αG0(A)+#{i:Xi∈A}α+n,\mathbb{E}[G(A) \mid X_1, \dots, X_n] = \frac{\alpha G_0(A) + \#\{i : X_i \in A\}}{\alpha + n},

which is also the predictive probability that a further draw falls in AA — the urn conditional, read as a posterior statement. The posterior variance of G(A)G(A) is Gˉ(A)(1−Gˉ(A))/(α+n+1)\bar{G}(A)(1 - \bar{G}(A))/(\alpha + n + 1). As nn grows with α\alpha fixed, Gˉ\bar{G} approaches the empirical distribution and this variance shrinks at rate 1/n1/n: the prior washes out of set-by-set summaries, the summary-level consistency the sources support. Escobar and West use the same bookkeeping, where α=1\alpha = 1 “corresponds to the initial prior G0G_0 receiving the weight of one observation in the posterior” .[6]

Ties enter Gˉ\bar{G} with multiplicity: a value occurring mm times receives mass m/(α+n)m/(\alpha + n) there. A posterior draw is still discrete; smoothing comes from the mixture construction, not the update.

Mixtures, computation, and uses

Used directly, the Dirichlet process is a prior for an unknown distribution when the data are genuinely discrete, or when only set probabilities and functionals such as means and quantiles are of interest — Ferguson’s applications, including a distribution function, a mean, quantiles, and a two-sample problem in which the Mann–Whitney statistic appears .[1] Used as a mixing distribution, it gives the mixture: density estimation and clustering with the component count inferred rather than fixed. Used inside larger hierarchical Bayesian models, it gives each group its own distribution drawn from a shared prior. In each use the engine is the same pair of results: the urn predictive distribution, and the conjugate posterior for GG.

Dirichlet process mixtures: recovering continuous densities

The discreteness of GG is a defect for density estimation and a virtue for clustering; the mixture model keeps the virtue while removing the defect. Antoniak’s 1974 paper is the origin. He considers the random measure as a mixing distribution for a parameter that determines the distribution from which observations are made, and shows the posterior of the random measure is then no longer a simple Dirichlet process but a mixture of Dirichlet processes, with a closure property: sampling from a mixture of Dirichlet processes, with the sample distorted by random error, returns a posterior in the same class .[4] His corollary to Theorem 3 states the single-model version: if θ\theta is a sample from a Dirichlet process PP and XX is drawn from a transition probability F(θ,⋅)F(\theta, \cdot) given θ\theta, then PP given XX is a mixture of Dirichlet processes .[4] Neal dates the models the same way: “Dirichlet process mixture models go back to [4] and Ferguson (1983)” .[3]

In Neal’s notation, observations y1,…,yny_1, \dots, y_n are generated by

yi∣θi∼F(θi),θi∣G∼G,G∼DP(α,G0),y_i \mid \theta_i \sim F(\theta_i), \qquad \theta_i \mid G \sim G, \qquad G \sim \mathrm{DP}(\alpha, G_0),

where F(θ)F(\theta) is a sampling distribution indexed by θ\theta — the kernel .[3] Marginally, the distribution of an observation is the kernel convolution

f(y)=∫F(y∣θ) dG(θ)=∑k=1∞πkF(y∣θk),f(y) = \int F(y \mid \theta) \, dG(\theta) = \sum_{k=1}^{\infty} \pi_k F(y \mid \theta_k),

substituting the stick-breaking form of GG. If F(⋅∣θ)F(\cdot \mid \theta) is a continuous density for each θ\theta — a normal density with θ=(μ,σ2)\theta = (\mu, \sigma^2), in the most common case — then ff is a continuous density, a countably infinite mixture of continuous components, even though GG is discrete. The discreteness has moved to where it is useful: the latent θi\theta_i coincide with positive probability, so observations cluster around shared components, while the observable density is smooth. This is a finite mixture model with the component count left open: the model is also the limit, as K→∞K \to \infty, of a KK-component mixture whose proportions have a symmetric Dirichlet prior with parameter α/K\alpha/K per component ,[3] and the prior probability that two observations share a component is 1/(1+α)1/(1 + \alpha) .[3]

Escobar and West give the canonical instance, a mixture of normals for density estimation: GG over mean–variance pairs follows a Dirichlet process with E[G]=G0\mathbb{E}[G] = G_0, where G0G_0 is a normal/inverse-gamma prior, conjugate to the normal kernel, and α\alpha is a precision parameter for the concentration of GG about G0G_0 .[6] The predictive density is a data-adaptive kernel estimate with component parameters shrunk towards the prior, inheriting a kernel method’s smoothing while letting the data determine the number and placement of components .[6] Inference about the number of components KK is a by-product: its prior is induced by α\alpha and nn through Antoniak’s formulas, and for α\alpha small relative to nn — with nn between 50 and 250, say — the prior for KK “heavily favors single-digit values” .[6] A mixture thus counts clusters under a prior expecting few of them, not neutrally.

Computation

Exact posterior computation is not available beyond very small samples. Neal states the obstruction plainly: “Exact computation of posterior expectations for a Dirichlet process mixture model is infeasible when there are more than a few observations”, because the posterior ranges over all partitions of the observations and their component parameters .[3] The standard route is Markov chain Monte Carlo over the latent allocations, integrating GG out and working with the urn conditionals: each assignment is resampled from a conditional combining the urn probabilities — proportional to cluster size for an existing cluster, proportional to α\alpha for a new one — with the observation’s likelihood under each candidate.

When G0G_0 is conjugate to the kernel, component parameters integrate out analytically and allocations are resampled by Gibbs sampling; Neal’s Algorithm 1, used earlier by Escobar, resamples each θi\theta_i given the other allocations and the data .[3] The conjugate case is the exception in applications, and Neal’s contribution is methods for non-conjugate G0G_0: Metropolis–Hastings updates of the allocation indicators using the conditional prior as the proposal, and Gibbs samplers extended with auxiliary parameters drawn from G0G_0 for the unoccupied components a new cluster might use — his Algorithm 8, whose equilibrium distribution is exactly the posterior for any number of auxiliary parameters .[3] Escobar and West’s earlier sampler follows the same logic .[6]

A sweep’s cost grows with the number of occupied clusters as well as with nn; and because the chain moves one allocation at a time, splits and merges of large clusters are rare, so mixing over partitions can be slow even when within-cluster parameters mix well. Optimisation-based alternatives — see variational inference — and gradient-based samplers — see Hamiltonian Monte Carlo — address different parts of this cost. Importance sampling, the earlier simulation route, was displaced because its weights degenerate over the partition space .[6]

Worked example

Five breaks of the stick

Suppose the first five break fractions are realised as

V1=12,V2=13,V3=14,V4=15,V5=16.V_1 = \frac{1}{2}, \quad V_2 = \frac{1}{3}, \quad V_3 = \frac{1}{4}, \quad V_4 = \frac{1}{5}, \quad V_5 = \frac{1}{6}.

Five breaks of the stick: Break, Stick remaining before break, Weight
Break kk VkV_k Stick remaining before break Weight πk\pi_k
1 1/21/2 11 1/21/2
2 1/31/3 1/21/2 1/61/6
3 1/41/4 1/31/3 1/121/12
4 1/51/5 1/41/4 1/201/20
5 1/61/6 1/51/5 1/301/30

For instance, π3=V3(1−V1)(1−V2)=(1/4)(1/2)(2/3)=1/12\pi_3 = V_3(1 - V_1)(1 - V_2) = (1/4)(1/2)(2/3) = 1/12, and the remaining entries follow the same pattern. In decimal form the weights are approximately 0.50.5, 0.1666670.166667, 0.0833330.083333, 0.050.05 and 0.0333330.033333. Their sum is 1/2+1/6+1/12+1/20+1/30=5/61/2 + 1/6 + 1/12 + 1/20 + 1/30 = 5/6, and the mass remaining for all subsequent atoms is the unbroken remainder,

∏j=15(1−Vj)=12×23×34×45×56=16,\prod_{j=1}^{5} (1 - V_j) = \frac{1}{2} \times \frac{2}{3} \times \frac{3}{4} \times \frac{4}{5} \times \frac{5}{6} = \frac{1}{6},

so 5/6+1/6=15/6 + 1/6 = 1, as it must. Here the weights follow the pattern πk=1/(k(k+1))\pi_k = 1/(k(k+1)), a property of these fractions, not of stick-breaking in general. Realised weights need not decrease in general, and the remainder 1/6≈0.1666671/6 \approx 0.166667 is the total weight of all later atoms: truncation levels are set by the expected remainder (α1+α)K\left(\frac{\alpha}{1 + \alpha}\right)^K after KK breaks, not by the atom count.

The sixth customer, and how many tables to expect

Seating probabilities. Let α=2\alpha = 2, and suppose the first five customers are seated with three at one table and two at another. For the sixth customer the denominator is α+n=2+5=7\alpha + n = 2 + 5 = 7, so

P(join the table of 3)=37≈0.428571,P(join the table of 2)=27≈0.285714,P(new table)=27≈0.285714.\mathbb{P}(\text{join the table of 3}) = \frac{3}{7} \approx 0.428571, \qquad \mathbb{P}(\text{join the table of 2}) = \frac{2}{7} \approx 0.285714, \qquad \mathbb{P}(\text{new table}) = \frac{2}{7} \approx 0.285714.

The probabilities sum to 3/7+2/7+2/7=13/7 + 2/7 + 2/7 = 1. A new table is exactly as probable as joining the smaller table, because α=2\alpha = 2 gives the unexplored space the weight of two customers. Under α=1\alpha = 1 the same seating would give a new-table probability of 1/61/6: α\alpha, not the data pattern, sets the rate at which new clusters open.

Expected number of tables. Let KnK_n be the number of occupied tables after nn customers. Summing the indicators of new tables, each with probability α/(α+i−1)\alpha/(\alpha + i - 1) at step ii, gives

E[Kn]=∑i=1nαα+i−1,\mathbb{E}[K_n] = \sum_{i=1}^{n} \frac{\alpha}{\alpha + i - 1},

Antoniak’s formula for the expected number of tables .[4] When G0G_0 is nonatomic, KnK_n is also the number of distinct values among X1,…,XnX_1, \dots, X_n; with an atomic G0G_0 the number of distinct values is at most KnK_n, and can be strictly smaller.

For α=2\alpha = 2 and n=5n = 5 this is 2/2+2/3+2/4+2/5+2/6=29/10=2.92/2 + 2/3 + 2/4 + 2/5 + 2/6 = 29/10 = 2.9 exactly. For α=1\alpha = 1 the terms simplify to 1/i1/i, and for n=10n = 10,

E[K10]=∑i=1101i=H10=73812520≈2.928968,\mathbb{E}[K_{10}] = \sum_{i=1}^{10} \frac{1}{i} = H_{10} = \frac{7381}{2520} \approx 2.928968,

where H10H_{10} is the tenth harmonic number. Ten draws under α=1\alpha = 1 thus produce, on average, fewer than three tables — and, when G0G_0 is nonatomic, fewer than three distinct values: the discreteness of GG is the typical behaviour of the model, not a tail event. The expectation grows only logarithmically in nn — Escobar and West give the approximation E[Kn]≈αlog⁡(α+nα)\mathbb{E}[K_n] \approx \alpha \log\left(\frac{\alpha + n}{\alpha}\right), which for α=1\alpha = 1 and n=10n = 10 gives log⁡11≈2.397895\log 11 \approx 2.397895, below the exact 2.9289682.928968 at this small nn [6] — yet it still tends to infinity with nn, as Antoniak notes :[4] new clusters never stop arriving, only more and more slowly.

A posterior with ties

Let the prior be DP(3,G0)\mathrm{DP}(3, G_0) with G0G_0 uniform on [0,1][0, 1], and suppose the sample of size n=4n = 4 is X1=0.2X_1 = 0.2, X2=0.2X_2 = 0.2, X3=0.7X_3 = 0.7, X4=0.2X_4 = 0.2: 0.20.2 occurs three times and 0.70.7 once. By conjugacy, the posterior is a Dirichlet process with concentration 3+4=73 + 4 = 7 and base measure

Gˉ=3G0+3δ0.2+δ0.77.\bar{G} = \frac{3 G_0 + 3\delta_{0.2} + \delta_{0.7}}{7}.

Thus Gˉ\bar{G} places weight 3/73/7 on the atom at 0.20.2, weight 1/71/7 on the atom at 0.70.7, and the remaining 3/73/7 spread over [0,1][0, 1] according to G0G_0.

Take A=[0,0.5]A = [0, 0.5], so G0(A)=1/2G_0(A) = 1/2 and AA contains three of the four observations. The posterior mean is

E[G(A)∣data]=3×12+37=914≈0.642857.\mathbb{E}[G(A) \mid \text{data}] = \frac{3 \times \frac{1}{2} + 3}{7} = \frac{9}{14} \approx 0.642857.

Predictively, P(X5=0.2∣data)=3/7\mathbb{P}(X_5 = 0.2 \mid \text{data}) = 3/7, P(X5=0.7∣data)=1/7\mathbb{P}(X_5 = 0.7 \mid \text{data}) = 1/7, and the probability that a new value falls in AA is (3/7)(1/2)=3/14(3/7)(1/2) = 3/14; joining the atom in AA and drawing a new value in AA give 3/7+3/14=9/143/7 + 3/14 = 9/14, agreeing with the posterior mean, as the theory requires. The posterior variance of G(A)G(A) is

Var(G(A)∣data)=(9/14)(5/14)7+1=451568≈0.028699.\mathrm{Var}(G(A) \mid \text{data}) = \frac{(9/14)(5/14)}{7 + 1} = \frac{45}{1568} \approx 0.028699.

One caution: Gˉ\bar{G} is not a posterior draw. A draw’s weight at 0.20.2 is random — marginally a beta random variable centred near 3/73/7 — not a fixed 3/73/7. Reporting Gˉ\bar{G} as “the estimated distribution” conflates the posterior mean with the random measure.

Common misconceptions

“The Dirichlet process is a prior over smooth densities.” It is a prior over discrete distributions: every draw is a weighted sum of point masses, whatever G0G_0 is. Smooth densities arise only after the draw is convolved with a continuous kernel, in a mixture.

“G0G_0 is the distribution the data came from.” G0G_0 is the prior mean, E[G(A)]=G0(A)\mathbb{E}[G(A)] = G_0(A). A draw GG differs from G0G_0 in every realisation, by an amount governed by α\alpha; confusing the mean with a draw understates the spread by exactly the variance G0(A)(1−G0(A))/(α+1)G_0(A)(1 - G_0(A))/(\alpha + 1).

“α\alpha is a minor technical constant.” α\alpha is the prior sample size. It sets the prior variance of G(A)G(A), the tie probability — 1/(α+1)1/(\alpha + 1) when G0G_0 is nonatomic, larger when G0G_0 has atoms — the expected table count ∑iα/(α+i−1)\sum_i \alpha/(\alpha + i - 1), and the weight of G0G_0 against the data in the posterior.

“The Chinese restaurant process is an alternative to the Dirichlet process.” It is the Dirichlet process with GG integrated out, described through seating probabilities. Restaurant and urn rules give identical probabilities for every partition; neither approximates the other.

“The number of clusters found is the number that are really there.” The model has infinitely many components available and finitely many occupied. The occupied count is a posterior quantity under a prior favouring few, unequal clusters; it counts components used to represent the data, not a census of subpopulations.

“Nonparametric means assumption-free.” The process assumes exchangeability, a base measure whose support contains the truth, a concentration parameter, and — in the mixture — a kernel family. It removes only the assumption of a named finite-dimensional form.

Discreteness, concentration, and computation

Each of these limits traces to a result above.

Discreteness. Prior and posterior draws are discrete with probability one. Any use requiring GG itself to be continuous is a misuse; the mixture construction exists because of this limit, not as a refinement.

Sensitivity to α\alpha. The concentration parameter controls the prior variance of every G(A)G(A), the tie probability (1/(α+1)1/(\alpha + 1) for a nonatomic base, larger when the base has atoms), the expected number of occupied tables, and the pull towards G0G_0 in the posterior — one choice seen from four sides. Escobar and West’s observation that realistic α\alpha makes the prior for the component count favour single-digit values [6] is the sharpest warning: with thousands of observations, a default α=1\alpha = 1 still encodes a prior expectation of about log⁡n\log n clusters. A prior on α\alpha, as Neal’s hyperparameter updates allow ,[3] propagates the uncertainty but does not remove the dependence.

The prior on partitions favours unequal clusters. The restaurant rule joins large tables preferentially, so partitions with a few large clusters and many small ones have higher prior probability than balanced ones with the same number of clusters. Where the question concerns the partition itself — subtypes, regimes, communities — this is a substantive assumption, made by the urn rule whether or not it is acknowledged.

Computation. Posterior expectations require Markov chain sampling over partitions .[3] Results are Monte Carlo estimates whose error depends on the mixing of an allocation chain, and cluster summaries inherit mixture label ambiguity: the chain visits partitions, not named clusters, so a reported “cluster” is a summary built from co-allocation frequencies, not a parameter.

What consistency does and does not say. The posterior base measure converges to the empirical distribution as nn grows, so posterior means of G(A)G(A) are consistent at each fixed AA — a statement about one-dimensional summaries of GG, not a guarantee about densities, cluster counts or partitions in a mixture model, whose posterior behaviour depends on the kernel and on G0G_0 as well.

Connections

  • Bayesian inference — Bayes’ rule with a prior whose parameter is a distribution; the process’s conjugacy is the infinite-dimensional counterpart of the finite conjugate families.
  • Dirichlet distribution — the finite-dimensional law imposed on every finite partition; the process is determined by requiring it coherently for all partitions at once.
  • Dirichlet–multinomial conjugacy — the finite-partition special case of the posterior update: counts add to Dirichlet parameters, as a sample adds point masses to the parameter measure of the process.
  • Exchangeability — the symmetry validating the urn and restaurant descriptions: an exchangeable sequence from a random GG is generated by the Pólya urn conditionals.
  • Finite mixture model — a Dirichlet process mixture is the limit of finite mixtures as the component count grows, under a symmetric Dirichlet(α/K)(\alpha/K) prior.
  • Hierarchical Bayesian model — a Dirichlet process at the group level gives each group its own distribution, with G0G_0 and α\alpha controlling shared atoms.
  • Variational inference — an optimisation-based alternative to allocation Gibbs sampling, usually applied to a truncated stick-breaking representation.
  • Hamiltonian Monte Carlo — a gradient-based sampler for continuous kernel parameters, complementing the discrete allocation updates.
  • Importance sampling — the earlier simulation method for these posteriors, displaced by allocation-resampling methods because its weights degenerate over the partition space.

Check yourself

  1. Stick-breaking fractions V1=1/4V_1 = 1/4 and V2=1/2V_2 = 1/2 are realised. What are the weights π1\pi_1 and π2\pi_2 of the first two atoms, and how much mass remains for the later atoms?

π1=V1=1/4\pi_1 = V_1 = 1/4. The second break takes half of the remaining 3/43/4, so π2=(1/2)(3/4)=3/8\pi_2 = (1/2)(3/4) = 3/8. The mass remaining after two breaks is (3/4)(1/2)=3/8(3/4)(1/2) = 3/8, and 1/4+3/8+3/8=11/4 + 3/8 + 3/8 = 1.

  1. In a Chinese restaurant process with α=1\alpha = 1, four customers are seated: three at one table and one at another. What are the probabilities that the fifth customer joins the table of three, joins the table of one, and starts a new table?

The denominator is α+n=1+4=5\alpha + n = 1 + 4 = 5: the table of three with probability 3/53/5, the table of one with probability 1/51/5, and a new table with probability α/(α+n)=1/5\alpha/(\alpha + n) = 1/5, summing to 11.

  1. A prior G∼DP(1,G0)G \sim \mathrm{DP}(1, G_0) has G0(A)=1/4G_0(A) = 1/4 for a set AA. Two observations are drawn from GG, and both fall in AA. What is the posterior mean of G(A)G(A)?

The posterior has concentration 1+2=31 + 2 = 3, and its mean at AA is (αG0(A)+2)/(α+n)=(1×1/4+2)/3=3/4(\alpha G_0(A) + 2)/(\alpha + n) = (1 \times 1/4 + 2)/3 = 3/4. The two observations outweigh the prior’s single pseudo-observation, which assigned AA probability 1/41/4.

History

Thomas S. Ferguson introduced the Dirichlet process in “A Bayesian analysis of some nonparametric problems”, in the Annals of Statistics in 1973 .[1] The paper defined the process by its Dirichlet finite-dimensional distributions, proved the posterior is again a Dirichlet process, gave a normalised gamma process construction making discreteness explicit, and developed applications to distribution functions, means and quantiles .[1] In the same issue, Blackwell and MacQueen connected Ferguson’s distributions to generalised Pólya urn schemes .[5] [4] extended the theory to mixtures of Dirichlet processes and derived the tie and distinct-value formulas underlying the restaurant representation .[4]

For two decades the process was principally theoretical, because its posteriors could not be computed for the mixture models where it was most needed. Sethuraman’s constructive definition, published in Statistica Sinica in 1994 after circulating from 1980, rebuilt the process from independent beta variables and point masses, with self-contained proofs of discreteness and posterior closure .[2] [6] made mixtures of normals a working method for density estimation ,[6] and Neal’s 2000 review completed the computational picture, systematising Gibbs sampling for conjugate priors and adding auxiliary-parameter and Metropolis–Hastings methods for non-conjugate priors .[3] Stick-breaking has since become the representation through which the process is usually implemented.

See also

Line chart · Apriori algorithm · Asymptotic analysis · Average treatment effect · Base rate · Bayesian inference · Bayesian model · Bayesian probability

Glossary and index

References

  1. ^ a b c d e f g h i j k l m n o p a. (p. 209) b. (Theorem 1, pp. 217–218) c. (p. 209) d. (Proposition 3, pp. 215–216) e. (pp. 215–216) f. (Definition 1, p. 214) g. (pp. 213–214) h. (§2, p. 212) i. (Proposition 1, pp. 214–215) j. (pp. 209–210) k. (§4, pp. 218–220) l. (p. 210) m. (Theorem 1, pp. 217–218) n. (§5) o. (pp. 209–210) p. (§§3–5, pp. 213–230) Ferguson, T. S. (1973). A Bayesian Analysis of Some Nonparametric Problems. The Annals of Statistics, 1(2), 209–230. https://doi.org/10.1214/aos/1176342360
  2. ^ a b c d e f a. (p. 641) b. (p. 639) c. (§2, p. 642) d. (pp. 641–642) e. (p. 639) f. (pp. 639, 642) Sethuraman, J. (1994). A Constructive Definition of Dirichlet Priors. Statistica Sinica, 4(2), 639–650. https://www3.stat.sinica.edu.tw/statistica/oldpdf/A4n26.pdf
  3. ^ a b c d e f g h i j k l a. (p. 251) b. (p. 251) c. (§2, p. 250) d. (eq. (2.1), pp. 250–251) e. (pp. 251–252) f. (p. 252) g. (§3, p. 252) h. (Algorithm 1, p. 253) i. (Abstract, p. 249; Algorithm 8, p. 262) j. (§7) k. (§3, p. 252) l. (pp. 249–250) Neal, R. M. (2000). Markov Chain Sampling Methods for Dirichlet Process Mixture Models. Journal of Computational and Graphical Statistics, 9(2), 249–265. https://doi.org/10.1080/10618600.2000.10474879
  4. ^ a b c d e f g h i j a. (§4, pp. 1160–1161) b. (§4, pp. 1160–1161) c. (p. 1161) d. (Abstract, p. 1152; Theorem 3, pp. 1158–1159) e. (pp. 1159–1160, the corollary to Theorem 3) g. (§4, pp. 1160–1161) h. (§4, pp. 1160–1161) j. (pp. 1152, 1160–1161) Antoniak, C. E. (1974). Mixtures of Dirichlet Processes with Applications to Bayesian Nonparametric Problems. The Annals of Statistics, 2(6), 1152–1174. https://doi.org/10.1214/aos/1176342871
  5. ^ a b c a. (eq. (2), p. 353) b. (Theorem, p. 354) c. (pp. 353–354) Blackwell, D. & MacQueen, J. B. (1973). Ferguson Distributions via Pólya Urn Schemes. The Annals of Statistics, 1(2), 353–355. https://doi.org/10.1214/aos/1176342372
  6. ^ a b c d e f g h i j a. (p. 578) b. (§2, p. 578) c. (p. 578) d. (p. 578) e. (§3, pp. 579–580) f. (p. 578) g. (p. 578) h. (p. 578) j. (pp. 577–578) Escobar, M. D. & West, M. (1995). Bayesian Density Estimation and Inference Using Mixtures. Journal of the American Statistical Association, 90(430), 577–588. https://doi.org/10.1080/01621459.1995.10476550
Cite this page
Plain text
StatWiki (2026). "Dirichlet process." StatWiki. Last updated 2 December 2026. https://www.statwiki.io/articles/dirichlet-process.html
BibTeX
@misc{statwiki_dirichlet_process,
  author = {{StatWiki}},
  title = {{Dirichlet process}},
  year = {2026},
  url = {https://www.statwiki.io/articles/dirichlet-process.html},
  urldate = {2026-12-02},
  note = {StatWiki, last updated 2 December 2026}
}