Part III: Discovery Through Data and Models
Chapter 31: Causal Discovery and Causal Inference

Causal Discovery and Causal Inference

"I spent three months learning that correlation is not causation. Then I spent three years learning how to get from one to the other."

A Causal Graph With Too Many Confounders

Overview

Correlation quantifies association. Causation explains mechanism. Every scientist knows the gap between these two concepts, yet much of data-driven discovery operates entirely in the correlational regime: fit a model, find a pattern, report a relationship. The field of causal inference provides the formal machinery to bridge this gap, answering questions that no amount of observational data analysis alone can settle. Does a drug reduce mortality, or do healthier patients simply choose to take it? Does a gene expression change drive tumor growth, or is it a downstream consequence of a shared regulatory signal?

This chapter builds the complete causal reasoning toolkit. We start with structural causal models (SCMs), the mathematical language that makes causal claims precise enough to test. We then turn to causal discovery algorithms that learn causal graph structure directly from data, moving beyond the hand-drawn DAGs that dominate textbook examples. With a graph in hand, we estimate treatment effects using modern semiparametric methods (double machine learning, targeted learning) that leverage the predictive power of ML while preserving valid statistical inference. Finally, we assemble a full pipeline: from raw observational data through graph discovery, effect estimation, and rigorous refutation testing.

The ideas here connect directly to the causal reasoning foundations introduced in Chapter 4, where we first encountered the do-calculus and causal graph queries. They build on the exploratory discovery techniques of Chapter 25, which provide the initial patterns that causal analysis can elevate from associations to mechanisms. The anomaly detection methods of Chapter 30 tell us what is unusual; causal inference tells us why. Looking forward, causal reasoning powers the social and economic systems of Chapter 52 and feeds into the AI scientist architectures of Chapter 53, where autonomous agents must reason about interventions.

Prerequisites

Readers should be comfortable with Chapter 4: Reasoning for Discovery for the conceptual foundations of causal reasoning, and Chapter 5: Discovery Through Data, Models, and Simulation for regression and probability fundamentals. Familiarity with Chapter 25: Exploratory Discovery helps with the data exploration that precedes causal analysis. Appendix A covers the probability theory and linear algebra background. Basic Python fluency and comfort with pandas and scikit-learn are assumed.

Learning Outcomes

Sections

31.1 Structural Causal Models

The formal language of causation: DAGs, structural equations, the do-operator, and identification criteria. The four-tuple $\mathcal{M} = (V, U, F, P_U)$. Backdoor and front-door criteria for determining when causal effects can be estimated from observational data.

31.2 Causal Discovery Algorithms

Learning causal structure from data: constraint-based (PC, FCI), score-based (GES), and functional (LiNGAM) algorithms. Equivalence classes, faithfulness assumptions, and practical guidance for choosing an algorithm. Implementation with causal-learn.

31.3 Treatment Effect Estimation

ATE, ATT, and CATE estimation with modern semiparametric methods. Inverse propensity weighting, doubly robust estimation, double machine learning, and meta-learners. Sensitivity analysis with E-values. Tools: DoWhy and EconML.

31.4 Building a Causal Analysis Pipeline

Recipe: a heterogeneous treatment effect pipeline from raw observational data through causal discovery, effect estimation, and DoWhy refutation tests. Integration with the Discovery Workbench.

What's Next

Causal inference quantifies the strength of mechanisms, but every causal conclusion rests on assumptions that cannot be fully tested from data alone. Chapter 32: Bayesian Discovery and Uncertainty provides the probabilistic framework for encoding prior beliefs, propagating uncertainty through complex models, and making decisions under uncertainty. Where causal inference asks "what is the effect?", Bayesian methods ask "how confident should we be in that estimate?" Together, these chapters form the inferential core of Part III.

Bibliography

Foundational Papers

Pearl, J. (2009). Causality: Models, Reasoning, and Inference, 2nd edition. Cambridge University Press.

The definitive treatment of structural causal models, the do-calculus, and identification theory. The conceptual foundation for everything in this chapter.

Rubin, D. B. (1974). Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of Educational Psychology, 66(5), 688-701.

Introduced the potential outcomes framework (Rubin Causal Model) that formalizes treatment effects through counterfactual outcomes.

Spirtes, P., Glymour, C., & Scheines, R. (2000). Causation, Prediction, and Search, 2nd edition. MIT Press.

Introduced the PC algorithm and the formal theory of causal discovery from conditional independence tests.

Chernozhukov, V., et al. (2018). Double/debiased machine learning for treatment and structural parameters. The Econometrics Journal, 21(1), C1-C68.

The foundational paper on Double ML, showing how to use arbitrary ML models for nuisance estimation while preserving valid inference on causal parameters.

Books

Hernan, M. A. & Robins, J. M. (2020). Causal Inference: What If. Chapman & Hall/CRC.

An accessible, modern textbook on causal inference from epidemiology, freely available online. Excellent for building intuition about identification and estimation.

Huntington-Klein, N. (2021). The Effect: An Introduction to Research Design and Causality. Chapman & Hall/CRC.

A gentle, code-driven introduction to causal inference with clear explanations of identification strategies and practical examples.

Tools & Libraries

Sharma, A. & Kiciman, E. (2020). DoWhy: An end-to-end library for causal inference. arXiv:2011.04216.

Microsoft's causal inference library providing the four-step workflow (model, identify, estimate, refute) used throughout this chapter.

Battocchi, K., et al. (2019). EconML: A Python package for ML-based heterogeneous treatment effects estimation.

Microsoft Research library for heterogeneous treatment effect estimation, including DML, causal forests, and meta-learners.

Zheng, Y., et al. (2024). causal-learn: Causal discovery in Python. JMLR, 25(60), 1-8.

A comprehensive Python library for causal discovery algorithms including PC, FCI, GES, LiNGAM, and score-based methods.

Tutorials & Surveys

Glymour, C., Zhang, K., & Spirtes, P. (2019). Review of causal discovery methods based on graphical models. Frontiers in Genetics, 10, 524.

A thorough review of constraint-based and score-based causal discovery algorithms, their assumptions, and practical performance.

VanderWeele, T. J. & Ding, P. (2017). Sensitivity analysis in observational research: Introducing the E-value. Annals of Internal Medicine, 167(4), 268-274.

Introduced the E-value for sensitivity analysis, quantifying how strong unmeasured confounding would need to be to explain away an observed association.

Shimizu, S., Hoyer, P. O., Hyvarinen, A., & Kerminen, A. (2006). A linear non-Gaussian acyclic model for causal discovery. JMLR, 7, 2003-2030.

The LiNGAM paper establishing that non-Gaussianity enables unique identification of causal direction in linear models.

Kaddour, J., et al. (2022). Causal machine learning: A survey and open problems. arXiv:2206.15475.

A recent survey connecting causal inference with modern ML, covering representation learning, fairness, and reinforcement learning applications.