-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] Add the ability to check the validity of a PAG #100
Conversation
Signed-off-by: Aryan Roy <[email protected]>
Just to list the procedure out:
@adam2392 is this the right pseudo-algorithm? |
Yes with the added check at the very beginning that the graph is a valid PAG. |
For this, is it enough to check if the graph has any circle edges or not? |
Same skeleton as MAG so checking acyclicity, ancestral, and maximalist of the non-circle edge subgraph. A PAG could be fully oriented which results in no circle edges. |
For this, I think I have to determine that the two PAGs have the same set of conditional independence relations since they might be structurally different yet markov equivalent? |
Signed-off-by: Aryan Roy <[email protected]>
No that is only the case for MAGs. The two PAGs should be exactly the same, otherwise they encode some set of conditional independences. This assumes that all of the FCI orientation rules no longer can be applied to the PAG (i.e. it is as oriented as possible). |
Ah so simply checking that all of the edges are the same in both the PAGs should suffice. |
Hey @adam2392 I am done with the applications, so back to work! One question though, when checking acyclicity in the non-circle edge subgraph, do I only look for directed cycles? Or is the cycle supposed to be direction agnostic? |
Signed-off-by: Aryan Roy <[email protected]>
Nice! Congrats. Can you remind me what part requires the acyclicity check? |
Before actually checking for the validity, you asked me to check if it was valid-valid. |
Maybe there is a better term for it somewhere. |
Ah I see. Yeah it's just the same check as a MAG That's cuz we can't have cycles in the directed edges or almost directed cycles. You would only do this for the non circle edges tho. So any edge with a circle endpoint is dropped. A fully oriented PAG is just a MAG |
Got it! |
Signed-off-by: Aryan Roy <[email protected]>
@adam2392 right now I am checking for cycles, almost directed cycles and for inducing paths between any two non-adjacent nodes. Is that enough? |
Yep! |
Signed-off-by: Aryan Roy <[email protected]>
…into aryan_valid_pag
Signed-off-by: Aryan Roy <[email protected]>
@adam2392 How do I add dodiscover to the list of dependencies? |
For now, just run locally and check it. Dodiscover isn't on pypi yet but planning on making a release. |
@adam2392 can you describe how to convert a mag back to pag? Is it simply running the FCI algorithm using dodiscover? |
Yes |
Signed-off-by: Aryan Roy <[email protected]>
Signed-off-by: Aryan Roy <[email protected]>
Signed-off-by: Aryan Roy <[email protected]>
Signed-off-by: Aryan Roy <[email protected]>
…into aryan_valid_pag
for more information, see https://pre-commit.ci
Signed-off-by: Adam Li <[email protected]>
Signed-off-by: Adam Li <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments on the example.
Signed-off-by: Adam Li <[email protected]>
Signed-off-by: Adam Li <[email protected]>
Signed-off-by: Aryan Roy <[email protected]>
…into aryan_valid_pag
for more information, see https://pre-commit.ci
Signed-off-by: Aryan Roy <[email protected]>
…into aryan_valid_pag
@adam2392 Now the example is complete (along with some review suggestions being incorporated). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I think last round of comments. Please read the example over and see if it makes sense.
Thanks for the efforts @aryan26roy!
Co-authored-by: Adam Li <[email protected]> Signed-off-by: Aryan Roy <[email protected]>
Co-authored-by: Adam Li <[email protected]> Signed-off-by: Aryan Roy <[email protected]>
Co-authored-by: Adam Li <[email protected]> Signed-off-by: Aryan Roy <[email protected]>
Co-authored-by: Adam Li <[email protected]> Signed-off-by: Aryan Roy <[email protected]>
Co-authored-by: Adam Li <[email protected]> Signed-off-by: Aryan Roy <[email protected]>
Co-authored-by: Adam Li <[email protected]> Signed-off-by: Aryan Roy <[email protected]>
Co-authored-by: Adam Li <[email protected]> Signed-off-by: Aryan Roy <[email protected]>
Co-authored-by: Adam Li <[email protected]> Signed-off-by: Aryan Roy <[email protected]>
Signed-off-by: Aryan Roy <[email protected]>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once CI passes
This was a big one! |
Thanks for the PR @aryan26roy! |
Fixes #67
Changes proposed in this pull request:
Before submitting
section of the
CONTRIBUTING
docs.Writing docstrings section of the
CONTRIBUTING
docs.After submitting