A personal study project exploring the foundations of causal inference — working through the theory and implementing key concepts in Python.
The focus is on understanding and comparing the two dominant frameworks:
- Pearl's causal hierarchy — DAGs, do-calculus, structural causal models (SCMs)
- Rubin's potential outcomes framework — counterfactuals, average treatment effects, propensity scores
These two traditions ask the same question differently. Understanding both — and where they agree and diverge — is the goal.
notebooks/
01_dags_and_do_calculus.ipynb # Pearl framework: DAGs, d-separation, interventions
02_potential_outcomes.ipynb # Rubin framework: ATE, ATT, propensity scores
03_frameworks_comparison.ipynb # Same problem, two frameworks — where do they meet?
04_backdoor_frontdoor_criteria.ipynb # Identification strategies
05_instrumental_variables.ipynb # IV estimation
notes/
pearl_vs_rubin.md # Conceptual comparison of the two frameworks
key_concepts.md # Running glossary of terms and notation
Pearl — Structural Causal Models
- Directed Acyclic Graphs (DAGs) and causal structure
- d-separation and conditional independence
- The do-operator: P(Y | do(X)) vs P(Y | X)
- Backdoor criterion, frontdoor criterion
- Counterfactuals from SCMs
Rubin — Potential Outcomes
- The fundamental problem of causal inference
- Average Treatment Effect (ATE) and Average Treatment Effect on the Treated (ATT)
- Propensity score matching and inverse probability weighting
- Ignorability and overlap assumptions
Where they meet Both frameworks ultimately formalize the same intuition — that causation is not correlation, and that identifying causal effects requires assumptions beyond the data. The structural and potential outcomes approaches are mathematically equivalent in many settings, but the language and tooling differ significantly.
DoWhy · CausalPy · NetworkX · NumPy · pandas · matplotlib · statsmodels
Coming from a background in statistical modelling and applied ML (survival analysis, regression pipelines, Bayesian inference), causal inference is the natural next step — moving from predicting outcomes to understanding what drives them. This matters especially in domains like pharma and media where interventions, not just predictions, are the end goal.
Work in progress — updated as I work through the material.