FenTechSolutions / CausalDiscoveryToolbox

Package for causal inference in graphs and in the pairwise settings. Tools for graph structure recovery and dependencies are included.
https://fentechsolutions.github.io/CausalDiscoveryToolbox/html/index.html
MIT License
1.08k stars 198 forks source link

[BUG] ANM + predict_proba method return has wrong #109

Open 945716994 opened 2 years ago

945716994 commented 2 years ago

Encountering a bug while using this package may occur. In order to fix the said bug and improve all users’ experience, it is highly recommended to submit a bug report on the GitHub issue tracker: https://github.com/FenTechSolutions/CausalDiscoveryToolbox/issues

Describe the bug The predict_proba method that in ANM, it said:" 1 if a->b and -1 b->a), so the return statement why is anm_score(b, a) - anm_score(a, b). Why not is anm_score(a, b) - anm_score(b, a).

Please mention

baosws commented 2 years ago

The ANM score for direction a->b (anm_score(a, b)) is the independence test statistic between a and residuals, and lower value = more likely independent (section 3 here) = more likely a->b. In that sense, if a->b is the true direction then anm_score(a, b) should be low and anm_score(b, a) should be high, hence anm_score(b, a) - anm_score(a, b) should be positive. Therefore the implementation is not wrong in this case.

945716994 commented 2 years ago

What about this situation: no edge between X and Y,does the anm_score(x, y) will return 0?

diviyank commented 2 years ago

Hello ! Sorry for the late answer ; yes ; if there is no edge between X and Y the score is theoretically 0. In the real case, the value is close to 0.

Best, Diviyan