Skip to contents

Draw from a Dirichlet distribution given a vector of shape parameters. The number of observations is inferred from the length of the shape vector.

Usage

rdirichlet(shape = rep(1, 3))

Arguments

shape

Vector of shape parameters.

See also

rgamma() for additional details.

Other distributions: rbetabinom()

Examples

coiaf:::rdirichlet(c(1, 1, 1))
#> [1] 0.6761773 0.1351698 0.1886529
coiaf:::rdirichlet(c(1, 3, 2))
#> [1] 0.006314457 0.591661871 0.402023672