Learn R Programming

kpcalg (version 1.0.1)

dcov.gamma: Test to check the independence between two variables x and y using the Distance Covariance. The dcov.gamma() function, uses Distance Covariance independence criterion with gamma approximation to test for independence between two random variables.

Description

Test to check the independence between two variables x and y using the Distance Covariance. The dcov.gamma() function, uses Distance Covariance independence criterion with gamma approximation to test for independence between two random variables.

Usage

dcov.gamma(x, y, index = 1, numCol = 100)

Arguments

x
data of first sample
y
data of second sample
index
exponent on Euclidean distance, in (0,2]
numCol
Number of columns used in incomplete Singular Value Decomposition

Value

dcov.gamma() returns a list with class htest containing dcov.gamma() returns a list with class htest containing

Details

Let x and y be two samples of length n. Gram matrices K and L are defined as: $K_{i,j} =|x_i-x_j|^s$ and $L_{i,j} =|y_i-y_j|^s$, where 0dcov.test in package energy. Gamma test compares $nV^2_n(x,y)$ with the $alpha$ quantile of the gamma distribution with mean and variance same as $nV^2_n$ under independence hypothesis.

References

A. Gretton et al. (2005). Kernel Methods for Measuring Independence. JMLR 6 (2005) 2075-2129.

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

See Also

hsic.perm, hsic.clust, hsic.gamma, dcov.test, kernelCItest

Examples

Run this code
library(energy)
set.seed(10)
#independence
x <- runif(300)
y <- runif(300)

hsic.gamma(x,y)
hsic.perm(x,y)
dcov.gamma(x,y)
dcov.test(x,y)

#uncorelated but not dependent
z <- 10*(runif(300)-0.5)
w <- z^2 + 10*runif(300)

cor(z,w)
hsic.gamma(z,w)
hsic.perm(z,w)
dcov.gamma(z,w)
dcov.test(z,w)

Run the code above in your browser using DataLab