CausalDiscoveryToolbox icon indicating copy to clipboard operation
CausalDiscoveryToolbox copied to clipboard

Wrong sign causal score IGCI

Open ArnoVel opened this issue 5 years ago • 2 comments

Hi there again,

I'm pretty sure the integral score is supposed to be equal to entropy_y - entropy_x. The authors of IGC say one should infer X->Y whenever h(pX) > h(P_Y) or namely when the integral score is negative. In your code you pick the opposite :confused: .

https://github.com/FenTechSolutions/CausalDiscoveryToolbox/blob/ff403b654cec8a3cddd6c2ce6a84a8e46255c825/cdt/causality/pairwise/IGCI.py#L59-L79

For reference, another implementation

And the paper extracts: Screenshot from 2020-08-19 18-25-39 Screenshot from 2020-08-19 18-25-26

ArnoVel avatar Aug 19 '20 16:08 ArnoVel

Hello, does this refer in some way to #14 ?

I don't want to change twice the sign of the score, unless I was really wrong

Best, Diviyan

diviyank avatar Aug 20 '20 07:08 diviyank

The papers says that if integral of slope y=f(x) < 0 predict X->Y. If you want to keep your convention (+ for XY, - for YX), you should return b-a, that is - 2 * integral. The issue #14 concerns your entropy score, which is correct atm: ( if ent(Y) - ent(X) < 0 then XY is equivalent to what you wrote, which is if ent(X) - ent(Y) > 0 then XY)

ArnoVel avatar Aug 24 '20 14:08 ArnoVel