ChineseRestaurantProcess | R Documentation |
Density and random generation for the Chinese Restaurant Process distribution.
dCRP(x, conc = 1, size, log = 0)
rCRP(n, conc = 1, size)
x |
vector of values. |
conc |
scalar concentration parameter. |
size |
integer-valued length of |
log |
logical; if TRUE, probability density is returned on the log scale. |
n |
number of observations (only n = 1 is handled currently). |
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.
dCRP
gives the density, and rCRP
gives random generation.
Claudia Wehrhahn
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.