
Compositional summaries, biplot and Dirichlet models
Source:R/CompositionalCircular.R
AitchisonClrCovariance.RdAitchisonClrCovariance: clr covariance, total variance, variation
matrix and centre (Aitchison 1986). CompositionalMad: MAD of each
clr coordinate. CompositionalPielou: Pielou (1966) evenness of a
composition. CompositionalQuantileDist: Aitchison distance between
the part-wise upper and lower quartiles. AitchisonBiplot: SVD of
the centred clr matrix (Aitchison and Greenacre 2002).
DirichletFitMom: method of moments (Minka 2000).
DirichletSample: gamma draws by inversion of Philox uniforms (part
i on stream i - 1). Identical to the Python arm morie.fn.compdir.
Usage
AitchisonClrCovariance(X)
CompositionalMad(X)
CompositionalPielou(x)
CompositionalQuantileDist(X)
AitchisonBiplot(X)
DirichletFitMom(X)
DirichletSample(alpha, n, seed = 1L)References
Aitchison, J. (1986). The Statistical Analysis of Compositional Data. Chapman and Hall.
Aitchison, J. and Greenacre, M. (2002). Biplots of compositional data. Journal of the Royal Statistical Society C 51, 375-392.
Minka, T. P. (2000). Estimating a Dirichlet distribution. Technical report, MIT.
Examples
AitchisonClrCovariance(rbind(c(1, 2, 4), c(2, 2, 2), c(4, 2, 1)))$total_variance
#> [1] 0.960906
CompositionalPielou(c(1, 1, 2))
#> [1] 0.9463946
DirichletFitMom(rbind(c(1, 2, 7), c(2, 2, 6), c(3, 1, 6)))$alpha
#> [1] 3.0 2.5 9.5
DirichletSample(c(2, 3), 1, seed = 4)
#> [,1] [,2]
#> [1,] 0.0586551 0.9413449