Description Usage Arguments Details Author(s) See Also Examples
Density and random generation for the Dirichlet distribution with mean equal to mean and standard deviation equal to sd.
1 2 3 4 5 | rdirichlet(n, alpha)
rdirichlet1(alpha)
ddirichlet(x, alpha)
|
n |
Number of random vectors to generate. |
alpha |
Vector or (for ddirichlet) matrix containing shape parameters. |
x |
A vector containing a single random deviate or matrix containg one random deviate per row. |
The Dirichlet is the multidimensional of the bet distribution and the
canonical Bayesian Distribution for the parameters of a multinomial
distribution. rdirichlet1(alpha)
is a shortcut for
rdirichlet(1, alpha)
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 i.wilson@maths.abdn.ac.uk. Subsequent modifications by Gregory R. Warnes greg@warnes.net.
1 2 3 4 | set.seed(42)
rdirichlet(5, c(1,1,1) )
set.seed(42)
rdirichlet1(c(1,1,1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.