hsic.clust: HSIC cluster permutation conditional independence test

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/hsicclust.R

Description

Conditional independence test using HSIC and permutation with clusters.

Usage

1
2
hsic.clust(x, y, z, sig = 1, p = 100, numCluster = 10, numCol = 50,
  eps = 0.1, paral = 1)

Arguments

x

first variable

y

second variable

z

set of variables on which we condition

sig

the with of the Gaussian kernel

p

the number of permutations

numCluster

number of clusters for clustering z

numCol

maximum number of columns that we use for the incomplete Cholesky decomposition

eps

normalization parameter for HSIC cluster test

paral

number of cores used

Details

Let x and y be two samples of length n. Gram matrices K and L are defined as: K_{i,j} =exp((x_i-x_j)^2/sig^2), L_{i,j} =exp((y_i-y_j)^2/sig^2) and M_{i,j} =exp((z_i-z_j)^2/sig^2). H_{i,j} = delta_{i,j} - 1/n. Let A=HKH, B=HLH and C=HMH. HSIC(X,Y|Z) = Tr(AB-2AC(C+ε I)^{-2}CB+AC(C+ε I)^{-2}CBC(C+ε I)^{-2}C)/n^2. Permutation test clusters Z and then permutes Y in the clusters of Z p times to get Y_{(p)} and calculates HSIC(X,Y_{(p)}|Z). (HSIC(X,Y|Z)>HSIC(X,Y_{(p)}|Z))/p.

Value

hsic.clust() returns a list with class htest containing

method

description of test

statistic

observed value of the test statistic

estimate

HSIC(x,y)

estimates

a vector: [HSIC(x,y), mean of HSIC(x,y), variance of HSIC(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

Tillman, R. E., Gretton, A. and Spirtes, P. (2009). Nonlinear directed acyclic structure learning with weakly additive noise model. NIPS 22, Vancouver.

K. Fukumizu et al. (2007). Kernel Measures of Conditional Dependence. NIPS 20. https://papers.nips.cc/paper/3340-kernel-measures-of-conditional-dependence.pdf

See Also

hsic.gamma, hsic.perm, kernelCItest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(energy)
set.seed(10)
# x and y dependent, but independent conditionally on z
z <- 10*runif(300)
x <- sin(z) + runif(300)
y <- cos(z) + runif(300)
plot(x,y)
hsic.gamma(x,y)
hsic.perm(x,y)
dcov.test(x,y)
hsic.clust(x,y,z)

Example output

	HSIC test of independence

data:  Gamma approximation
HSIC = 0.0028224, p-value = 0.002088
sample estimates:
       HSIC 
0.002822439 


	HSIC test of independence

data:  Permutation approximation
HSIC = 0.0028224, p-value = 0.0198
sample estimates:
       HSIC 
0.002822439 


	Specify the number of replicates R (R > 0) to perform the test of
	independence

data:  index 1, replicates 0
nV^2 = 1.2146, p-value = NA
sample estimates:
      dCov 
0.06362966 


	HSIC test of conditional independence

data:  Cluster permutation approximation
HSIC = 4.2246e-05, p-value = 0.8218
sample estimates:
        HSIC 
4.224572e-05 

kpcalg documentation built on May 2, 2019, 12:39 p.m.