Description Usage Arguments Value Author(s) References Examples
Test to check the (conditional) dependence between two variables x and y given a set of variables S, using independence criteria. The kernelCItest() function, uses Distance Covariance or Hilbert-Schmidt Independence Criterion to test for the (conditional) independence between random variables, with an interface that can easily by used in skeleton
, pc
or kpc
.
1 2 3 |
x, y, S |
It is tested, whether x and y are conditionally independent given the subset S of the remaining nodes. x, y, S all are integers, corresponding to variable or node numbers. |
suffStat |
a list of parameters consisting of data, ic.method, p, index, sig, numCol, numCluster, eps, paral |
verbose |
a logical parameter, if TRUE, detailed output is provided. |
data |
numeric matrix witch collumns representing variables and rows representing samples |
ic.method |
Method for the (conditional) independence test: Distance Covariance (permutation or gamma test), HSIC (permutation or gamma test) or HSIC cluster |
p |
Number of permutations for Distance Covariance, HSIC permutation and HSIC cluster tests. Default is Distance Covariance |
index |
Number in (0,2] the power of the distance in the Distance Covariance |
sig |
Gaussian kernel width for HSIC tests. Default is 1 |
numCol |
Number of columns used in the incomplete Cholesky decomposition. Default is 50 |
numCluster |
Number of clusters for kPC clust algorithm |
eps |
Normalization parameter for kPC clust. Default is 0.1 |
paral |
Number of cores to use for parallel calculations. |
kernelCItest() returns the p-value of the test.
Petras Verbyla (petras.verbyla@mrc-bsu.cam.ac.uk) and Nina Ines Bertille Desgranges
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.
A. Gretton et al. (2005). Kernel Methods for Measuring Independence. JMLR 6 (2005) 2075-2129.
R. Tillman, A. Gretton and P. Spirtes (2009). Nonlinear directed acyclic structure learning with weakly additive noise model. NIPS 22, Vancouver.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | set.seed(10)
library(pcalg)
z <- 10*runif(300)
w <- 10*runif(300)
x <- sin(z) + runif(300)
y <- cos(z) + runif(300)
data <- cbind(x,y,z,w)
#conditionally independent
test1a <- kernelCItest(x=1,y=2,S=c(3),suffStat = list(data=data,ic.method="dcc.gamma"))
test2a <- kernelCItest(x=1,y=2,S=c(3),suffStat = list(data=data,ic.method="dcc.perm"))
test3a <- kernelCItest(x=1,y=2,S=c(3),suffStat = list(data=data,ic.method="hsic.gamma"))
test4a <- kernelCItest(x=1,y=2,S=c(3),suffStat = list(data=data,ic.method="hsic.perm"))
test5a <- kernelCItest(x=1,y=2,S=c(3),suffStat = list(data=data,ic.method="hsic.clust"))
test6a <- gaussCItest( x=1,y=2,S=c(3),suffStat = list(C=cor(data),n=4))
test1a
test2a
test3a
test4a
test5a
test6a
#dependent
test1b <- kernelCItest(x=1,y=2,S=c(4),suffStat = list(data=data,ic.method="dcc.gamma"))
test2b <- kernelCItest(x=1,y=2,S=c(4),suffStat = list(data=data,ic.method="dcc.perm"))
test3b <- kernelCItest(x=1,y=2,S=c(4),suffStat = list(data=data,ic.method="hsic.gamma"))
test4b <- kernelCItest(x=1,y=2,S=c(4),suffStat = list(data=data,ic.method="hsic.perm"))
test5b <- kernelCItest(x=1,y=2,S=c(4),suffStat = list(data=data,ic.method="hsic.clust"))
test6b <- gaussCItest( x=1,y=2,S=c(4),suffStat = list(C=cor(data),n=4))
test1b
test2b
test3b
test4b
test5b
test6b
|
[1] 0.6455592
[1] 0.5643564
[1] 0.4868527
[1] 0.4257426
[1] 0.4158416
[1] 1
[1] 0.03469079
[1] 0.04950495
[1] 0.000292712
[1] 0.00990099
[1] 0.00990099
[1] 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.