Inferensys

Glossary

Do-Calculus

A set of three inference rules developed by Judea Pearl for transforming expressions involving interventions into estimable statistical quantities from observational data.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
Causal Inference

What is Do-Calculus?

A formal axiomatic system for deriving causal effects from observational data by transforming interventional expressions into estimable statistical quantities.

Do-calculus is a set of three inference rules developed by Judea Pearl that transforms expressions involving the do-operator into standard conditional probabilities estimable from observational data. The rules—insertion/deletion of observations, action/observation exchange, and insertion/deletion of actions—operate on a causal graph to determine whether a causal effect is identifiable without running a randomized experiment.

The calculus systematically exploits conditional independencies encoded in a directed acyclic graph to eliminate the do-operator from a query. When a causal effect is identifiable, do-calculus provides the exact formula for computing it from non-experimental data, forming the mathematical backbone of counterfactual inference and enabling rigorous policy evaluation from passive observation alone.

CAUSAL INFERENCE RULES

Core Properties of Do-Calculus

The three axiomatic rules that enable the transformation of interventional expressions into estimable observational quantities, even in the presence of unobserved confounders.

01

Rule 1: Insertion/Deletion of Observations

Establishes when an observed variable can be ignored for an interventional query.

Mechanism: If a variable W is d-separated from the outcome Y by a set Z in a graph where incoming edges to the intervened variable X are removed, then:

P(y | do(x), z, w) = P(y | do(x), z)

  • Key Insight: This rule allows the removal of irrelevant covariates, simplifying the estimand.
  • Graphical Criterion: Tested using d-separation in the mutilated graph G_overline{X}.
  • Practical Use: Reduces data requirements by identifying non-confounding variables that can be safely excluded from adjustment sets.
02

Rule 2: Action/Observation Exchange

Provides the conditions under which an intervention can be replaced by conditioning on the same variable.

Mechanism: If a set Z blocks all back-door paths from X to Y after removing the outgoing edges of X, then:

P(y | do(x), do(z), w) = P(y | do(x), z, w)

  • Key Insight: This is the formal justification for the back-door criterion. It converts a hard intervention into passive observation.
  • Graphical Criterion: Tested in the graph G_overline{X}underline{Z}.
  • Practical Use: Enables the estimation of causal effects from observational data by identifying valid covariate adjustment sets.
03

Rule 3: Insertion/Deletion of Actions

Determines when an intervention on a variable can be entirely removed from the expression.

Mechanism: If Z(W) denotes the set of Z-nodes that are not ancestors of W in the graph G_overline{X}, then:

P(y | do(x), do(z), w) = P(y | do(x), w)

  • Key Insight: An intervention on Z is irrelevant if it only affects variables that are not ancestors of the outcome Y in the relevant subgraph.
  • Graphical Criterion: Tested by deleting non-ancestor interventions in G_overline{X,overline{Z(W)}}.
  • Practical Use: Simplifies complex nested counterfactual expressions by stripping out redundant or causally irrelevant interventions.
04

Completeness of the Calculus

A foundational theorem proving the three rules are sufficient for identifying any identifiable causal effect.

Result: Shpitser and Pearl (2006) proved that if a causal effect is identifiable from a given causal graph and observational data, repeated application of the three rules of do-calculus will eventually transform the interventional query into a do-free expression.

  • Key Insight: The calculus is not just sound; it is complete. There is no identifiable query that requires a fourth rule.
  • Algorithmic Form: The ID algorithm systematically applies these rules to derive estimands automatically.
  • Practical Use: Guarantees that automated causal discovery systems can, in principle, solve any solvable identification problem.
05

Mutilated Graph Framework

The visual and mathematical substrate upon which the rules of do-calculus operate.

Definition: A mutilated graph is a modified version of the original causal DAG where all incoming edges to an intervened variable are severed.

  • Notation: G_overline{X} denotes a graph with incoming edges to X removed. G_underline{Z} denotes a graph with outgoing edges from Z removed.
  • Key Insight: The rules are syntactic operations on these modified graphs. Rule 1 uses G_overline{X}, Rule 2 uses G_overline{X}underline{Z}, and Rule 3 uses G_overline{X,overline{Z(W)}}.
  • Practical Use: Provides a rigorous, visual test for the applicability of each rule, moving beyond algebraic manipulation to graphical criteria.
06

Relation to Counterfactual Inference

Do-calculus bridges the gap between population-level interventions and individual-level counterfactuals.

Connection: While do-calculus directly computes interventional distributions P(y | do(x)) at the population level, these quantities form the necessary components for computing counterfactual probabilities under a Structural Causal Model (SCM).

  • Three-Step Process: Counterfactual inference requires abduction (updating noise priors), action (applying do-operator), and prediction. Do-calculus solves the action step.
  • Key Insight: Without do-calculus to reduce interventional expressions, individual-level counterfactual queries like 'What would have happened if I had taken the treatment?' cannot be estimated from data.
  • Practical Use: Essential for algorithmic recourse and fairness systems that must answer 'what if' questions for specific individuals.
DO-CALCULUS

Frequently Asked Questions

Explore the foundational rules of causal inference that enable the estimation of interventional effects from purely observational data.

Do-Calculus is a set of three inference rules developed by Judea Pearl that transforms expressions involving the do-operator into estimable statistical quantities from observational data. The do(X=x) operator represents a surgical intervention that forces a variable to take a specific value, breaking its natural causal dependencies. Do-calculus works by systematically applying graph-theoretic conditions—specifically d-separation in manipulated causal graphs—to either add or delete conditioning variables, or to swap an intervention for a passive observation. If a causal effect is identifiable, repeated application of these three rules will reduce the interventional query to a standard probabilistic expression free of the do-operator, allowing it to be estimated without running a randomized controlled trial.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.