dcov.gamma {kpcalg}R Documentation

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

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 0<s<2. H_{i,j} = \delta_{i,j} - \frac{1}{n}. Let A=HKH and B=HLH, then nV^2=\frac{1}{n^2}\sum A_{i,j} B_{i,j}. For more detail: dcov.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.

Value

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

method

description of test

statistic

observed value of the test statistic

estimate

nV^2(x,y)

estimates

a vector: [nV^2(x,y), mean of nV^2(x,y), variance of nV^2(x,y)]

replicates

replicates of the test statistic

p.value

approximate p-value of the test

data.name

desciption of data

Author(s)

Petras Verbyla (petras.verbyla@mrc-bsu.cam.ac.uk) and Nina Ines Bertille Desgranges

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

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)

[Package kpcalg version 1.0.1 Index]