Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

norm.contour

Contour plot of the normal distribution in S^2


Description

Contour plot of the normal distribution in S^2.

Usage

norm.contour(m, s, type = "alr", n = 100, x = NULL)

Arguments

m

The mean vector.

s

The covariance matrix.

type

This is either "alr" or "ilr", corresponding to the additive and the isometric log-ratio transformation respectively.

n

The number of grid points to consider over which the density is calculated.

x

This is either NULL (no data) or contains a 3 column matrix with compositional data.

Details

The alr or the ilr transformation is applied to the compositional data at first. Then for a grid of points within the 2-dimensional simplex the bivariate normal density is calculated and the contours are plotted along with the points.

Value

A ternary diagram with the points (if appear = TRUE) and the bivariate normal contour lines.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Giorgos Athineou <gioathineou@gmail.com>

References

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

See Also

Examples

x <- as.matrix(iris[, 1:3])
x <- x / rowSums(x)
y <- Compositional::alr(x)
m <- colMeans(y)
s <- cov(y)
norm.contour(m, s)

Compositional

Compositional Data Analysis

v4.6
GPL (>= 2)
Authors
Michail Tsagris [aut, cre], Giorgos Athineou [aut], Abdulaziz Alenazi [ctb]
Initial release
2021-04-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.