Learn R Programming

compositions (version 2.0-8)

rDirichlet: Dirichlet distribution

Description

The Dirichlet distribution on the simplex.

Usage

dDirichlet(x, alpha, log=FALSE, measure="Lebesgue")
rDirichlet.acomp(n, alpha)
rDirichlet.rcomp(n, alpha)

Value

For rDirichlet.* a generated random dataset of class "acomp" or "rcomp", drawn from a Dirichlet distribution with the given parameter

alpha. The names of alpha are used to name the parts.

For dDirichlet, the (conventional) Dirichlet density

Arguments

n

number of datasets to be simulated

alpha

parameters of the Dirichlet distribution

x

a data set (acomp, rcomp, data.frame, matrix; even one-row) of point(s) on the simplex

log

a boolean, controlling if the density or the log-density is returned

measure

one of: "Lebesgue" or "Aitchison" (partial match applies), or else a function returning the reference LOG-density (see details below)

Author

K.Gerald v.d. Boogaart http://www.stat.boogaart.de, Raimon Tolosana-Delgado

Details

The Dirichlet distribution is the result of closing a vector of equally-scaled Gamma-distributed variables. It the conjugate prior distribution for a vector of probabilities of a multinomial distribution. Thus, it generalizes the beta distribution for more than two parts.

For the density, the implementation allows to obtain the conventional density (with respect to the Lebesgue measure, default behaviour or giving measure="Lebuesgue"), the compositional density (with respect to the Aitchison measure, giving measure="Aitchison"), or else w.r.to any other reference density (giving at measure a function returning the log-density of the reference measure for any point of the simplex)

References

Aitchison, J. (1986) The Statistical Analysis of Compositional Data Monographs on Statistics and Applied Probability. Chapman & Hall Ltd., London (UK). 416p.

Mateu-Figueras, G.; Pawlowsky-Glahn, V. (2005). The Dirichlet distribution with respect to the Aitchison measure on the simplex, a first approach. In: Mateu-Figueras, G. and Barcel\'o-Vidal, C. (Eds.) Proceedings of the 2nd International Workshop on Compositional Data Analysis, Universitat de Girona, ISBN 84-8458-222-1, https://ima.udg.edu/Activitats/CoDaWork05/

See Also

rnorm.acomp

Examples

Run this code
tmp <- rDirichlet.acomp(10,alpha=c(A=2,B=0.2,C=0.2))
plot(tmp)
dDirichlet(tmp, alpha=c(A=2,B=0.2,C=0.2))
dDirichlet(tmp[1,]*0, alpha=c(A=2,B=0.2,C=0.2))

Run the code above in your browser using DataLab