BasisResearch / chirho

An experimental language for causal reasoning
https://basisresearch.github.io/chirho/getting_started.html
Apache License 2.0
167 stars 11 forks source link

Add instrumental variables example #18

Closed eb8680 closed 1 month ago

eb8680 commented 1 year ago

As in the other examples, the easiest way to approach this is probably to pick a single paper and reproduce its model and results.

Some candidate papers:

qinqian commented 1 year ago

@eb8680, one quick question, shall we use pyro or causal_pyro to implement this and #21 examples? Is the causal_pyro ready with some basic get-started cases to use?

eb8680 commented 1 year ago

@qinqian you should be able to get started along the same lines as the other examples (e.g. slc.ipynb) by creating a new notebook with the following sections:

  1. a background section setting up an example problem and dataset taken from one of the papers above or a similar one
  2. a section with a Pyro program corresponding to the causal model from the paper
  3. a section with a causal query formulated as an expanded Pyro model
  4. a section where the query is evaluated using SVI and an autoguide, or another standard Pyro inference algorithm
  5. a section where the results of the query are visualized and found to reproduce the results from the source paper

If you get stuck with these at any point, feel free to put up a draft pull request and ask for help or feedback. The existing examples currently have steps 1-3 completed, and we're working on finishing steps 4-5 (e.g. #59).

qinqian commented 1 year ago

Thanks @eb8680!

qinqian commented 11 months ago

A relevant about the Mendelian randomization: https://www.nature.com/articles/s41467-023-41394-4.

dimkab commented 1 month ago

Published version of the Deep IV paper:

J. Hartford, G. Lewis, K. Leyton-Brown, and M. Taddy, “Deep IV: A Flexible Approach for Counterfactual Prediction,” in Proceedings of the 34th International Conference on Machine Learning, PMLR, Jul. 2017, pp. 1414–1423. Available: https://proceedings.mlr.press/v70/hartford17a.html