powered by
Density function and random generation from the Dirichlet distribution.
ddirichlet(x, alpha)rdirichlet(n, alpha)
rdirichlet(n, alpha)
A vector containing a single deviate or matrix containing one random deviate per row.
Vector of shape parameters, or matrix of shape parameters corresponding to the number of draw.
Number of random vectors to generate.
ddirichlet gives the density. rdirichlet returns a matrix with n rows, each containing a single Dirichlet random deviate.
ddirichlet
rdirichlet
n
The Dirichlet distribution is the multidimensional generalization of the beta distribution.
Beta
# NOT RUN { density <- ddirichlet(c(.1,.2,.7), c(1,1,1)) draws <- rdirichlet(20, c(1,1,1) ) # }
Run the code above in your browser using DataLab