Density and random generation for the Chinese Restaurant Process distribution.
dCRP(x, conc = 1, size, log = 0)rCRP(n, conc = 1, size)
dCRP
gives the density, and rCRP
gives random generation.
vector of values.
scalar concentration parameter.
integer-valued length of x
(required).
logical; if TRUE, probability density is returned on the log scale.
number of observations (only n = 1 is handled currently).
Claudia Wehrhahn
The Chinese restaurant process distribution is a distribution
on the space of partitions of the positive integers.
The distribution with concentration parameter \(\alpha\) equal to conc
has probability function
$$
f(x_i \mid x_1, \ldots, x_{i-1})=\frac{1}{i-1+\alpha}\sum_{j=1}^{i-1}\delta_{x_j}+
\frac{\alpha}{i-1+\alpha}\delta_{x^{new}},$$
where \(x^{new}\) is a new integer not in \(x_1, \ldots, x_{i-1}\).
If conc
is not specified, it assumes the default value of 1. The conc
parameter has to be larger than zero. Otherwise, NaN
are returned.
Blackwell, D., and MacQueen, J. B. (1973). Ferguson distributions via Pólya urn schemes. The Annals of Statistics, 1: 353-355.
Aldous, D. J. (1985). Exchangeability and related topics. In École d'Été de Probabilités de Saint-Flour XIII - 1983 (pp. 1-198). Springer, Berlin, Heidelberg.
Pitman, J. (1996). Some developments of the Blackwell-MacQueen urn scheme. IMS Lecture Notes-Monograph Series, 30: 245-267.
x <- rCRP(n=1, conc = 1, size=10)
dCRP(x, conc = 1, size=10)
Run the code above in your browser using DataLab