R: Random variate generation for Dirichlet distribution on Sd
rdir
R Documentation
Random variate generation for Dirichlet distribution on Sd
Description
A function to sample Dirichlet random variables, based on the representation as ratios of Gamma.
Note that the RNG will generate on the full simplex and the sum to one constraint is respected
here
Usage
rdir(n, alpha, normalize = TRUE)
Arguments
n
sample size
alpha
vector of parameter
normalize
boolean. If FALSE, the function returns Gamma variates with parameter alpha.
Value
sample of dimension d (size of alpha) from the Dirichlet distribution.