Functions to compute the density of or generate random deviates from the Dirichlet distribution.
A vector containing a single random deviate or matrix containg one random deviate per row.
Number of random vectors to generate.
Vector or (for
The Dirichlet distribution is the multidimensional generalization of the beta distribution. It is the canonical Bayesian distribution for the parameter estimates of a multinomial distribution.
ddirichlet returns a vector containing the Dirichlet density for the
corresponding rows of
rdirichlet returns a matrix with
n rows, each containing
a single Dirichlet random deviate.
Code original posted by Ben Bolker to R-News on Fri Dec 15 2000. See https://stat.ethz.ch/pipermail/r-help/2000-December/009561.html. Ben attributed the code to Ian Wilson firstname.lastname@example.org. Subsequent modifications by Gregory R. Warnes email@example.com.
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.