Learn R Programming

dirmult (version 0.1.3-5)

rdirichlet: Simulate from Dirichlet distribution

Description

Simulates from a Dirichlet distribution

Usage

rdirichlet(n=1, alpha)

Arguments

n

The number of samples.

alpha

The shape parameters, need to be positive.

Value

Return an n x length(alpha) matrix where each row is drawn from a Dirichlet.

See Also

dirmult

Examples

Run this code
# NOT RUN {
  rdirichlet(n=100, alpha=rep(1,10))
# }

Run the code above in your browser using DataLab