HSIC: Computes the HSIC criterion for two given kernels

Description Usage Arguments Value References Examples

View source: R/RcppExports.R

Description

The Hilbert-Schmidt Independence Criterion (HSIC) is a measure of independence between two random variables. If characteristic kernels are used for both variables, the HSIC is zero iff the variables are independent. In this function, we implement an unbiased estimator for the HSIC measure. Specifically, for two positive-definite kernels K and L and a sample size n, the unbiased HSIC estimator is:

HSIC(K, L) = \frac{1}{n(n-3)} ≤ft[trace(KL) + \frac{1^\top K11^\top L 1}{(n-1)(n-2)}- \frac{2}{n-2}1^\top KL\right]

Usage

1
HSIC(K, L)

Arguments

K

first kernel similarity matrix

L

second kernel similarity matrix

Value

an unbiased estimate of the HSIC measure.

References

Song, L., Smola, A., Gretton, A., Borgwardt, K., & Bedo, J. (2007). Supervised Feature Selection via Dependence Estimation. https://doi.org/10.1145/1273496.1273600

Examples

1
2
3
4
5
6
7
n <- 50
p <- 20
X <- matrix(rnorm(n*p), nrow = n, ncol = p)
Y <- matrix(rnorm(n*p), nrow = n, ncol = p)
K <-  X %*% t(X) / p
L <-  Y %*% t(Y) / p
uHSIC <- HSIC(K, L)

kernelPSI documentation built on Dec. 8, 2019, 1:07 a.m.