rdirichlet: Dirichlet deviates

View source: R/mixstock.R

rdirichletR Documentation

Dirichlet deviates

Description

Produces random deviates for the Dirichlet distribution, the multivariate analogue of the beta distribution.

Usage

rdirichlet(n, alpha)

Arguments

n

Number of random deviates to generate.

alpha

Vector of shape parameters.

Details

The Dirichlet distribution is a multivariate distribution that describes distributions of frequencies. If a multinomial sample n_1, \ldots n_N is taken from a population, the estimated distribution of frequencies is Dirichlet(n_1+1, \ldots n_2+N). If \{g_i\} is a set of Gamma deviates with shape parameters \{\alpha_i\}, then \{g_i\}/sum(\{g_i\}) is a Dirichlet deviate.

Value

A matrix of random deviates (each in a distinct row) from rdirichlet

Author(s)

Ben Bolker

Examples

  rdirichlet(5,c(7,4,4))
 

bbolker/mixstock documentation built on July 23, 2024, 12:18 p.m.