Introduction¶
The tools introduced in the Bayesian Modelling chapter give us a powerful framework for reasoning under uncertainty: given observations, we can update our beliefs about latent variables and model parameters, make predictions, and take decisions that minimize expected loss. Yet there is a class of questions that standard probabilistic inference cannot answer, no matter how much data we collect.
Consider a dealer quoting a bond instrument. The dealer observes that, historically, tighter spreads correlate with higher hit rates. Should she tighten her spread? The correlation is real, but it does not tell us what will happen if she intervenes and changes her spread — because the historical spread was itself set by a policy that depended on bond characteristics, client type, and market conditions. The clients who received tight spreads were not a random sample: they may have been clients with better credit ratings, larger notional requests, or bonds in high demand. A purely statistical model trained on this data will confound the effect of the spread with the effect of all these background variables.
This is the domain of causal inference: the study of what happens when we do something, rather than merely observe it. The distinction is fundamental. A probabilistic model can answer observational questions of the form “given that I see spread , what is the probability of a hit?” but not interventional questions of the form “if I set spread , what would the probability of a hit be?” The difference between these two quantities is the confounding effect of the variables that determined the historical spread.
Causal inference, formalized by Judea Pearl Pearl et al., 2016, provides a principled framework to answer interventional and counterfactual questions using a combination of graphical models and a symbolic calculus. The framework rests on three key components: (1) a causal graph (a directed acyclic graph, or DAG) that encodes qualitative assumptions about which variables causally influence which others; (2) the do-operator, which formally distinguishes interventions from observations; and (3) identification theorems (notably the back-door criterion) that tell us when, and how, interventional quantities can be estimated from observational data.
This chapter introduces these ideas in a self-contained way. Readers familiar with Bayesian Networks from the Bayesian Modelling chapter will recognize the graphical language; the new content is the causal semantics layered on top. The chapter is organized as follows. We begin with Pearl’s ladder of causation, which hierarchically orders the types of questions that probabilistic and causal models can answer. We then develop the formalism of structural causal models and the do-operator, including the back-door criterion and the adjustment formula. We close with counterfactual reasoning, which occupies the highest rung of the ladder and enables reasoning about hypothetical scenarios.
The ideas developed here are applied directly in the Modelling RfQs in Dealer to Client Markets chapter, where the RfQ pricing problem is formulated as a causal intervention and the back-door criterion is used to identify a valid conditioning set for the hit probability model.
The three ladders of causation¶
Pearl’s central organizing principle is the ladder of causation Pearl et al., 2016, a three-rung hierarchy that classifies queries by the type of information they require:
| Rung | Activity | Query form | Example |
|---|---|---|---|
| 1 | Seeing (Association) | What is the hit rate when spread is ? | |
| 2 | Doing (Intervention) | What hit rate would result if we set spread to ? | |
| 3 | Imagining (Counterfactual) | Would this RfQ have been a hit if we had quoted instead of ? |
Rung 1 — Association. Standard probability and statistics live on this rung. Given a dataset, we can estimate conditional probabilities by grouping observations and fitting a model. The key limitation is that this quantity reflects the distribution of the population that happened to have , not the distribution that would result from forcing to equal . In the bond market, the population of RfQs where the dealer quoted a tight spread is not representative of all RfQs: it was selected by the dealer’s pricing policy, which in turn depended on bond and client characteristics.
Rung 2 — Intervention. The second rung asks what would happen if we surgically set for every unit in the population, overriding whatever value would naturally have taken. This is written . In a randomized controlled experiment, we directly observe this quantity by randomly assigning regardless of background variables. Without randomization, answering second-rung queries requires a causal model — a representation of the data-generating mechanism that lets us reason about hypothetical interventions.
Rung 3 — Counterfactuals. The third rung goes further: it asks what would have happened to a specific individual unit had a different value been assigned to , given that we know what actually happened to that unit. This is written , the probability that would take a given value if had been , for a unit that actually had . Counterfactuals are fundamental to attribution and responsibility: “would this client have hit if we had quoted 5 bps tighter?” They require the full machinery of structural causal models.
A crucial insight is that Rung 2 queries cannot in general be answered from Rung 1 data without additional assumptions, and Rung 3 queries cannot in general be answered from Rung 1 or 2 data alone. The ladder is strict: each rung requires strictly more information than the one below it.
Interventions and the Do-calculus¶
Structural Causal Models and DAGs¶
The formal language of causal inference is the Structural Causal Model (SCM). An SCM consists of:
A set of endogenous (modelled) variables .
A set of exogenous (background) variables , assumed mutually independent.
A set of structural equations for each , where are the parents of : the variables that directly causally determine .
Each SCM induces a directed acyclic graph (DAG) , where each variable is a node and a directed edge exists whenever . The acyclicity condition rules out causal loops; the graph encodes the qualitative causal structure of the model.
The probabilistic Bayesian Network framework introduced in Bayesian Modelling uses the same DAG language and the same conditional independence reading via d-separation. The critical addition in the SCM framework is causal semantics: arrows represent mechanisms, not mere conditional dependences. This distinction only becomes visible when we intervene.
Example. Consider three variables: bond volatility , the dealer’s spread , and the RfQ outcome (hit/miss) . In the observational distribution, and are correlated because the dealer uses to set : high-volatility bonds attract wider spreads. If we simply condition on in a regression of on , we confound the true effect of on with the selection effect induced by . The DAG , , makes this confounding explicit: is a common cause of both and , opening a spurious back-door path .
The Do-Operator¶
An intervention on an SCM is implemented by replacing the structural equation for with a constant: , removing all arrows into in the DAG. All other structural equations remain unchanged. The resulting modified SCM defines the interventional distribution .
This mutilation of the graph is the formal counterpart of a randomized experiment: by setting externally, we sever the causal link from ’s natural parents to , eliminating confounding through those parents. The do-operator thus replaces an observational quantity with a causal one.
In the bond RfQ example, is the probability of a hit if the dealer were to set spread by a policy that ignores , client features, and all other variables that would normally influence . This is the interventional quantity of interest for optimal pricing.
Identifying Causal Effects: the Back-Door Criterion¶
The central identification problem is: when can we compute from purely observational data, and how? The adjustment formula gives the answer when a valid conditioning set can be found:
where the sum (or integral) is over all values of the conditioning set . The left-hand side is a causal quantity; the right-hand side involves only standard conditional probabilities, which can be estimated from data. The key is finding a that makes this identity valid.
Definition (Back-door criterion). A set of variables satisfies the back-door criterion relative to an ordered pair in DAG if:
No variable in is a descendant of .
blocks every path between and that contains an arrow into (a back-door path).
A back-door path is any path from to that begins with an arrow pointing into : such paths represent confounding by common causes of and . Condition 2 requires all such paths to be blocked by , where “blocked” is defined by the d-separation rules from Bayesian Modelling: a path is blocked by if it contains a chain or a fork with , or a collider with (and no descendant of in ).
When satisfies the back-door criterion, the adjustment formula holds and we can estimate the causal effect from observational data by:
Conditioning on when fitting the outcome model .
Marginalizing over the distribution of in the population.
In practice, we prefer the smallest valid to minimize variance. Among valid sets, the analyst should prefer variables that are more easily measured and least collinear with .
Example (RfQ pricing, continued). In the causal DAG for the RfQ process (see Modelling RfQs in Dealer to Client Markets), the back-door paths from dealer spread to hit probability run through bond features , client features , RfQ features , and volatility — all of which influence both (through the dealer’s pricing policy) and (through client reservation price and competitor spreads). The minimal valid conditioning set is , giving:
The do-operator on the left is replaced by a standard conditional probability on the right, which can be estimated by any supervised learning method trained on the correct feature set.
Do-Calculus¶
Pearl’s do-calculus is a complete set of three symbolic inference rules for transforming expressions involving the do-operator into estimable observational quantities. Each rule applies under specific d-separation conditions in modified versions of the graph :
: graph with all arrows into removed.
: graph with all arrows out of removed.
Rule 1 (Insertion/deletion of observations):
Rule 2 (Action/observation exchange):
Rule 3 (Insertion/deletion of actions):
where denotes the set of -nodes that are not ancestors of any -node in . These rules are complete: any causal quantity that is expressible in observational data can be derived by a finite sequence of these rules applied to the observational distribution. The back-door adjustment formula is a direct consequence of Rule 2.
Counterfactuals¶
Counterfactuals occupy the top rung of the ladder of causation. A counterfactual statement has the form: “Given that unit was observed to have and , what would have been if had been instead?” This is written for a specific unit , or in the population version.
To evaluate counterfactuals, the SCM framework uses a three-step abduction-action-prediction procedure:
Abduction: Use the observed evidence on unit to infer the exogenous variables that are consistent with what was observed. This updates the prior to the posterior .
Action: Modify the structural equations by performing the hypothetical intervention: replace the equation for with .
Prediction: Use the modified SCM with the updated exogenous variables to compute the counterfactual outcome .
Counterfactuals are logically stronger than interventional quantities because they condition on individual-level data. An interventional query asks “what would happen to a randomly drawn unit if we set ?”, whereas a counterfactual asks “what would have happened to this specific unit?” — one for which we already know both the treatment and the outcome . The posterior over obtained in the abduction step is what allows this individual-level reasoning.
Example. A dealer quotes bps on an RfQ and misses. The counterfactual question is: “Would the client have hit if the dealer had quoted bps?” The abduction step infers the client’s reservation spread from the observed miss: since the client did not hit at , either bps or a competitor quoted more aggressively. This posterior on is sharper than the unconditional prior. The action step sets in the structural equation for . The prediction step computes the probability that and given the updated posterior on .
This type of reasoning is central to post-trade attribution and revenue potential analysis in RfQ markets. In practice, counterfactuals are often approximated by simpler interventional quantities; the full counterfactual calculation requires a fully specified SCM including the exogenous noise structure.
Exercises¶
d-separation. Consider the DAG with nodes and edges , , , , . (a) Is d-separated from given ? (b) Is d-separated from given ? (c) Is d-separated from given ? Justify each answer by identifying whether every path between the two nodes is blocked.
Back-door criterion. In a causal DAG representing the RfQ hit probability, the main variables are: spread quoted by dealer , hit indicator , market volatility , reference price flag , and a confounder that affects both dealer pricing and client behaviour. The edges are , , , , , . (a) Identify all back-door paths from to (paths that enter through a non-descendant). (b) Show that the adjustment set satisfies the back-door criterion. (c) Write the back-door adjustment formula for .
Interventional distribution via Rule 2. In a simple chain DAG with an additional direct edge , and suppose there are no hidden confounders. (a) Write the observational factorisation . (b) Using Rule 2 of the do-calculus (action/observation exchange), show that . (c) Verify that this is precisely the back-door adjustment with adjustment set .
Counterfactual reasoning. A dealer quotes bps and the client misses (). The SCM for the hit event is , where the client’s reservation spread is drawn as with (the exogenous noise). (a) Compute . (b) Apply the abduction step: compute the posterior . (c) Apply action and prediction: compute the counterfactual probability . (d) Compare this to the interventional quantity and explain the difference.
- Pearl, J., Glymour, M., & Jewell, N. P. (2016). Causal Inference in Statistics: A Primer. Wiley.