covariance | R Documentation |
Computes the (centered) log-ratio covariance matrix (see below).
covariance(x, ...)
## S4 method for signature 'CompositionMatrix'
covariance(x, center = TRUE, method = "pearson")
## S4 method for signature 'ALR'
covariance(x, method = "pearson")
## S4 method for signature 'CLR'
covariance(x, method = "pearson")
x |
A |
... |
Currently not used. |
center |
A |
method |
A |
A matrix
.
covariance(ALR)
: Computes the log-ratio covariance matrix
(Aitchison 1986, definition 4.5).
covariance(CLR)
: Computes the centered log-ratio covariance matrix
(Aitchison 1986, definition 4.6).
N. Frerebeau
Aitchison, J. (1986). The Statistical Analysis of Compositional Data. London: Chapman and Hall, p. 64-91.
Greenacre, M. J. (2019). Compositional Data Analysis in Practice. Boca Raton: CRC Press.
Other statistics:
aggregate()
,
condense()
,
dist
,
mahalanobis()
,
margin()
,
mean()
,
pip()
,
quantile()
,
scale()
,
variance()
,
variance_total()
,
variation()
## Data from Aitchison 1986
data("hongite")
## Coerce to compositional data
coda <- as_composition(hongite)
## Log-ratio covariance matrix
## (Aitchison 1986, definition 4.5)
covariance(coda, center = FALSE)
## Centered log-ratio covariance matrix
## (Aitchison 1986, definition 4.6)
covariance(coda, center = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.