ijmbarr / causalgraphicalmodels

Causal Graphical Models in Python
MIT License
240 stars 44 forks source link

Is there a way to find instrumental variables in a DAG? #2

Open AlexAndorra opened 4 years ago

AlexAndorra commented 4 years ago

Hi there, Thanks a lot for your work on this package -- this looks really useful and promising 👌

I was wondering if there is a way to find instrumental variables, if they are present in a DAG? Kind of like what the dagitty R package does with its function instrumentalVariables:

library(dagitty)
dagIV <- dagitty( "dag{ Q -> E <- U -> W <- E }" )
instrumentalVariables( dagIV , exposure="E" , outcome="W" )

Context: we are porting Statistical Rethinking 2 to python and PyMC3 and using your package to do what R. McElreath does with daggity.

Thanks a lot in advance for your help, and take care 🖖 Alex