DVariateTest¶
-
class
hyppo.d_variate.base.DVariateTest(compute_kernel=None, **kwargs)¶ A base class for a \(d\)-variate independence test.
- Parameters
compute_kernel (
str,callable, orNone, default:"gaussian") -- A function that computes the kernel similarity among the samples within each data matrix. Valid strings forcompute_kernelare, as defined insklearn.metrics.pairwise.pairwise_kernels,[
"additive_chi2","chi2","linear","poly","polynomial","rbf","laplacian","sigmoid","cosine"]Note
"rbf"and"gaussian"are the same metric. Set toNoneor"precomputed"ifargsare already similarity matrices. To call a custom function, either create the similarity matrix before-hand or create a function of the formmetric(x, **kwargs)wherexis the data matrix for which pairwise kernel similarity matrices are calculated and kwargs are extra arguments to send to your custom function.**kwargs -- Arbitrary keyword arguments for
multi_compute_kern.
Methods Summary
|
Calculates the \(d\)-variate independence test statistic. |
|
Calculates the d_variate independence test statistic and p-value. |
-
abstract
DVariateTest.statistic(*args)¶ Calculates the \(d\)-variate independence test statistic.
-
abstract
DVariateTest.test(*args, reps=1000, workers=1)¶ Calculates the d_variate independence test statistic and p-value.
- Parameters
*args (
ndarrayoffloat) -- Variable length input data matrices. All inputs must have the same number of samples. That is, the shapes must be(n, p),(n, q), etc., where n is the number of samples and p and q are the number of dimensions.reps (
int, default:1000) -- The number of replications used to estimate the null distribution when using the permutation test used to calculate the p-value.workers (
int, default:1) -- The number of cores to parallelize the p-value computation over. Supply-1to use all cores available to the Process.
- Returns