A kernel independence test for x and y with no conditioning set;
run_test() errors if z is non-empty (use kci() to condition).
hsic(
data,
kernel = NULL,
bandwidth = "heuristic",
null_dist = "gamma",
n_permutations = 100L,
seed = 0
)A dataset() result or a data.frame.
NULL (default RBF kernel), one rbf_kernel() /
linear_kernel() used for every column, or a named list of such kernels
keyed by column name.
Bandwidth rule, "heuristic" (default) or "median".
Null distribution, "gamma" (default) or "permutation".
Number of permutations (whole number >= 1); unused with the gamma null but always validated.
Permutation seed (whole number, 0 to 2^53); unused with the gamma null.
A fastcit_test bound to data.
df <- data.frame(X = rnorm(50), Y = rnorm(50))
run_test(hsic(dataset(df)), "X", "Y")
#> $statistic
#> [1] 12.19843
#>
#> $p_value
#> [1] 0.5206906
#>
#> $dof
#> NULL
#>
#> $effect_size
#> [1] 0.05308995
#>