powered by
This function computes the density of a Dirichlet distribution.
ddirichlet(x, concentration, log = FALSE)
A numeric, the density value.
numeric
A numeric, a weight vector of length p. Each vector element must be between 0 and 1. The sum of the vector elements must be 1.
p
0
1
A numeric, the concentration vector of length p.
A logical, if TRUE the logarithm of the density value is returned. By default, log = FALSE.
logical
TRUE
log = FALSE
x <- c(0.5, 0.3, 0.2) concentration <- 1:3 ddirichlet(x = x, concentration = concentration) ddirichlet(x = x, concentration = concentration, log = TRUE)
Run the code above in your browser using DataLab