Measuring Statistical Dependence with Hilbert-Schmidt Norms
Authors: Arthur Gretton, Olivier Bousquet, Alex Smola, Bernhard Schölkopf
Published: 2005
Venue: ALT
Link: Springer
Summary
This foundational paper introduces the Hilbert-Schmidt Independence Criterion (HSIC), a kernel-based measure of statistical dependence. HSIC measures the distance between the joint distribution and the product of marginals in a reproducing kernel Hilbert space.
Key Contributions
1. HSIC Definition
The Hilbert-Schmidt Independence Criterion between random variables and :
where is the cross-covariance operator in RKHS.
2. Cross-Covariance Operator
For RKHS with kernel and with kernel :
where and are feature maps.
3. Equivalent Formulation
HSIC can be written in terms of kernels:
where are independent copies.
4. Independence Characterization
Theorem: If kernels and are characteristic:
Mathematical Framework
Tensor Product Space
Consider the tensor product RKHS with kernel:
Mean Embedding
The joint embedding:
The product of marginal embeddings:
HSIC as Distance
Empirical Estimation
Biased Estimator
Given samples :
where is the centering matrix.
Unbiased Estimator
where and have zero diagonal.
Algorithm
import numpy as np
def hsic_biased(K, L):
"""
Compute biased HSIC estimator.
Parameters:
-----------
K : kernel matrix for X (n, n)
L : kernel matrix for Y (n, n)
Returns:
--------
hsic : HSIC value
"""
n = K.shape[0]
H = np.eye(n) - np.ones((n, n)) / n
return np.trace(K @ H @ L @ H) / n**2
def hsic_unbiased(K, L):
"""
Compute unbiased HSIC estimator.
"""
n = K.shape[0]
# Zero out diagonals
K_tilde = K - np.diag(np.diag(K))
L_tilde = L - np.diag(np.diag(L))
# Compute terms
term1 = np.trace(K_tilde @ L_tilde)
term2 = K_tilde.sum() * L_tilde.sum() / ((n-1) * (n-2))
term3 = 2 * (K_tilde @ L_tilde).sum() / (n-2)
return (term1 + term2 - term3) / (n * (n-3))
def hsic_independence_test(X, Y, kernel_x, kernel_y, n_permutations=1000, alpha=0.05):
"""
Permutation test for independence using HSIC.
"""
K = kernel_x(X, X)
L = kernel_y(Y, Y)
# Observed HSIC
observed = hsic_unbiased(K, L)
# Permutation null distribution
null_values = []
for _ in range(n_permutations):
perm = np.random.permutation(len(Y))
L_perm = L[np.ix_(perm, perm)]
null_values.append(hsic_unbiased(K, L_perm))
# p-value
p_value = np.mean(np.array(null_values) >= observed)
return {
'statistic': observed,
'p_value': p_value,
'reject': p_value < alpha
}
Statistical Properties
Asymptotic Distribution
Under :
where and are eigenvalues.
Consistency
Under :
Convergence Rate
Applications
- Feature Selection: Select features with high HSIC to target
- Independence Testing: Non-parametric test for dependence
- Kernel Selection: Choose kernel that maximizes HSIC
- ICA: Independent component analysis via HSIC minimization
- Causal Discovery: Test conditional independence
Comparison with Other Measures
| Measure | Nonlinear | Distribution-free | Consistent |
|---|---|---|---|
| Pearson | ✗ | ✗ | ✗ |
| Spearman | Monotonic | ✓ | ✗ |
| Mutual Info | ✓ | ✗ | ✓ |
| HSIC | ✓ | ✓ | ✓ |
Citation
@inproceedings{gretton2005measuring,
title={Measuring statistical dependence with Hilbert-Schmidt norms},
author={Gretton, Arthur and Bousquet, Olivier and Smola, Alex and
Sch{\"o}lkopf, Bernhard},
booktitle={Algorithmic Learning Theory},
pages={63--77},
year={2005}
}
Further Reading
- Gretton, A., et al. (2012). A kernel two-sample test
- Fukumizu, K., et al. (2007). Kernel measures of conditional dependence
- Zhang, K., et al. (2011). Kernel-based conditional independence test