rCRT | R Documentation |
Sampling from the Chines Restaurant distribution.
rCRT(n, b, c)
n |
Number of observations. It must be a positive integer. |
b |
Parameter distribution, a non-negative integer. The number of Bernoulli independent variables that are added. It can be a vector |
c |
Parameter distribution, a positive real number. Used calculate the success probability the j-th Bernoulli independent variable, that is, c/(c +j -1). It can be a vector |
This function generates n
random variables from the CRT
(b,c
) distribution
Pitman, Jim (1995). "Exchangeable and Partially Exchangeable Random Partitions". Probability Theory and Related Fields. 102 (2): 145:158
#Generating 4 random variables with parameters b=2 and c=1
rCRT(4,2,1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.