What Counterfactuals Can Be Tested

Ilya Shpitser, Judea Pearl

Abstract

This article summarizes the landmark 2007 paper by Ilya Shpitser and Judea Pearl, which provides a complete mathematical characterization and algorithmic framework for determining the testability of counterfactual queries from experimental data. By introducing the Counterfactual Graph and the ID and IDC algorithms, the authors prove that counterfactuals are rigorous, testable quantities rather than mere metaphysical statements.

Introduction

In the field of causal inference, a long-standing question has been: when can we actually "test" a counterfactual claim using experimental data? A counterfactual query, such as "Would the patient have survived if they hadn't taken the treatment?", involves imagining a hypothetical world that contradicts observed reality. This paper, presented at UAI 2007, provides the definitive answer to this question.

The Hierarchy of Causal Inference

Causal inference is often described as a hierarchy of three levels:

  1. Observation: Seeing patterns in data ($P(Y|X)$).
  2. Intervention: Doing an action and observing the result ($P(Y|do(x))$).
  3. Counterfactuals: Imagining what would have happened in a hypothetical world ($x$) given specific evidence ($e$) from the actual world ($P(Y_x|e)$).

The "Fundamental Problem of Causal Inference" is that we cannot observe both the actual and hypothetical worlds for the same individual. Shpitser and Pearl refute the idea that this makes counterfactuals unscientific by showing that if a causal diagram represents our scientific knowledge, we can often bridge these worlds using data from randomized controlled trials.

The Counterfactual Graph

The authors' primary technical contribution is the Counterfactual Graph. This structure generalizes the "twin network" model to handle any number of hypothetical worlds simultaneously. Each world shares the same background "noise" or exogenous variables ($U$), which represent the innate, persistent characteristics of individuals.

Figure 1: Construction of a counterfactual graph. (a) A standard causal diagram. (b) The corresponding counterfactual graph for a query involving multiple hypothetical worlds. (c) A simplified representation used in the identification process.

The make-cg algorithm takes a causal diagram and a counterfactual query to construct a specialized graph. It merges nodes across different hypothetical worlds if they are functionally identical—meaning they share the same parents and mechanisms. This allows researchers to use standard graphical tools like d-separation to identify independencies across parallel worlds.

Algorithmic Identification: ID and IDC

Building on previous work for identifying simple causal effects, the authors developed two recursive algorithms:

  • ID*: Handles unconditional counterfactual queries.
  • IDC*: Handles conditional counterfactual queries.

These algorithms attempt to decompose a complex counterfactual query into pieces that correspond to standard experimental distributions. Crucially, the authors prove these algorithms are complete. If the algorithm determines a counterfactual is not identifiable, it is mathematically impossible to compute it without additional assumptions.

Completeness and the "w-graph"

The paper shifts the debate from the metaphysics of counterfactuals to their structural testability. The authors identify a specific graphical pattern known as the "w-graph" that acts as a fundamental barrier to identification. Theorem 5 provides a concise criterion: a counterfactual is identifiable if and only if the actions and observations do not set variables in the same "C-component" (a group connected by unobserved confounding) to conflicting values that block information flow.

Conclusion

Shpitser and Pearl's work provides a practical and theoretical toolkit for causal reasoning. While focused on non-parametric Directed Acyclic Graphs (DAGs), it establishes the boundaries of what can be known from data. For non-identifiable cases, the next step is often to calculate "bounds"—the range of possible values—rather than a single point estimate. This paper remains a cornerstone of modern causal inference, proving that counterfactuals are a legitimate subject of scientific inquiry.

Summary updated

BibTeX
@misc{shpitser2012what,
  author = {Ilya Shpitser and Judea Pearl},
  title = {{What Counterfactuals Can Be Tested}},
  year = {2012},
  eprint = {1206.5294},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1206.5294},
}
Figure