| |
- chi_squared_prob(x2, v)
- This function computes the chi-squared probability.
It returns P(X2|v), the probability of observing a chi-squared value <= X2 with v degrees of freedom
- cond_indep_G2(X, a, b, s)
- This function test if a is independent with b given s using likelihood ratio test G2
Input
-----
X: {numpy array}, shape (n_samples, n_features)
input data, guaranteed to be a discrete data matrix whose element is non negative integer
a: {int}
index of variable a in the input X
b: {int}
index of variable y in the input X
s: {numpy array}, shape (n_features,)
set of indexes of variables in the input X
Output
------
ci: {int}
test result (1 = conditional independent, 0 = no)
G2: {float}
G2 value(-1 if not enough data to perform the test, i.e., CI = 0)
Reference
---------
Leray, Philippe and Francois, Olivier. "BNT Structure Learning Package: Documentation and Experiments" 2004
|