Wrong sign causal score IGCI
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:

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
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)