Rev Language Reference


dnDirichlet - Dirichlet Distribution

Dirichlet probability distribution on a simplex.

Usage

dnDirichlet(RealPos[] alpha)

Arguments

alpha : RealPos[] (pass by const reference)
The concentration parameter.

Domain Type

Details

The Dirichlet probability distribution is the generalization of the Beta distribution. A random variable from a Dirichlet distribution is a simplex, i.e., a vector of probabilities that sum to 1.

Example

# lets get a draw from a Dirichlet distribution
a <- [1,1,1,1]   # we could also use rep(1,4)
b ~ dnDirichlet(a)
b
# let check if b really sums to 1
sum(b)

See Also