rdir | R Documentation |
S_{d}
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
rdir(n, alpha, normalize = TRUE)
n |
sample size |
alpha |
vector of parameter |
normalize |
boolean. If |
sample of dimension d
(size of alpha) from the Dirichlet distribution.
rdir(n=100, alpha=c(0.5,0.5,2),TRUE)
rdir(n=100, alpha=c(3,1,2),FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.