# rcompnorm: Multivariate normal random values simulation on the simplex In Compositional: Compositional Data Analysis

## Description

Multivariate normal random values simulation on the simplex.

## Usage

 `1` ```rcompnorm(n, m, s, type = "alr") ```

## Arguments

 `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.

## Details

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.

## Value

A matrix with the simulated data.

## Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <[email protected]> and Giorgos Athineou <[email protected]>

## References

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

```comp.den, rdiri, rcompt, rcompsn ```

## Examples

 ```1 2 3 4 5 6``` ```x <- as.matrix(iris[, 1:2]) m <- colMeans(x) s <- var(x) y <- rcompnorm(100, m, s) comp.den(y) ternary(y) ```

### Example output

```\$mean
[1] 5.775859 3.071136

\$comp.mean
[1] 0.002898655 0.934587835 0.062513509

\$covariance
[,1]        [,2]
[1,]  0.68789051 -0.04238067
[2,] -0.04238067  0.18373464

Sepal.Length Sepal.Width
closed geometric 0.002898655    0.9345878  0.06251351
arithmetic mean  0.003640215    0.9082636  0.08809619
```

Compositional documentation built on June 4, 2018, 5:04 p.m.