ddirichlet: Dirichlet Distribution

Description Usage Arguments Value Author(s) Examples

Description

Density function and random number generation for the Dirichlet distribution

Usage

1
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.

Author(s)

Daniel Marcelino, dmarcelino@live.com

Examples

1
2
3
4
5
mat <- cbind(1:10, 5, 10:1);
mat;
x <- rdirichlet(10, mat);

ddirichlet(x, mat);

SciencesPo documentation built on May 29, 2017, 9:28 p.m.