Multivariate normal random values simulation on the simplex
Multivariate normal random values simulation on the simplex.
rcompnorm(n, m, s, type = "alr")
n |
The sample size, a numerical value. |
m |
The mean vector in R^d. |
s |
The covariance matrix in R^d. |
type |
The alr (type = "alr") or the ilr (type = "ilr") is to be used for closing the Euclidean data onto the simplex. |
The algorithm is straightforward, generate random values from a multivariate normal distribution in R^d and brings the values to the simplex S^d using the inverse of a log-ratio transformation.
A matrix with the simulated data.
Michail Tsagris
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Giorgos Athineou <gioathineou@gmail.com>
Aitchison J. (1986). The statistical analysis of compositional data. Chapman \& Hall.
x <- as.matrix(iris[, 1:2]) m <- colMeans(x) s <- var(x) y <- rcompnorm(100, m, s) comp.den(y) ternary(y)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.