Foundations to Frontier
Tests
A. Mathematical Foundations › A5 Statistics › Causal inference

The do-Calculus and the Back-Door and Front-Door Criteria

Seeing is not doing: P(Y | X = x) describes units that happened to have X = x, while P(Y | do(X = x)) describes what happens if we force X = x. With a causal graph, you can decide whether the second is computable from observational data, and how. You will learn interventions as graph surgery, the back-door criterion and adjustment formula, the front-door criterion for hidden confounders, Pearl's three rules of do-calculus, and apply them to autonomy logs.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Watching vs pushing

Watching: rovers that use autonomy mode succeed less often. Pushing: if we switch on autonomy mode for a rover, does it succeed more or less?

These have different answers. Operators turn autonomy on mostly on hard terrain, so watching mixes the effect of the mode with the effect of the terrain. Pushing (an intervention, written do⁡(X=1)\operatorname{do}(X = 1)) removes the operator’s choice. A causal graph tells us when we can compute the pushing answer from watching data alone.

Seeing vs doing: identify P(Y | do(X)) from observational data
ZXYobservational P(Y|X=1) − P(Y|X=0): -0.090back-door: Σ_z P(y|x,z)P(z): +0.150true P(Y|do(1)) − P(Y|do(0)): +0.150
Seeing X = 1 also tells you about Z, which affects Y, so the observational contrast mixes in the back-door path X ← Z → Y. Adjusting for Z (averaging over P(z), not P(z|x)) reproduces the interventional answer exactly. Try making the Z → Y effect negative and strong: the observational contrast flips sign.
Why engineers care

You often can’t run a randomized experiment on a spacecraft or a deployed robot fleet. The back-door and front-door criteria tell you exactly which logged variables let you compute what an intervention would do, and when no amount of logged data can.

📝 Quick check (Level 0)
0/3 answered
  1. 1. do(X = 1) means…
  2. 2. Can P(Y | X = 1) differ from P(Y | do(X = 1))?
  3. 3. A causal graph helps decide…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Intervention as graph surgery

do⁡(X=x)\operatorname{do}(X = x) deletes every arrow into XX and sets it to xx. The rest of the model is unchanged. By the truncated factorization,

p(v∣do⁡(x))=∏i: Vi≠Xp(vi∣pa⁡i)∣X=xp(v\mid\operatorname{do}(x)) = \prod_{i:\,V_i\ne X}p(v_i\mid\operatorname{pa}_i)\Big|_{X = x}

The back-door criterion

A set ZZ satisfies the back-door criterion for (X,Y)(X, Y) if

  1. no node in ZZ is a descendant of XX, and
  2. ZZ blocks every path between XX and YY that starts with an arrow into XX.

Then

P(y∣do⁡(x))=∑zP(y∣x,z)P(z)P(y\mid\operatorname{do}(x)) = \sum_zP(y\mid x, z)P(z)

This is the adjustment formula from A5.3-1, now with a rule for choosing ZZ.

📝 Quick check (Level 1)
0/3 answered
  1. 1. do(X = x) removes…
  2. 2. A back-door path starts with…
  3. 3. The back-door set may include descendants of X?

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

The front-door criterion

Sometimes the confounder UU is unobserved, but XX affects YY only through a mediator MM. If

  1. MM intercepts all directed paths from XX to YY,
  2. there’s no unblocked back-door path from XX to MM, and
  3. all back-door paths from MM to YY are blocked by XX,

then

P(y∣do⁡(x))=∑mP(m∣x)∑x′P(y∣m,x′)P(x′)P(y\mid\operatorname{do}(x)) = \sum_mP(m\mid x)\sum_{x'}P(y\mid m, x')P(x')

The two pieces work separately. The effect of XX on MM is unconfounded. The effect of MM on YY is identified by back-door adjusting for XX. Chaining them gives the answer. An example is the effect of a perception upgrade (X) on mission success (Y), through detection rate (M), with unobserved site difficulty affecting both the choice to deploy and the outcome.

What isn’t identifiable

In the “bow” graph X→YX\to Y plus a hidden U→X,U→YU\to X, U\to Y, with no mediator or instrument, P(y∣do⁡(x))P(y\mid\operatorname{do}(x)) is not identified. Different models fit the same observational data but give different interventional answers. You then need experiments, instruments (A5.3-6) or bounds (Manski, 1990).

🐍 Exercise 1: back-door adjustment on autonomy logs
Simulate terrain → mode → success with terrain → success. Show the naive comparison gets the sign wrong and that back-door adjustment matches a simulated intervention.
📝 Quick check (Level 2)
0/3 answered
  1. 1. The front-door criterion is useful when…
  2. 2. In the bow graph with hidden U, P(y|do(x)) is…
  3. 3. In the front-door formula, the inner sum adjusts for…

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

Deriving back-door adjustment

In the mutilated graph GXˉG_{\bar X}, ZZ has the same distribution as before (none of its members are descendants of XX). Since ZZ blocks every back-door path, YY’s mechanism given (x,z)(x, z) is the same as observed: P(y∣do⁡(x),z)=P(y∣x,z)P(y\mid\operatorname{do}(x), z) = P(y\mid x, z). Average over P(z)P(z). ∎

Pearl’s do-calculus (1995)

For disjoint sets X,Y,Z,WX, Y, Z, W, where GXˉG_{\bar X} removes arrows into XX and GZ‾G_{\underline Z} removes arrows out of ZZ:

  1. Insert or delete observations: P(y∣do⁡(x),z,w)=P(y∣do⁡(x),w)P(y\mid\operatorname{do}(x), z, w) = P(y\mid\operatorname{do}(x), w) if Y⊥Z∣X,WY\perp Z\mid X, W in GXˉG_{\bar X}.
  2. Action/observation exchange: P(y∣do⁡(x),do⁡(z),w)=P(y∣do⁡(x),z,w)P(y\mid\operatorname{do}(x), \operatorname{do}(z), w) = P(y\mid\operatorname{do}(x), z, w) if Y⊥Z∣X,WY\perp Z\mid X, W in GXˉZ‾G_{\bar X\underline Z}.
  3. Insert or delete actions: P(y∣do⁡(x),do⁡(z),w)=P(y∣do⁡(x),w)P(y\mid\operatorname{do}(x), \operatorname{do}(z), w) = P(y\mid\operatorname{do}(x), w) if Y⊥Z∣X,WY\perp Z\mid X, W in GXˉZ(W)‾G_{\bar X\overline{Z(W)}}, where Z(W)Z(W) are the ZZ-nodes that aren’t ancestors of WW.

The rules are complete: an effect is identifiable iff these rules can remove every do (Shpitser and Pearl, 2006; Huang and Valtorta, 2006). The ID algorithm decides this automatically.

Front-door derivation sketch

P(m∣do⁡(x))=P(m∣x)P(m\mid\operatorname{do}(x)) = P(m\mid x) (rule 2: no back door from X to M). P(y∣do⁡(m))=∑x′P(y∣m,x′)P(x′)P(y\mid\operatorname{do}(m)) = \sum_{x'}P(y\mid m, x')P(x') (back-door with X). Then P(y∣do⁡(x))=∑mP(m∣do⁡(x))P(y∣do⁡(m))P(y\mid\operatorname{do}(x)) = \sum_mP(m\mid\operatorname{do}(x))P(y\mid\operatorname{do}(m)), because M fully mediates the effect. ∎

Exercise 3.1: Is {W} alone a back-door set in Z → X, Z → Y, W → X, W → Z, X → Y?

No: X←Z→YX\leftarrow Z\to Y stays open. {Z}\{Z\} works: it blocks X←Z→YX\leftarrow Z\to Y and X←W→Z→YX\leftarrow W\to Z\to Y. So does {W,Z}\{W, Z\}.

📝 Quick check (Level 3)
0/3 answered
  1. 1. The do-calculus has how many rules?
  2. 2. The do-calculus is complete, meaning…
  3. 3. Rule 2 lets you replace do(z) with conditioning on z when…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

A perception upgrade with hidden site difficulty

Operators chose where to deploy an upgraded detector (X) based on site difficulty, which they never logged (U). Difficulty also affects mission success (Y). But the upgrade affects success only through the detection rate (M), and M is logged. The front-door formula recovers the causal effect from logs alone. The naive comparison overstates it badly. When those assumptions fail (for example, if the upgrade also changes speed), the estimate is biased. Sensitivity analysis and a small randomized check are the honest next steps.

🐍 Exercise 2 (research): front-door identification
Simulate a hidden confounder U, treatment X, mediator M and outcome Y. Show that the front-door formula on (X, M, Y) alone matches the true interventional effect while the naive contrast doesn't.

Interventional reasoning in AI, robotics and aerospace

  • Model-based RL and planning are interventional: a world model must predict p(s′∣s,do⁡(a))p(s'\mid s, \operatorname{do}(a)), not the logged p(s′∣s,a)p(s'\mid s, a) of a confounded behaviour policy (Bareinboim, Forney and Pearl, 2015, on causal bandits; Lu et al., 2018).
  • Transportability: carrying causal conclusions from a test range to a new site via selection diagrams (Pearl and Bareinboim, 2011).
  • Root-cause analysis in microservices, plants and spacecraft telemetry uses interventional queries on causal graphs (Budhathoki et al., 2022).
  • Explainable AI: interventional feature attributions (Janzing, Minorics and Blöbaum, 2020) vs observational Shapley values.

References

  1. J. Pearl (1995). “Causal diagrams for empirical research.” Biometrika, 82(4).
  2. J. Pearl (2009). Causality, 2nd ed. Cambridge University Press.
  3. I. Shpitser, J. Pearl (2006). “Identification of joint interventional distributions in recursive semi-Markovian causal models.” AAAI.
  4. Y. Huang, M. Valtorta (2006). “Pearl’s calculus of intervention is complete.” UAI.
  5. C. Manski (1990). “Nonparametric bounds on treatment effects.” American Economic Review, 80(2).
  6. J. Pearl, E. Bareinboim (2011). “Transportability of causal and statistical relations.” AAAI.
  7. E. Bareinboim, A. Forney, J. Pearl (2015). “Bandits with unobserved confounders: a causal approach.” NeurIPS.
  8. C. Lu, B. Schölkopf, J. M. Hernández-Lobato (2018). “Deconfounding reinforcement learning in observational settings.” arXiv:1812.10576.
  9. K. Budhathoki, L. Minorics, P. Blöbaum, D. Janzing (2022). “Causal structure-based root cause analysis of outliers.” ICML.
  10. D. Janzing, L. Minorics, P. Blöbaum (2020). “Feature relevance quantification in explainable AI: a causal problem.” AISTATS.