getDirichletDensity: The Dirichlet-Multinomial Distribution

Description Usage Arguments Value Author(s) Examples

Description

Density function and random number generation for the Dirichlet distribution

Usage

1

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 getDirichletSamples 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;
draws <- getDirichletSamples(10, mat);

getDirichletDensity(draws, mat);

danielmarcelino/SciencesPo documentation built on Oct. 20, 2019, 1:15 a.m.