Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 13

Causal Models for Counterfactuals

Recommended resources

Hello again, and welcome to our penultimate lesson.

In our last lesson, we climbed to the second rung of the Ladder of Causation, formalizing the concept of intervention with the do-operator. We established the fundamental philosophical and practical distinction between seeing an association, , and doing an action, . This allowed us to understand how causal models can resolve statistical paradoxes and guide decision-making.

Today, we ascend to the final and most powerful level of the causal hierarchy: Counterfactuals. This lesson addresses the learning outcome: Explain how structural causal models (SCMs) provide a formal language for counterfactual queries (Level 3 of the Causation Ladder). We will explore the logic of "what if" questions about events that did not happen, moving from population-level effects to individual-level causal attribution. This is where we can truly begin to ask "why?" an event occurred for a specific individual in a specific context.

The Ladder of Causation
Judea Pearl's Ladder of Causation. We now move from "Doing" to the top rung: "Imagining," the realm of counterfactuals.

1. The Realm of Imagination: What are Counterfactuals?

Counterfactuals are statements about worlds that could have been. They are subjunctive conditionals that ask what would have happened had circumstances been different.

  • "If I had not taken the aspirin, would my headache still be gone?"
  • "Was it the drug that caused this patient's recovery, or would they have recovered anyway?"
  • In the context of your research, "If the couple had not entered therapy, would they have separated?"

These questions cannot be answered by observation or even by intervention alone. Answering them requires us to consider a world that conflicts with the one we observed (the patient did take the aspirin) and to somehow transport information from the factual world to this hypothetical one.

Causality: Counterfactuals | Part A

Let's begin with a clear introduction to counterfactual reasoning from the UCLA Automated Reasoning Group. This video explains the nature of counterfactual questions and why they require more refined information than the causal queries we've seen so far.

Please watch the first 4 minutes and 28 seconds of the video. Pay attention to how counterfactuals involve contemplating two conflicting scenarios (the real and the hypothetical) and require transferring information between them.


2. From Causal Graphs to Causal Models

In previous lessons, we used causal DAGs to represent our assumptions. However, to formally answer counterfactual questions, a DAG combined with a probability distribution is not enough. We need to specify the mechanisms of the system. This is the role of a Structural Causal Model (SCM).

Recall from our previous discussion that an SCM augments a DAG with a set of equations, specifying precisely how each variable is determined by its causes.

Causal Models - Stanford Encyclopedia of Philosophy

To formalize this, let's briefly review the definition of a Structural Causal Model. This section from the Stanford Encyclopedia of Philosophy introduces deterministic SCMs using a simple, intuitive example.

Please read section 3.1, 'Introduction to SEMs'. Focus on how the system (a gas grill) is described by a set of variables and a set of deterministic equations. Notice that the DAG is just a qualitative summary of these equations; the equations themselves contain the full causal story.

The crucial philosophical point is this: two different SCMs can imply the exact same observational data () and the exact same interventional effects (), yet yield completely different answers to counterfactual questions. This means that counterfactuals allow us to "see" a deeper layer of the causal reality.

Causality: Counterfactuals | Part A

The following segment from the UCLA video provides a brilliant demonstration of this principle. It presents two different populations ('responders', 'always takers', etc.) that look identical from the perspective of association (L1) and intervention (L2), but are fundamentally different at the counterfactual level (L3).

Please watch from 04:28 to 09:38, and then from 13:25 to 18:50. The first part introduces the idea of 'functional dependencies'. The second part shows the example where two different underlying models (different distributions of 'user types') result in the same observational and interventional data but diverge on counterfactuals. This is the core reason why SCMs are necessary for Level 3 reasoning.

This reveals a profound point about causal knowledge. The functional form of the SCM, particularly the nature of the unobserved background variables , represents the underlying causal mechanisms. Counterfactuals are queries about these mechanisms, which are often invisible to lower-level analysis.


3. The Algorithm for Imagination: Abduction, Action, Prediction

So, how does an SCM provide a formal language for counterfactuals? By enabling a three-step reasoning process:

  1. Abduction: Use the factual evidence from the real world to update your belief about the unobserved background variables (). This is a classic Bayesian step: given the observed evidence, what is the posterior probability distribution over the latent "type" of the individual unit?
  2. Action: Perform a "surgical" intervention on the model to create the hypothetical world. This is identical to the do-operator: replace the structural equation for the antecedent variable.
  3. Prediction: Use the modified model and the updated belief about from Step 1 to calculate the probability of the consequent in the hypothetical world.

Causal Models - Stanford Encyclopedia of Philosophy

Let's anchor this three-step process with a formal definition from the Stanford Encyclopedia of Philosophy.

Please read the first four paragraphs of section 4.10, 'Counterfactuals'. This section explicitly lays out the Abduction-Action-Prediction algorithm. Notice the critical difference from a simple intervention: the abduction step (updating on evidence) happens before the action step.

Now, let's see this algorithm in action.

14.2 - Computing Counterfactuals

Brady Neal's video on causal inference provides a crystal-clear, step-by-step computation of a counterfactual query.

Please watch from 01:29 to 10:40. The first part ('invertible' case) walks through an example where the evidence allows you to determine the background variable U with certainty. The second part ('non-invertible' case) is even more interesting for a statistician: it shows how to use Bayes' rule to get a posterior probability distribution over U, which then results in a probability distribution for the counterfactual outcome. This is Bayesian belief updating in its purest form, applied to causal reasoning.

As you can see, the SCM provides the formal structure needed to execute this three-step process. The exogenous variables represent the unit-specific characteristics that determine how an individual responds to a cause. Abduction is the process of inferring those characteristics from observed behavior.


4. Why Counterfactuals Matter: Digging Deeper

The ability to compute counterfactuals is not just an academic exercise. It provides a more refined understanding of causality that can be essential for explanation, credit assignment, and fairness.

Consider the example from the UCLA video where two models had the same average causal effect but different underlying mechanisms. Interventional queries () could not tell them apart. But counterfactual queries could.

Causality: Counterfactuals | Part A

Let's return to the UCLA video to see the powerful implications of this deeper level of analysis.

Please watch from 23:42 to 29:10, and then from 35:36 to 39:45 and 41:47 to 45:03. The first segment introduces a prototypical counterfactual query, the 'probability of necessity'. The second and third segments powerfully illustrate how counterfactual queries can 'dig deeper' into the causal mechanisms, revealing distinctions that are invisible to associational or interventional analysis and critical for correct decision-making.

These examples demonstrate that counterfactuals are the key to moving from "What is the average effect of X on Y in the population?" to "For this specific individual who experienced outcome Y after being exposed to X, was it X that caused Y?" This is the essence of explanation and attribution.

The twin network model (mentioned in the UCLA video around the 31-minute mark) is a useful mental model for this. Imagine the factual world and the counterfactual world as two parallel universes. They are identical except for the intervention. The background variables are shared between them, acting as the bridge that carries information from the facts we observed to the hypothetical world we are reasoning about.


Conclusion

Today we reached the summit of the Ladder of Causation. We have seen that SCMs provide the necessary formal language to answer counterfactual questions, something that associational and interventional models alone cannot do.

Key Takeaways:

  • Counterfactuals (L3) are "what if" questions about past events, involving reasoning about scenarios that conflict with reality (e.g., "what if the patient hadn't taken the drug, given that they did?").
  • SCMs are Essential: Answering counterfactuals requires knowledge of the underlying causal mechanisms, which are formalized by the equations and background variables () in a Structural Causal Model. Lower-level information (from L1 and L2) underdetermines counterfactuals.
  • The Three-Step Algorithm: Counterfactuals are computed via Abduction (updating beliefs about given evidence), Action (modifying the SCM), and Prediction (calculating the outcome in the modified model).
  • A Deeper Understanding: Counterfactual reasoning allows for a more refined, unit-level analysis of causation, enabling explanations and attributions that are impossible with interventionist or associational queries alone.

This lesson completes our journey up the causal hierarchy. We've seen how a fully specified SCM allows us to answer questions at all three levels. In our next lesson, we will address a crucial question: What if we don't know the SCM? We will explore how Bayesian methods can be used to learn about the structure of the causal model itself when we are uncertain.