Kernel Measures of Conditional Dependence
Authors: Kenji Fukumizu, Francis R. Bach, Arthur Gretton
Published: 2007
Venue: NeurIPS
Link: PDF
Summary
This paper extends kernel dependence measures to the conditional setting. It introduces kernel-based measures that characterize conditional independence and provides consistent estimators for testing conditional independence hypotheses.
Key Contributions
1. Conditional Cross-Covariance Operator
Define the conditional cross-covariance operator:
This generalizes the partial correlation to nonlinear dependencies.
2. Conditional Independence Characterization
Theorem: For characteristic kernels:
3. Normalized Measure
The normalized conditional dependence measure:
This is analogous to partial correlation for nonlinear relationships.
Mathematical Framework
Covariance Operators
In RKHS with feature map :
- Mean:
- Covariance:
- Cross-covariance:
Conditional Operator Derivation
From the regression interpretation:
The conditional cross-covariance removes the part explained by :
Regularized Inverse
In practice, use regularized inverse:
Empirical Estimation
Matrix Formulation
Given samples , define centered kernel matrices:
- (kernel for )
- (kernel for )
- (kernel for )
where .
Conditional HSIC Estimator
The Hilbert-Schmidt norm:
Algorithm
import numpy as np
def conditional_hsic(K, L, M, epsilon=0.01):
"""
Compute conditional HSIC.
Parameters:
-----------
K : kernel matrix for X (n, n)
L : kernel matrix for Y (n, n)
M : kernel matrix for Z (n, n)
epsilon : regularization parameter
Returns:
--------
hsic_cond : conditional HSIC value
"""
n = K.shape[0]
H = np.eye(n) - np.ones((n, n)) / n
# Center kernel matrices
K_tilde = H @ K @ H
L_tilde = H @ L @ H
M_tilde = H @ M @ H
# Regularized inverse
M_reg_inv = np.linalg.inv(M_tilde + epsilon * n * np.eye(n))
# Residual kernel for Y after regressing on Z
L_residual = L_tilde - M_tilde @ M_reg_inv @ L_tilde
# Conditional HSIC
C_cond = K_tilde @ L_residual / n**2
hsic_cond = np.trace(C_cond @ C_cond.T)
return hsic_cond
def conditional_independence_test(X, Y, Z, kernel_x, kernel_y, kernel_z,
epsilon=0.01, n_permutations=1000, alpha=0.05):
"""
Test for conditional independence X ⊥ Y | Z.
"""
K = kernel_x(X, X)
L = kernel_y(Y, Y)
M = kernel_z(Z, Z)
# Observed statistic
observed = conditional_hsic(K, L, M, epsilon)
# Permutation null (permute Y given Z clusters)
null_values = []
for _ in range(n_permutations):
perm = np.random.permutation(len(Y))
L_perm = L[np.ix_(perm, perm)]
null_values.append(conditional_hsic(K, L_perm, M, epsilon))
p_value = np.mean(np.array(null_values) >= observed)
return {
'statistic': observed,
'p_value': p_value,
'reject': p_value < alpha
}
Theoretical Properties
Consistency
As and appropriately:
Regularization Selection
Optimal balances:
- Bias from regularization:
- Variance from estimation:
Choosing gives rate .
Convergence Rate
Under regularity conditions:
Applications
1. Causal Discovery
Test whether or given :
- suggests is a confounder or mediator
- suggests direct causal link
2. Feature Selection
Select features such that:
3. Graphical Models
Learn conditional independence structure for kernel graphical models.
4. Transfer Learning
Test whether domain shift explains difference between and .
Comparison with Parametric Tests
| Test | Assumptions | Nonlinear | Complexity |
|---|---|---|---|
| Partial correlation | Gaussian | ✗ | |
| Conditional MI | Known density | ✓ | |
| Kernel CI | Characteristic kernel | ✓ |
Citation
@inproceedings{fukumizu2007kernel,
title={Kernel measures of conditional dependence},
author={Fukumizu, Kenji and Bach, Francis R and Gretton, Arthur},
booktitle={Advances in Neural Information Processing Systems},
volume={20},
year={2007}
}
Further Reading
- Zhang, K., et al. (2011). Kernel-based conditional independence test and application
- Strobl, E., et al. (2019). Approximate kernel-based conditional independence tests
- Park, G. & Muandet, K. (2020). A measure-theoretic approach to kernel CI tests