py-why / pywhy-graphs

[Experimental] Causal graphs that are networkx-compliant for the py-why ecosystem.
https://py-why.github.io/pywhy-graphs/dev/index.html
MIT License
47 stars 8 forks source link

Update `intro` folder of Sphinx `examples/` to show intuition and concepts of inducing path #81

Closed adam2392 closed 1 year ago

adam2392 commented 1 year ago

As a follow-up to #78.

Perhaps we can just use one graph to illustrate the point. Can we use figure 2 from the paper https://arxiv.org/pdf/1104.5617.pdf

Then proceed by:

  1. drawing the figure and describing the inducing path and figure
  2. By default adjacent nodes have a trivial inducing path (the edge between them)
  3. show that inducing paths among non-adjacent nodes relative to L={L1, L2}, S={} is only possible in the figure between X1 and X5.
  4. There is no inducing path relative to L and S between (X1, X6) and (X2, X4)
  5. By adding X6 to S, then there is now an inducing path relative to L and S among (X2, X4), (X1, X3), (X5, X3)

This walks through the core concepts we've walked through on this PR on a graph that is in a well-known publication and then describes some of the intricacies of the hyperparameters (L and S).

_Originally posted by @adam2392 in https://github.com/py-why/pywhy-graphs/pull/78#discussion_r1235749455_

cc: @aryan26roy may be interested :)

aryan26roy commented 1 year ago

3. show that inducing paths among non-adjacent nodes relative to L={L1, L2}, S={} is only possible in the figure between X1 and X5.

@adam2392 there is no inducing path from X1 to X5 with L={L1,L2} and S={}.

adam2392 commented 1 year ago

Sorry you're right. There is no primitive inducing path among any nodes initially. This is validated by the final Figure 2c, where the skeleton is exactly the same before/after.

If you set X3 as part of L, then there will be an inducing path between X1 and X5.

[Update] So I guess this could be more complicated, but I think perhaps the story of the example can go:

WDYT?

aryan26roy commented 1 year ago

That sounds good. Just to clarify something, there are a lot of inducing paths other than [X1,X5] which are available with L = {L1,L2,X3}. Adding X6 to S opens up ALL inducing paths, right?

adam2392 commented 1 year ago

That sounds good. Just to clarify something, there are a lot of inducing paths other than [X1,X5] which are available with L = {L1,L2,X3}. Adding X6 to S opens up ALL inducing paths, right?

That I don't know. I think it might be overwhelming to give a laundry list to the user. The goal is to essentially show a figure and illustrate what happens when L and S is modified and walk them through 1-2 specific examples of why those paths are now "inducing".

aryan26roy commented 1 year ago

Understood. I think I get what you want.