dhsic.test(X, Y, alpha = 0.05, method = "gamma", kernel = "gaussian", B = 100, pairwise = FALSE)
X
is a single numeric matrix than
one has to specify the second variable as Y
.
X
is also a numeric
matrix and omitted if X
is a list.
match.fun
. If the length of kernel
is
smaller than the number of variables the kernel specified in
kernel[1]
will be used for all variables.
method
is set to "permutation" or to "bootstrap".
statistic
is greater than crit.value
.statistic
under the calculated null
hypothesis (H_0: joint independence) based on the data.time[1]
is time
to compute Gram matrix, time[2]
is time to compute dHSIC and
time[3]
is the time to compute crit.value
and p.value.
X[[1]]
,...,X[[d]]
are jointly independent) and alternative hypothesis
(H_A: X[[1]]
,...,X[[d]]
are not jointly independent):
1. Permutation test for dHSIC: exact level, slow
2. Bootstrap test for dHSIC: pointwise asymptotic level and pointwise
consistent, slow
3. Gamma approximation based test for dHSIC: only approximate, fast
4. Eigenvalue based test for dHSIC: pointwise asymptotic level and pointwise
consistent, medium The null hypothesis is rejected if statistic
is strictly
greater than crit.value
.
For more details see the references.
dhsic
### pairwise independent but not jointly independent (pairwise HSIC vs dHSIC)
set.seed(0)
x <- matrix(rbinom(100,1,0.5),ncol=1)
y <- matrix(rbinom(100,1,0.5),ncol=1)
z <- matrix(as.numeric((x+y)==1)+rnorm(100),ncol=1)
X <- list(x,z,y)
dhsic.test(X, method="permutation",
kernel="gaussian", pairwise=TRUE,B=1000)$p.value
dhsic.test(X, method="permutation",
kernel="gaussian", pairwise=FALSE,B=1000)$p.value
Run the code above in your browser using DataLab