Density of the Dirichlet distribution.
Usage
ddirichlet(x, alpha, log = TRUE)
Arguments
- x
vector or matrix of quantiles
- alpha
vector or matrix of shape parameters
- log
logical; if TRUE
, densities \(p\) are returned as \(\log(p)\).
Value
ddirichlet
gives the density.
Details
This implementation of ddirichlet
allows for automatic differentiation with RTMB
.
Examples
ddirichlet(c(0.2, 0.3, 0.5), c(1, 2, 3))
#> [1] 1.504077