Learn R Programming

MSBVAR (version 0.5.0)

rdirichlet: Random draws from and density for Dirichlet distribution

Description

Generate draws from a random Dirichlet distribution or compute its density.

Usage

rdirichlet(n, alpha)
ddirichlet(x, alpha)

Arguments

Value

xAn $n \times h$ matrix of the draws

Details

Draws $n$ values for an $h \times h$ Dirichlet random variable or computes the density.

References

MCMCpack and gregmisc

Examples

Run this code
rdirichlet(2, matrix(rep(1, 4), 2, 2))

Run the code above in your browser using DataLab