causal_falsify.utils.cond_indep module
- causal_falsify.utils.cond_indep.fisherz(x, y, z)[source]
Fisher’s Z Conditional Independence Test.
- Parameters:
x (np.ndarray) – Input array representing variable X. Must be a 2D array with shape (n_samples, 1).
y (np.ndarray) – Input array representing variable Y. Must be a 2D array with shape (n_samples, 1).
z (np.ndarray) – Input array representing conditioning variables Z. Must be a 2D array with shape (n_samples, n_covariates).
- Returns:
p-value of the test if successful; None if an error occurred.
- Return type:
Optional[float]
- causal_falsify.utils.cond_indep.kcit_rbf(x, y, z)[source]
Kernel-based Conditional Independence Test (KCIT) with RBF kernels.
- Parameters:
x (np.ndarray) – Input array representing variable X. Must be a 2D array with shape (n_samples, 1).
y (np.ndarray) – Input array representing variable Y. Must be a 2D array with shape (n_samples, 1).
z (np.ndarray) – Input array representing conditioning variables Z. Must be a 2D array with shape (n_samples, n_covariates).
- Returns:
p-value of the test if successful; None if an error occurred.
- Return type:
Optional[float]