| nHSIC | R Documentation |
Computes a normalized version of the Hilbert-Schmidt Independence Criterion (HSIC) between two random vectors.
nHSIC(x, y)
x |
A numeric vector or numeric matrix. Rows correspond to observations. |
y |
A numeric vector or numeric matrix. Rows correspond to observations. |
The normalization rescales HSIC to reduce the influence of marginal scale effects and yields a quantity analogous in spirit to a correlation measure.
The normalized HSIC is defined as
\mathrm{nHSIC}(X,Y) =
\sqrt{
\frac{\mathrm{HSIC}(X,Y)}
{\sqrt{\mathrm{HSIC}(X,X)\mathrm{HSIC}(Y,Y)}}
}.
Here, \mathrm{HSIC}(X,Y) denotes the empirical HSIC value computed
using dhsic.
Vectors are treated as one-column matrices.
The function computes empirical HSIC values for (x, y),
(x, x), and (y, y) and combines them according to the
normalization formula above.
If the normalization denominator is numerically non-positive, the function
returns 0.
Small negative values caused by floating-point arithmetic are truncated to zero before taking the square root.
A numeric scalar giving the normalized HSIC value.
Gretton, A., Bousquet, O., Smola, A., and Schölkopf, B. (2005). Measuring statistical dependence with Hilbert-Schmidt norms. Algorithmic Learning Theory, 63–77. doi:10.1007/11564089_7.
set.seed(1)
n <- 200
x <- matrix(rnorm(n), ncol = 1)
y <- x^2 + 0.3 * rnorm(n)
# Standard HSIC
dHSIC::dhsic(x, y)$dHSIC
# Normalized HSIC
nHSIC(x, y)
# Independent variables
z <- matrix(rnorm(n), ncol = 1)
dHSIC::dhsic(x, z)$dHSIC
nHSIC(x, z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.