py-why / causal-learn

Causal Discovery in Python. It also includes (conditional) independence tests and score functions.
https://causal-learn.readthedocs.io/en/latest/
MIT License
1.21k stars 197 forks source link

PC algorithm logic #129

Open kenneth-lee-ch opened 1 year ago

kenneth-lee-ch commented 1 year ago

In the causal-learn/causallearn/utils/PCUtils/SkeletonDiscovery.py, why does it need to add sepsets to cp.sepset at lines 123-124? If the p-value return at line 101 is not greater than alpha for all S in line 100, doesn't that mean you force an empty set to be a separating set?

kunwuz commented 1 year ago

Yes, and it is consistent with the pseudo-code of PC, where an empty set could be a separating set.

kenneth-lee-ch commented 1 year ago

I mean you will infer d-separation with respect to an empty set regardless of the test result.

kunwuz commented 10 months ago

Thanks for the explanation. @zhi-yi-huang tried to fix this issue in #161 (thanks so much!). Please let us know if there are any questions.