nimble (version 1.1.0)

ChineseRestaurantProcess: The Chinese Restaurant Process Distribution

Description

Density and random generation for the Chinese Restaurant Process distribution.

Usage

dCRP(x, conc = 1, size, log = 0)

rCRP(n, conc = 1, size)

Value

dCRP gives the density, and rCRP gives random generation.

Arguments

x

vector of values.

conc

scalar concentration parameter.

size

integer-valued length of x (required).

log

logical; if TRUE, probability density is returned on the log scale.

n

number of observations (only n = 1 is handled currently).

Author

Claudia Wehrhahn

Details

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.

References

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.

Examples

Run this code
x <- rCRP(n=1, conc = 1, size=10)
dCRP(x, conc = 1, size=10)

Run the code above in your browser using DataLab