dcov: Distance variance and covariance

View source: R/distance_cov_cor.R

Distance variance and covarianceR Documentation

Distance variance and covariance

Description

Distance variance and covariances.

Usage

dvar(x)
dcov(x, y)

Arguments

x

A numerical matrix or a vector.

y

A numerical matrix or a vector.

Details

The distance variance of a matrix/vector or the distance covariance of two matrices is calculated. For the distance variance of a vector we use the fast method of Huo and Szekely (2016).

Value

The distance covariance or distance variance.

Author(s)

Manos Papadakis

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.

References

Szekely G.J., Rizzo M.L. and Bakirov N.K.(2007). Measuring and Testing Independence by Correlation of Distances. Annals of Statistics, 35(6):2769-2794.

Huo X. and Szekely G. J. (2016). Fast computing for distance covariance. Technometrics, 58(4): 435-447.

See Also

dcor, edist

Examples

x <- as.matrix(iris[1:50, 1:4])
y <- as.matrix(iris[51:100, 1:4])
res <- dcov(x, y)
res <- dvar(x[, 1])

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.