Description Usage Arguments Value Source
Generate n random vectors distributed according to a Dirichlet distribution. Each row of the returned matrix is a random vector that sums to 1.
1 | rdirichlet(n, alpha)
|
n |
The number of random vectors to generate |
alpha |
A vector of parameters |
The function returns a matrix with n rows and length(alpha)
columns
copied from package MCMCpack
to avoid a dependency. That code
was taken from Greg's Miscellaneous Functions (gregmisc). His code was based
on code posted by Ben Bolker to R-News on 15 Dec 2000.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.