View source: R/distance_cov_cor.R
Distance variance, covariance and correlation | R Documentation |
Distance variance, covariance and correlation.
dvar(x, bc = FALSE)
dcov(x, y, bc = FALSE)
dcor(x, y, bc = FALSE)
bcdcor(x, y)
x |
A numerical matrix or a vector. |
y |
A numerical matrix or a vector. |
bc |
If you want the bias-corrected distance correlation set this equal to TRUE. |
The distance variance of a matrix/vector, the distance covariance or distance correlation of two matrices is calculated. For the distance variance of a vector we use the fast method of Huo and Szekely (2016).
The distance covariance or the distance variance.
For the bias corrected distance correlation its value only.
For the distance correlation a list including:
dcov |
The distance covariance. |
dvarX |
The distance variance of x. |
dvarY |
The distance variance of Y. |
dcor |
The distance correlation. |
Michail Tsagris and Manos Papadakis.
R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.
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.
Szekely G. J. and Rizzo M. L. (2023). The Energy of Data and Distance Correlation. Chapman and Hall/CRC.
Tsagris M. and Papadakis M. (2025). Fast and light-weight energy statistics using the R package Rfast. https://arxiv.org/abs/2501.02849
pdcor, dcor.ttest, edist
x <- as.matrix(iris[1:50, 1:4])
y <- as.matrix(iris[51:100, 1:4])
res <- dvar(x[, 1])
#dcor(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.