Learn R Programming

Compositional (version 5.5)

Dirichlet random values simulation: Dirichlet random values simulation

Description

Dirichlet random values simulation.

Usage

rdiri(n, a)

Arguments

n

The sample size, a numerical value.

a

A numerical vector with the parameter values.

Value

A matrix with the simulated data.

Details

The algorithm is straightforward, for each vector, independent gamma values are generated and then divided by their total sum.

References

Ng Kai Wang, Guo-Liang Tian and Man-Lai Tang (2011). Dirichlet and related distributions: Theory, methods and applications. John Wiley & Sons.

Aitchison J. (1986). The statistical analysis of compositional data. Chapman & Hall.

See Also

diri.est, diri.nr, diri.contour

Examples

Run this code
# NOT RUN {
x <- rdiri( 100, c(5, 7, 1, 3, 10, 2, 4) )
diri.est(x)
# }

Run the code above in your browser using DataLab