Learn R Programming

dirmult (version 0.1.3-3)

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.

concept

  • Genetics
  • Overdispersion
  • Dirichlet-multinomial

See Also

dirmult

Examples

Run this code
rdirichlet(n=100, alpha=rep(1,10))

Run the code above in your browser using DataLab