chi2_approx¶
-
hyppo.tools.
chi2_approx
(calc_stat, x, y)¶ Fast chi-squared approximation for the p-value.
In the case of distance and kernel methods, Dcorr (and by extension Hsic [2]) can be approximated via a chi-squared distribution [1]. This approximation is also applicable for the nonparametric MANOVA via independence testing method in our package [3].
- Parameters
calc_stat (
callable
) -- The method used to calculate the test statistic (must use hyppo API).x,y (
ndarray
) -- Input data matrices.x
andy
must have the same number of samples. That is, the shapes must be(n, p)
and(n, q)
where n is the number of samples and p and q are the number of dimensions. Alternatively,x
andy
can be distance or similarity matrices, where the shapes must both be(n, n)
.
- Returns