Learn R Programming

abms (version 0.2)

rCRT: Title

Description

Sampling from the Chines Restaurant distribution.

Usage

rCRT(n, b, c)

Value

This function generates n random variables from the \(CRT\)(\(b,c\)) distribution

Arguments

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

References

Pitman, Jim (1995). "Exchangeable and Partially Exchangeable Random Partitions". Probability Theory and Related Fields. 102 (2): 145:158

Examples

Run this code
#Generating 4 random variables with parameters b=2 and c=1
rCRT(4,2,1)

Run the code above in your browser using DataLab