rdirichlet {MSBVAR}R Documentation

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

n Number of draws
alpha Scale matrix, h x h
x value to compute density

Details

Draws n values for an h x h Dirichlet random variable or computes the density.

Value

x An n x h matrix of the draws

Note

Based on code from Kevin Quinn in the MCMCpack package and the gregmisc package.

References

MCMCpack and gregmisc

Examples

rdirichlet(2, matrix(rep(1, 4), 2, 2))

[Package MSBVAR version 0.4.0 Index]