rdirichlet: Dirichlet distributed random numbers

Description Usage Arguments Value Source

View source: R/sim_funcs.R

Description

Generate n random vectors distributed according to a Dirichlet distribution. Each row of the returned matrix is a random vector that sums to 1.

Usage

1
rdirichlet(n, alpha)

Arguments

n

The number of random vectors to generate

alpha

A vector of parameters

Value

The function returns a matrix with n rows and length(alpha) columns

Source

copied from package MCMCpack to avoid a dependency. That code was taken from Greg's Miscellaneous Functions (gregmisc). His code was based on code posted by Ben Bolker to R-News on 15 Dec 2000.


atyre2/raretrans documentation built on Sept. 28, 2020, 8:55 p.m.