Skip to content

[WIP] Bugfix for 5.19-5.22#160

Open
oadams wants to merge 1 commit into
pymc-devs:mainfrom
oadams:ch5_bugfix
Open

[WIP] Bugfix for 5.19-5.22#160
oadams wants to merge 1 commit into
pymc-devs:mainfrom
oadams:ch5_bugfix

Conversation

@oadams

@oadams oadams commented Sep 6, 2021

Copy link
Copy Markdown

I spotted what I think is a bug in the Chapter 5 notebook. In the book, sections 5.19-5.22 do counterfactual modeling with a model where A -> M and A -> D <- M. The predictor A is tweaked and the total effect on D is observed. This total effect comes from the direct link between A and D, but is also mediated by an indirect link via M. That is, values of M need to be simulated as well and their effect on D.

The bug was that it appeared as though the values for M were not being simulated. The difference in the resulting plots in 5.22 is small, but from a modeling perspective it's quite distinct.

This PR isn't quite ready for merge, because my changes break subsequent code from 5.23 onwards. But I am putting the PR up now in the hope of getting feedback on whether I'm doing it the correct way before changing the subsequent code.

Note I haven't run pre-commit checks yet, so don't merge in current state.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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.

1 participant