L4-01 · Structural causal models
Replace a structural equation to calculate an intervention and compare it with observation.
Learn¶
A structural causal model gives a mechanism for each modeled variable. A mechanism maps its direct causes and background inputs to its value. Background inputs represent factors outside the modeled system. Their joint distribution is part of the model and can include dependence.
An ideal intervention replaces one mechanism with a fixed assignment. Write do(X=x) when an external action sets X to x. Keep the other mechanisms and background distribution unchanged. This modular replacement defines the intervention within the model. It differs from selecting records where X happened to equal x.
Prediction asks what outcomes accompany observed inputs. Causal inference asks what outcomes follow a specified change to a mechanism. A model can answer both questions differently. Its causal answers depend on the mechanism assumptions, which cannot generally be validated from predictive accuracy alone.
Practice¶
Solution
The observed outcomes are five when X is one and zero when X is zero. The observed contrast is five. Intervened means are four and one, so the causal contrast is three.
Check your understanding¶
What does an ideal do(X=x) operation replace?
A. Only the outcome data
B. The mechanism that normally assigns X
C. Every mechanism in the model
Show the answer
B. The mechanism that normally assigns X
The intervention replaces the assignment mechanism for X. Other mechanisms stay fixed under the stated modular intervention assumption.
Sources¶
This lesson draws on Pearl, 2009Peters et al., 2017.
Next: L4-02 · DAGs and d-separation
- Pearl, J. (2009). Causal inference in statistics: An overview. Statistics Surveys, 3(none), 96–146. 10.1214/09-ss057
- Peters, J., Janzing, D., & Scholkopf, B. (2017). Elements of Causal Inference. https://mitpress.mit.edu/9780262037310/elements-of-causal-inference/
- Bareinboim, E. (2025). Causal Artificial Intelligence: A Roadmap for Building Causally Intelligent Systems. https://causalai-book.net/