distcor: Compute the distance correlation

Description Usage Arguments Details Value Author(s) References Examples

View source: R/distcorr.R

Description

Computes the distance correlation between two random variables.

Usage

1
distcor(X, y)

Arguments

X

A numeric vector or matrix.

y

A numeric vector or matrix.

Details

Distance correlation measures the statistical dependence between two random variables or two random vectors. The important property is that the distance correlation is zero if and only if two random variables are independent. The details of computing the distance correlation can be seen in Szekely, Rizzo and Bakirov (2007) or https://en.wikipedia.org/wiki/Distance_correlation. This function is the same as dcor in energy package.

Value

A sample distance correlation.

Author(s)

Debin Qiu, Jeongyoun Ahn

References

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

Examples

1
2
3
4
5
6
7
X <- matrix(rnorm(200),ncol = 2)
y <- X%*%matrix(c(1.5,4),ncol = 1) + rnorm(100) # univariate y
distcor(X,y)

X <- iris[1:50, 1:4]
Y <- iris[51:100, 1:4]   # multiple response y
distcor(X,Y)

grpss documentation built on May 1, 2019, 7:49 p.m.

Related to distcor in grpss...