rdirichlet {MSBVAR} | R Documentation |
Generate draws from a random Dirichlet distribution or compute its density.
rdirichlet(n, alpha) ddirichlet(x, alpha)
n |
Number of draws |
alpha |
Scale matrix, h x h |
x |
value to compute density |
Draws n values for an h x h Dirichlet random variable or computes the density.
x |
An n x h matrix of the draws |
Based on code from Kevin Quinn in the MCMCpack package and the gregmisc package.
MCMCpack and gregmisc
rdirichlet(2, matrix(rep(1, 4), 2, 2))