Density function and random number generation for the Dirichlet distribution
Usage
ddirichlet(x, alpha, log = FALSE, sum = FALSE)
Arguments
x
a matrix containing observations.
alpha
the Dirichlet distribution's parameters. Can be a vector (one set of parameters for all observations) or a matrix (a different set of parameters for each observation), see Details.
log
if TRUE, logarithmic densities are returned.
sum
if TRUE, the (log-)likelihood is returned.
Value
the ddirichlet returns a vector of densities (if sum = FALSE) or the (log-)likelihood (if sum = TRUE) for the given data and alphas.