Code

While there is a vast literature on causal inference, practical tools for implementing causal inference methods are hard to find.

For good reason, because validity of causal estimates from observational data depends primarily on assumptions that cannot be derived or tested from data alone.

So we asked ourselves, “What if a software library for causal inference treated assumptions as its focus, rather than estimation methods?” Our attempt at this vision is the DoWhy library, inspired by Pearl’s do-calculus. The library provides a standard way to express causal assumptions, test them to the extent possible, and also implements common estimation methods for convenience.

Check out our blog post on DoWhy or dive into the code on Github.

Documentation is available at https://causalinference.gitlab.io/dowhy.

Once you have done the hard work of identifying the causal estimand, you can also try out this library by Adam Kelleher that implements non-parametric estimation methods. https://github.com/akelleh/causality

For causal discovery, check out DAGitty, an excellent package that lets you reason with causal graphs. http://www.dagitty.net/