rvdirichlet | R Documentation |
Generates random variables from a Dirichlet sampling model.
rvdirichlet(n = 1, alpha)
n |
integer: number of vectors to generate |
alpha |
the parameter vector; may be random |
The Dirichlet distribution is a generalization of the Beta distribution.
(If alpha is of length two, rvdirichlet
draws from the Beta model.)
A random vector (rv object) of length n
.
Jouni Kerman jouni@kerman.com
Kerman, J. and Gelman, A. (2007). Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Statistics and Computing 17:3, 235-244.
See also vignette("rv")
.
## Not run: a <- rvdirichlet(1, alpha=c(6, 3, 1)) # sum(a) # one with probability 1 ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.