In probability theory, the Chinese restaurant process is a discrete-time stochastic process, analogous to seating customers at tables in a restaurant. Imagine a restaurant with an infinite number of circular tables, each with infinite capacity. Customer 1 sits at the first table. The next customer either sits at the same table as customer 1, or the next table. This continues, with each customer choosing to either sit at an occupied table with a probability proportional to the number of customers already there (i.e., they are more likely to sit at a table with many customers than few), or an unoccupied table. At time n, the n customers have been partitioned among m ≤ n tables (or blocks of the partition). The results of this process are exchangeable, meaning the order in which the customers sit does not affect the probability of the final distribution. This property greatly simplifies a number of problems in population genetics, linguistic analysis, and image recognition. The restaurant analogy first appeared in a 1985 write-up by David Aldous, where it was attributed to Jim Pitman (who additionally credits Lester Dubins). An equivalent partition process was published a year earlier by Fred Hoppe, using an "urn scheme" akin to Pólya's urn. In comparison with Hoppe's urn model, the Chinese restaurant process has the advantage that it naturally lends itself to describing random permutations via their cycle structure, in addition to describing random partitions.
Formal definition For any positive integer n, let 𝒫n denote the set of all partitions of the set {1,2,3,...,n}≜[n]. The Chinese restaurant process takes values in the infinite product ∏n≥1𝒫n. The value of the process at time n is a partition Bn of the set [n], whose probability distribution is determined as follows. At time n=1, the trivial partition B1={{1}} is obtained (with probability one). At time n+1 the element "n+1" is either:
added to one of the blocks of the partition Bn, where each block is chosen with probability |b|/(n+1) where |b| is the size of the block (i.e. number of elements), or added to the partition Bn as a new singleton block, with probability 1/(n+1). The random partition so generated has some special properties. It is exchangeable in the sense that relabeling {1,...,n} does not change the distribution of the partition, and it is consistent in the sense that the law of the partition of [n−1] obtained by removing the element n from the random partition Bn is the same as the law of the random partition Bn−1. The probability assigned to any particular partition (ignoring the order in which customers sit around any particular table) is
Pr(Bn=B)=∏b∈B(|b|−1)!n!,B∈𝒫n where b is a block in the partition B and |b| is the size of b. The definition can be generalized by introducing a parameter θ>0 which modifies the probability of the new customer sitting at a new table to θn+θ and correspondingly modifies the probability of them sitting at a table of size |b| to |b|n+θ. The vanilla process introduced above can be recovered by setting θ=1. Intuitively, θ can be interpreted as the effective number of customers sitting at the first empty table.
Alternative definition An equivalent, but subtly different way to define the Chinese restaurant process, is to let new customers choose companions rather than tables. Customer n+1 chooses to sit at the same table as any one of the n seated customers with probability 1n+θ, or chooses to sit at a new, unoccupied table with probability θn+θ. Notice that in this formulation, the customer chooses a table without having to count table occupancies---we don't need |b|.
Distribution of the number of tables
The Chinese restaurant table distribution (CRT) is the probability distribution on the number of tables in the Chinese restaurant process. It can be understood as the sum of n independent Bernoulli random variables, each with a different parameter:
K=∑i=1nbibi∼Bernoulli(θi−1+θ) The probability mass function of K is given by
f(k)=Γ(θ)Γ(n+θ)|s(n,k)|θk,k=1,…,n, where s denotes Stirling numbers of the first kind.
Two-parameter generalization This construction can be generalized to a model with two parameters, θ & α, commonly called the strength (or concentration) and discount parameters respectively. At time n+1, the next customer to arrive finds |B| occupied tables and decides to sit at an empty table with probability
θ+|B|αn+θ, or at an occupied table b of size |b| with probability
|b|−αn+θ. In order for the construction to define a valid probability measure it is necessary to suppose that either α<0 and θ=−Lα for some L∈{1,2,,...}; or that 0≤α<1 and θ>−α. Under this model the probability assigned to any particular partition B of [n], can be expressed in the general case (for any values of θ,α that satisfy the above-mentioned constraints) in terms of the Pochhammer k-symbol, as
Pr(Bn=B∣θ,α)=(θ+α)|B|−1,α(θ+1)n−1,1∏b∈B(1−α)|b|−1,1 where, the Pochhammer k-symbol is defined as follows: by convention, (a)0,k=1, and for m>0
(a)m,k=∏i=0m−1(a+ik)={amif k=0,km(ak)m‾if k>0,|k|m(a|k|)m_if k<0 where xm‾=∏i=0m−1(x+i) is the rising factorial and xm_=∏i=0m−1(x−i) is the falling factorial. It is worth noting that for the parameter setting where α<0 and θ=−Lα, then (θ+α)|B|−1,α=(|α|(L−1))|B|−1,α, which evaluates to zero whenever |B|>L, so that L is an upper bound on the number of blocks in the partition; see the subsection on the Dirichlet-categorical model below for more details. For the case when θ>0 and 0<α<1, the partition probability can be rewritten in terms of the Gamma function as
Pr(Bn=B∣θ,α)=Γ(θ)Γ(θ+n)α|B|Γ(θ/α+|B|)Γ(θ/α)∏b∈BΓ(|b|−α)Γ(1−α). In the one-parameter case, where α is zero, and θ>0 this simplifies to
Pr(Bn=B∣θ)=Γ(θ)θ|B|Γ(θ+n)∏b∈BΓ(|b|). Or, when θ is zero, and 0<α<1
Pr(Bn=B∣α)=α|B|−1Γ(|B|)Γ(n)∏b∈BΓ(|b|−α)Γ(1−α). As before, the probability assigned to any particular partition depends only on the block sizes, so as before the random partition is exchangeable in the sense described above. The consistency property still holds, as before, by construction. If α=0, the probability distribution of the random partition of the integer n thus generated is the Ewens distribution with parameter θ, used in population genetics and the unified neutral theory of biodiversity.
Derivation Here is one way to derive this partition probability. Let Ci be the random block into which the number i is added, for i=1,2,3,.... Then
… excerpt ends here. Continue reading the full article.