Description Usage Arguments Value Author(s) Examples
Density function and random number generation for the Dirichlet distribution
1 | ddirichlet(x, alpha, log = FALSE, sum = FALSE)
|
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 |
sum |
if |
the ddirichlet
returns a vector of densities (if sum = FALSE
) or the (log-)likelihood (if sum = TRUE
) for the given data and alphas.
Daniel Marcelino, dmarcelino@live.com
1 2 3 4 5 | mat <- cbind(1:10, 5, 10:1);
mat;
x <- rdirichlet(10, mat);
ddirichlet(x, mat);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.