Closed maddiehill closed 1 year ago
Thanks for reporting. Math errors are a little bit tricky, and sometimes we just don't know why, especially with finite samples :) @chenweiDelight @MarkDana Any thoughts on potential causes? Or shall we first add handling there?
Hi @maddiehill Thanks so much for identifying this! I just made a pr https://github.com/py-why/causal-learn/pull/108 to solve this. The numerical issue of |sample partial correlation|>=1 happens when the samplesize is very small, or the relationship is deterministic. So we set the abs to 1. - machine epsilon to prevent log(<=0) errors.
Thanks again!
Great @MarkDana @kunwuz thanks for fixing this so fast!
Hi, I experienced a
ValueError: math domain error
on this line fromlog
as the value of(1 + r) / (1 - r)
was negative. Please see the screenshot below and the value of r from the debugger. I'm not sure why this might be happening, but it would be good to catch potential errors here :)