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

ANM score #43

Closed siddsuresh97 closed 4 years ago

siddsuresh97 commented 4 years ago

What does the value on the ANM score indicate? I never get a negative value even when I reverse the order to the function anm_score.

For Eg. anm_score(x1, y1) ,anm_score(y1, x1) = (1.492447882112475, 0.6205516300704923) and anm_score(x2, y2), anm_score(y2, x2) = (1.2622033043127454, 1.9067645693295359)

What can I infer from these values? Does this mean that x1 causes y1 since 1.49 > 0.620 and y2 causes x2 since 1.90 > 1.26 ?

diviyank commented 4 years ago

The anm score function represents the fitness of the additive noise model w.r.t. the proposed causal direction. The function predict_proba does actually what you want to do

siddsuresh97 commented 4 years ago

Ok. Could you please confirm if the direction is correct,

predict_proba returns self.anm_score(b, a) - self.anm_score(a, b). Doesn't this mean that a positive score means b causes a (b->a) ?

diviyank commented 4 years ago

It's actually the opposite: I made a wrong choice of words: anm_score does not represent the fitness but the error associated to the model in the proposed causal direction. Therefore, if predict_proba(A,B)>0 then A causes B according to the ANM, given that the hypotheses are verified.

diviyank commented 4 years ago

Hi, I will be closing this issue, don't hesitate to reopen it if you have more questions.

Best, Diviyan