liveBook · Manning

Counterfactual notation

As explained in Causal AI

Counterfactual notation represents the value or distribution of a variable under a hypothetical intervention or condition.

Suppose an online game team asks whether setting side-quest engagement to “high” would change in-game purchases. Looking only at players whose engagement is already high answers a different question. Counterfactual notation marks the hypothetical intervention with a subscript, keeping it distinct from an observed condition. section 7.3.1

Let I denote in-game purchases and E denote engagement:

  • P(I | E="high") describes purchases among players observed to have high engagement. section 7.3.1
  • P(I_{E="high"}) describes purchases if engagement were set to high by intervention. I_{E="high"} is the version of I under that intervention; the equivalent do-notation is P(I | do(E="high")). section 7.3.1

The subscript describes an ideal intervention: set the target variable to a value and sever the influence of its usual causes. In a causal DAG, this cuts incoming edges; in a structural causal model, it replaces the target variable’s assignment function. The notation states the question, not whether available data can answer it. section 8.2.3 section 1.5.3

A hypothetical conditioned on facts

P(I_{E="high"} > 50 | E="low", I <= 50) asks about spending above $50 if engagement were set to high, among players who actually had low engagement and spent at most $50. The subscript gives the hypothetical condition; the terms after the bar select the factual group. Their disagreement is what makes this a counterfactual question. section 8.2.4

The same notation supports causal-effect comparisons. For images of a digit 4 at a given thickness, an expected image under one writer-type intervention can be subtracted pixel by pixel from the expected image under another. Age-related confounding means those expectations cannot simply be read from an observational comparison; a causal model is needed to connect them to estimable quantities. section 1.5.3

Table 7.11 Examples of do-notation and counterfactual notation
Literal
Do-notation
Counterfactual notation
The probability distribution of In-Game Purchases across all players
P( I  )
P( I  )
The probability distribution of In-Game Purchases for players with “high” engagement
P( I  | E=“high”)
P( I  | E=“high”)
The probability distribution of In-Game Purchases when a player’s engagement level is set (by intervention) to “high”
P( I  |do( E= “high”))
P( I   E = “high”)
The joint probability distribution of In-Game Purchases and Guild Membership when engagement is set to “high”
P( I, G|do( E=“high”))
P( I   E=“high”, G E=“high”)
The probability distribution of In-Game Purchases when engagement is set to “high” and membership is set to “nonmember”
P( I  |do( E  =“high”, G=“nonmember”))
P( I   E = “high”, G =“nonmember”)
The probability distribution of In-Game Purchases for guild members when engagement is set to “high”
P( I  |do( E  =“high”), G  =  “member”)
P( I E   = “high”| G  =  “member”)

The notation table compares observed conditions, single and multiple interventions, and their do-notation counterparts. section 7.3.1

How Causal AI covers it

How deep it goes
Defines intervention subscripts, relates them to do-notation, and extends them to fact-conditioned counterfactuals and model operations.
Examples
Uses game purchases under changed engagement, fact-conditioned spending questions, and pixel-level image comparisons by writer type.
What it assumes
Introduces intervention subscripts and reviews ideal interventions while using variables and conditional probabilities to express queries.
What you can do after
Practice/perform it by writing distinct expressions for observed groups, intervened outcomes, and hypothetical outcomes conditioned on facts.
How it connects
Connects to conditional probability, do-notation, ideal interventions, causal DAGs, structural causal models, and conditional average treatment effects.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal AI. The section links point to the parts of the book it draws on.