# Tools and Libraries for Causality

November 16, 2018

Here is a list of libraries, packages and tools for causal discovery and inference. Please let me know if I’ve missed out on something!

## Python

### Inference

**DoWhy**: DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks. [GitHub]**CausalInference**: Causalinference is a software package that implements various statistical and econometric methods used in the field variously known as Causal Inference, Program Evaluation, or Treatment Effect Analysis. [GitHub] [PyPi]**CausalImpact**: This is the Python version of Google’s Causal Impact model. The main goal of the algorithm is to infer the expected effect a given intervention (or any action) had on some response variable by analyzing differences between expected and observed time series data. [GitHub]

### Discovery

**CausalDiscoveryToolbox**: This is a package for causal discovery, and includes algorithms from the popular R packages such as`bnlean`

and`pcalg`

. [GitHub]**CGNN**: This is not exactly a package, but its code to reproduce the results from the paper “Learning Functional Causal Models with Generative Neural Networks” [GitHub]**BETS**: This is a package to use Granger causality to learn causal networks with time series data. Although this package is targeted towards gene expression datasets, the method itself is fairly generic, and should work in cases where the number of samples is much lesser than the number of random variables. [GitHub]**TiMINO**: This is not a package, but the code to replicate the results from the paper. This is applicable for learning causal graphs from time series data. [Website]**LiNGAM**: This is a package to learn non-Gaussian linear causal models. It includes functionality for different variations of the LiNGAM algorithm, such as ICA based LiNGAM, Direct LiNGAM, VARMA-LiNGAM and LiNGAM for multiple groups. [GitHub]

## R

### Inference

**CausalImpact**: This R package implements an approach to estimating the causal effect of a designed intervention on a time series. [GitHub]**tmle**: This package implements targeted maximum likelihood estimation of point treatment effects. [CRAN]**InvariantCausalPrediction**: This R package implements an approach for estimating confidence intervals for causal effects, using data collected in different experimental or environmental conditions. [CRAN]**pcalg**: This package provides functions for causal structure learning and causal inference using graphical models. Algorithms implemented are - the IDA algorithm, the Generalized Backdoor Criterion (GBC), the Generalized Adjustment Criterion (GAC) and some related functions. [CRAN]

### Discovery

**pcalg**: This package provides functions for causal structure learning and causal inference using graphical models. Algorithms implemented are PC, FCI, RFCI, GIES. [CRAN]**CAM**: This package fits a Causal Additive Model (CAM) for estimating the causal structure of the underlying process. [CRAN]**VAR-LiNGAM**: This is the R code for Vector Autoregressive Linear Non-Gaussian Acyclic Model. [Website]**Bayes-LiNGAM**: This is a software package for learning directed acyclic graph structures from non-experimental (‘uncontrolled’) data. [Website]

More code for causal discovery and inference is listed here and here.

## Tools

**Tetrad**: Tetrad is a program which creates, simulates data from, estimates, tests, predicts with, and searches for causal and statistical models. [Website]

## Other Useful Links

- Website for LiNGAM [Website]
- Website with code from papers on causality [Website]
- Elias Barenboim’s group is beta-testing a tool for doing causal inference from first principles. You can apply to beta test the tool here. [Twitter]

(Updated 20th April, 2020)