| dDir | R Documentation |
Calculate the densities of a given set of Dirichlet samples. For a random vector x, the density function is defined as: 1/Beta(alpha) prod_i=1:p x_i^alpha_i -1 Where Beta() is the beta function. p is the dimension of x.
dDir(x, alpha, LOG = FALSE)
x |
matrix or numeric vector, if matrix every row of x is an observation, if numeric vector, it's the same as a matrix with only one row. |
alpha |
numeric, Dirichlet parameter. |
LOG |
logical, return the log density if set to "TRUE". |
A numeric vector of density values.
rDir
x <- rDir(5,c(1,2,3)) #generate 5 samples with parameters c(1,2,3) dDir(x,c(1,2,3)) dDir(x,c(1,2,3),LOG=TRUE)