pymc-devs / pymc-examples

Examples of PyMC models, including a library of Jupyter notebooks.
https://www.pymc.io/projects/examples/en/latest/
MIT License
259 stars 212 forks source link

Conditional vs Interventional Distribution #552

Closed drbenvincent closed 1 year ago

drbenvincent commented 1 year ago

This PR will add a new example to the causal section of the docs. It focuses on the do operator, and contrasts conditional distributions to interventional distributions. Part of it is heavily inspired by the blog post Causal Inference 2: Illustrating Interventions via a Toy Example by Ferenc Huszár.

FYI

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

drbenvincent commented 1 year ago

Thanks for the comments @juanitorduz, @larryshamalama, @NathanielF. I think I'm up to date with edits so far. Happy if there's any more feedback, but this is already improved :)

drbenvincent commented 1 year ago

Thanks for the feedback everyone. I believe I've dealt with all the feedback to this point. In dealing with that I have added a fair amount of additional introductory and explanatory text. Hopefully this is much improved, but open to any last bits of feedback, particularly on the new content.

ricardoV94 commented 1 year ago

Would it make sense to do some inference? Or at least mention things would be the same if you had done inference, but you would use do + posterior_predictive

drbenvincent commented 1 year ago

Would it make sense to do some inference? Or at least mention things would be the same if you had done inference, but you would use do + posterior_predictive

I did think of doing this. But I felt that it would be best to leave that for a future notebook, mainly because this might be about the right volume of content for a beginner to fully digest. I have one planned (will put an issue in soon) which specifically compares interventions vs counterfactuals as Pearl makes a big distinction about these.

drbenvincent commented 1 year ago

I think we're good to go! Thanks for the feedback everyone - truly valuable. I just need an approval from @twiecki or @OriolAbril before I can merge.