pymc-devs / pymc-devs/pymc-examples
Divergences in Bayesian Non-parametric Causal Inference PyMC 5.10+
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 398
- Forks
- 325
- Avg merge
- 9d 15m
- Merged PRs (30d)
- 1
Description
Bayesian Non-parametric Causal Inference:
https://www.pymc.io/projects/examples/en/latest/causal_inference/bayesian_nonparametric_causal.html:
Issue description
The notebook was originally developed using pymc 5.3.0, when updating to 5.10 the initial propensity model fit on the logistic regression breaks down. 4000 or so divergences. This seems to be due colinearity and the squared terms in the data set.
*Note that this issue tracker is about the contents in the notebooks,
Expected output
Proposed solution
This issue can be fixed by specifying the init conditions on the sampler.
idata.extend(pm.sample(samples, init='adapt_diag', random_seed=105, idata_kwargs={"log_likelihood": True}))
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked causal_inference/bayesian_nonparametric_causal.html notebook and its initial propensity model fit, comparing the PyMC 5.3.0 and 5.10 behavior described here. Check the proposed init='adapt_diag' sampler setting and verify that the resulting run no longer produces the reported thousands of divergences and matches the expected output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100