mvar: Metric summary statistics of real, amount or compositional...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/compositions.R

Description

Compute the metric variance, covariance, correlation or standard deviation.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
mvar(x,...)
mcov(x,...)
mcor(x,...)
msd(x,...)
## Default S3 method:
mvar(x,y=NULL,...)
## Default S3 method:
mcov(x,y=x,...)
## Default S3 method:
mcor(x,y,...)
## Default S3 method:
msd(x,y=NULL,...)

Arguments

x

a dataset, eventually of amounts or compositions

y

a second dataset, eventually of amounts or compositions

...

further arguments to stats::var or stats::cov. Typically a robust=TRUE argument. e.g. use

Details

The metric variance (mvar) is defined by the trace of the variance in the natural geometry of the data, or also by the generalized variance in natural geometry. The natural geometry is equivalently given by the cdt or idt transforms.

The metric standard deviation (msd) is not the square root of the metric variance, but the square root of the mean of the eigenvalues of the variance matrix. In this way it can be interpreted in units of the original natural geometry, as the radius of a sperical ball around the mean with the same volume as the 1-sigma ellipsoid of the data set.

The metric covariance (mvar) is the sum over the absolute singular values of the covariance of two datasets in their respective geometries. It is always positive. The metric covariance of a dataset with itself is its metric variance. The interpretation of a metric covariance is quite difficult, but useful in regression problems.

The metric correlation (mcor) is the metric covariance of the datasets in their natural geometry normalized to unit variance matrix. It is a number between 0 and the smaller dimension of both natural spaces. A number of 1 means perfect correlation in 1 dimension, but only partial correlations in higher dimensions.

Value

a scalar number, informing of the degree of variation/covariation of one/two datasets.

Author(s)

K.Gerald v.d. Boogaart http://www.stat.boogaart.de, Raimon Tolosana-Delgado

References

Daunis-i-Estadella, J., J.J. Egozcue, and V. Pawlowsky-Glahn (2002) Least squares regression in the Simplex on the simplex, Terra Nostra, Schriften der Alfred Wegener-Stiftung, 03/2003

Pawlowsky-Glahn, V. and J.J. Egozcue (2001) Geometric approach to statistical analysis on the simplex. SERRA 15(5), 384-398

See Also

var, cov, mean.acomp, acomp, rcomp, aplus, rplus

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Example output

Loading required package: tensorA

Attaching package: 'tensorA'

The following object is masked from 'package:base':

    norm

Loading required package: robustbase
Loading required package: energy
Loading required package: bayesm
Welcome to compositions, a package for compositional data analysis.
Find an intro with "? compositions"


Attaching package: 'compositions'

The following objects are masked from 'package:stats':

    cor, cov, dist, var

The following objects are masked from 'package:base':

    %*%, scale, scale.default

[1] 2.084473
[1] 0.1340421
[1] 3.236377
[1] 3186.038
[1] 1.0209
[1] 0.2588842
[1] 1.038649
[1] 32.58854
[1] 0.02477656
[1] 0.09830424
[1] 0.001887371
[1] 0.05397564
[1] 0.5439218
[1] 0.2974957
[1] 5.441885
[1] 0.193851
[1] 0.2136284
[1] 0.1539326

compositions documentation built on Jan. 5, 2022, 5:09 p.m.