Skip to content

Conditional vs Interventional Distribution #552

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

Merged
merged 31 commits into from
Jul 4, 2023

Conversation

drbenvincent
Copy link
Contributor

@drbenvincent drbenvincent commented Jul 1, 2023

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
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@drbenvincent drbenvincent marked this pull request as draft July 1, 2023 18:28
@drbenvincent drbenvincent changed the title [WIP] Conditional vs Interventional Distribution Conditional vs Interventional Distribution Jul 2, 2023
@drbenvincent drbenvincent marked this pull request as ready for review July 2, 2023 17:16
Copy link
Collaborator

@juanitorduz juanitorduz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! I left some minor comments!

@drbenvincent
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

Copy link
Member

@OriolAbril OriolAbril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all the converting to dataframe is much more complicated than it needs to be, I'll try running locally and opening a PR against your fork with the proposed changes.

EDIT: PR open drbenvincent#1

@ricardoV94
Copy link
Member

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

@drbenvincent drbenvincent merged commit cb48670 into pymc-devs:main Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conditional vs interventional distributions
7 participants