PPhilosophy, Built

Act IV · Science

Part 17 of 42

Cause

Introductorystarts at this level54 min of film17 chaptersprerequisites: Part 13, Part 14, Part 16

What does it mean for one thing to cause another, and how can data ever show it?

Doll and Hill find that heavy smokers get lung cancer many times as often as non-smokers; Fisher answers that a gene might cause both, and Cornfield replies with an inequality. To say what was shown, the part first tries the classical analyses: Hume's two definitions and al-Ghazālī's cotton, Mill's methods and Mackie's INUS conditions, Lewis's counterfactual dependence, which Suzy and Billy's rocks break, and probability-raising, which Hesslow's pills break. Russell's challenge and Woodward's interventions lead to the turn: a structural causal model, in which doing is surgery on a graph and differs from seeing. The back-door and front-door formulas recover the effect of an intervention from observation, and Pearl's do-calculus says exactly when that is possible. On the ladder of causation counterfactuals sit one rung higher; Halpern and Pearl's definition of actual causation is run on six classic cases. Discovery has a limit, the Wall's seventeenth brick: graphs with the same skeleton and colliders imply the same independences, so observation alone cannot choose among them. The part ends with potential outcomes, causal inference in industry, and Kim's exclusion argument about the mind.

What you need. Conditional probability and Bayes' rule as in Part 13; Simpson's paradox from Part 16. No statistics beyond proportions is assumed.

The calculation
structural causal models, do-calculus
The wall
causal Markov limits
Built toy
SCM engine; PC algorithm; Halpern–Pearl

What you will be able to do

Introductory

  • Apply the but-for test to a case of late preemption and say why counterfactual dependence is not necessary for causation.
  • Compute the effect of an intervention in a small structural model and contrast it with the conditional probability that was observed.
  • Answer one question about a firing squad on each rung: association, intervention, counterfactual.

Advanced

  • Decide d-separation queries on a graph, and use the back-door criterion to choose an adjustment set.
  • Apply the front-door formula when the confounder is hidden, and check it against the model's interventional truth.
  • Test a candidate cause against the Halpern-Pearl definition, and list a graph's Markov equivalence class.

Research

  • State the three rules of the do-calculus with their graphical side conditions and derive the front-door formula from them.
  • State the causal Markov and faithfulness conditions, and explain how Bell's correlations and exact cancellations violate each.

Applied

  • Estimate an effect from an experiment with a pre-period covariate (CUPED) and say what the adjustment buys.
  • Distinguish targeting by predicted response from targeting by uplift, and say which design licenses a causal claim.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Introductory 21 min · Advanced 46 min · Research 54 min · Applied 26 min.

  1. 0Does smoking cause cancer?Introductory2 min
  2. 1Constant conjunctionIntroductory2 min
  3. 2Methods and conditionsIntroductory2 min
  4. 3Counterfactual dependenceIntroductory3 min
  5. 4Raising the probabilityAdvanced2 min
  6. 5Causes as handlesIntroductory2 min
  7. 6Structural models and graphsAdvanced3 min
  8. 7Seeing and doingIntroductory3 min
  9. 8The do-calculusResearch4 min
  10. 9The ladder of causationIntroductory4 min
  11. 10Actual causationAdvanced4 min
  12. 11Markov, faithfulness, and the common causeResearch4 min
  13. 12Discovering causesAdvanced4 min
  14. 13Potential outcomesAdvanced5 min
  15. 14Causes at workApplied5 min
  16. 15Causation and the mindAdvanced3 min
  17. Recap, problems, and where this comes backAll tracks2 min

Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.

Lecture

The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.

Does smoking cause cancer?Introductory2 min

Part 16 ended with a lesson from Simpson's paradox: statistics alone cannot tell us which table to trust, because that depends on what causes what. This part is about causes. In 1913 Bertrand Russell argued that physics had no use for the notion: the law of causality, he said, is a relic of a bygone age, surviving, like the monarchy, only because it is erroneously supposed to do no harm. A century later, causation is a branch of mathematics, and a Turing Award.

The most consequential causal question of the twentieth century. Richard Doll and Austin Bradford Hill found that heavy smokers developed lung cancer many times as often as non-smokers. Ronald Fisher, the founder of modern statistics, and himself a smoker, objected that correlation is not causation: perhaps a gene inclines people both to smoke and to get cancer. Jerome Cornfield answered with an inequality: to explain away a nine-fold risk, such a gene would have to be at least nine times as common among smokers, and nothing like it was ever found. The Surgeon General's report of 1964 settled the policy. But what, exactly, had been shown, and by what logic? Fisher's own method, the randomized experiment, was impossible here. This part builds the logic that settles such questions.

The plan. The classical analyses: Hume's two definitions, al-Ghazālī's challenge eight centuries earlier, Mill's methods and Mackie's conditions. Lewis's counterfactual theory, and the cases that break it. Probabilities, Russell's challenge, and the idea of intervention. Structural models and their graphs, the difference between seeing and doing, and Pearl's do-calculus. The ladder of causation, and actual causation, computed on the classic cases. The assumptions that let us discover causes from data, and the theorem that limits it: this part's brick in the Wall. And the statistician's rival framework, causes at work in industry, and whether a thought can cause anything at all.

What it establishes: Doll and Hill (1950, 1954); Fisher's gene (1958); Cornfield (1959); the plan.

1Constant conjunctionIntroductory2 min

Hume's example is a game of billiards. One ball rolls toward another, they touch, and the second moves off. What do we actually see? One motion, contact, another motion. We never see the power by which the first ball moves the second. So Hume defined a cause as an object followed by another, where all objects like the first are followed by objects like the second: constant conjunction. And then, in the same sentence, he added: or in other words, where if the first object had not been, the second never had existed. Two definitions, one of regularity and one of counterfactual dependence, offered as if they were the same. Most of this part is about why they are not.

The argument is older than Hume. Abu Hamid al-Ghazālī, in the eleventh century, considered cotton touched by fire. We observe that the cotton burns together with the contact, he said, but never that it burns by it. His conclusion was occasionalism: God creates the burning on each occasion, and the order we observe is habit, not necessity. Averroes replied, in The Incoherence of the Incoherence, that whoever denies causes denies reason itself, since knowledge is knowledge of things through their causes. Hume made al-Ghazālī's observation six and a half centuries later, without the theology: what we call necessity is custom.

The regularity view faces famous counterexamples. Thomas Reid observed that night has always followed day, yet day does not cause night; both are produced by the turning Earth. A falling barometer regularly precedes a storm, but smashing the barometer will not stop the storm; falling air pressure causes both. Common causes manufacture regularities without causation. And regularities have no direction: they cannot say which end is the cause. Kant concluded that causation is a category the mind brings to experience. The twentieth century tried three replacements: counterfactuals, probabilities, and interventions.

What it establishes: Hume (1739, 1748): two definitions; al-Ghazālī (1095); regularity is not enough; Kant.

2Methods and conditionsIntroductory2 min

John Stuart Mill turned the search for causes into methods. Here are five cases, with the circumstances present in each, and whether there was a fire. The method of agreement: look for what all the cases with the effect have in common. Spark, oxygen and fuel. The method of difference: find two cases alike in everything but one circumstance, one with the effect and one without. The Reasoner finds three such pairs: they implicate the spark, the fuel, and wetness, whose presence prevents the fire. And notice what the methods cannot see. Oxygen never varies in these cases, so neither method can detect it, though there is no fire without it. Mill's methods find causes only against a background held fixed.

J. L. Mackie asked what we mean when an investigator says a short circuit caused a house fire. Suppose a fire occurs exactly when there is a short circuit, flammable material and no working sprinkler, or else arson and flammable material. The Reasoner finds the minimal sufficient conditions: the two clusters. The short circuit is insufficient on its own; it is a non-redundant part of its cluster; that cluster is unnecessary, since arson would also do; but it is sufficient. An INUS condition. Most of what we call causes, Mackie argued, are INUS conditions, picked out against a background field.

Which INUS condition do we call the cause? The investigator names the short circuit, the abnormal event. The insurer names the missing sprinkler, a duty that was not done. The chemist could name oxygen, just as necessary, and never mentioned. H. L. A. Hart and Tony Honoré argued that our selection follows norms: what was abnormal, and who was responsible. Mill himself thought there was no principled choice: the cause, philosophically speaking, is the sum total of the conditions. Chapter ten returns to this, with a formal definition that has to decide.

What it establishes: Mill's methods (1843); Mackie's INUS conditions (1965); Hart and Honoré (1959).; Computed on screen: agreement and difference on a table of fires; prime implicants and INUS

3Counterfactual dependenceIntroductory3 min

David Lewis took up Hume's second definition. An event e depends on an event c if, had c not occurred, e would not have occurred. The counterfactual is read with the similarity semantics of Part 14: in the closest worlds without c, is there no e? Then c causes e if there is a chain of such dependences leading from c to e. The chain makes causation transitive, and, as we will see, handles some cases where the effect would have happened anyway.

Ned Hall's example has become the standard test. Suzy and Billy both throw rocks at a bottle. Suzy's arrives first, and the bottle shatters; Billy's flies through the empty space where the bottle was. Suzy caused the shattering. But had she not thrown, Billy's rock would have shattered the bottle anyway, so the shattering does not depend on her throw. The Reasoner runs the simple but-for test on a model of the case: neither Suzy nor Billy passes it. Lewis's chains rescue some such cases, when the backup is cut off early. But here Billy's rock is cut off only by the bottle's having already shattered: late preemption. There is no chain of dependence, and the counterfactual analysis says Suzy was not a cause.

Two more cases. Jonathan Schaffer's trumping: a major and a sergeant both shout advance, and the soldiers, who obey the higher rank, advance. The major's order is the cause, though the advance depends on neither order. Overdetermination: two rocks strike the bottle at exactly the same instant. Intuition calls each a cause, but the shattering depends on neither. Lewis's last theory, causation as influence, said that c causes e when small alterations of c would alter whether, when or how e occurs. The lesson most have drawn: dependence is evidence of causation, not its definition.

Lewis's chains also make causation transitive, and transitivity has its own counterexamples. A boulder falls toward a hiker. She sees it and ducks, and survives. The boulder caused her ducking, and her ducking caused her survival. Did the boulder cause her survival? Surely not: without the boulder she would have survived anyway. The boulder both threatens and warns, and the two paths cancel. Saying this properly needs more structure than a chain of events: the structural models of chapter six.

What it establishes: Lewis (1973, 2000); Suzy and Billy (Hall 2004); trumping (Schaffer 2000); overdetermination; transitivity.; Computed on screen: the but-for test on Suzy and Billy

4Raising the probabilityAdvanced2 min

Causes need not be followed by their effects every time; smoking does not always produce cancer. So Patrick Suppes proposed that causes raise the probability of their effects. C is a prima facie cause of E if C comes first and the probability of E given C exceeds the probability of E. A prima facie cause is spurious if some earlier factor screens it off, so that once that factor is known, C makes no further difference. The falling barometer raises the probability of a storm, but the earlier drop in air pressure screens it off: given the pressure, the barometer adds nothing.

Germund Hesslow found a case that breaks the probability-raising idea. Birth-control pills raise the risk of thrombosis directly. But they also prevent pregnancy, which itself raises the risk of thrombosis. In the Reasoner's model, with numbers chosen so the paths cancel, the probability of thrombosis is point three with the pill and point three without. Yet among women who are not pregnant, the pill raises the risk by point two. A genuine cause can fail to raise the probability of its effect, when two paths cancel. Chapter eleven gives the assumption that rules this out, and calls it faithfulness.

Nancy Cartwright drew the moral in 1979. We need causal laws, not just correlations, because we need to know which strategies will work. She proposed that C causes E only if C raises the probability of E in every background context that is causally homogeneous. Partition the population by the right factors, and Simpson's reversals disappear. But which factors are the right ones? Causally homogeneous contexts are defined by causes. Probabilities can test causal claims, but only once some causal knowledge has been put in: no causes in, no causes out.

What it establishes: Suppes (1970); screening off; Hesslow (1976); Cartwright (1979).; Computed on screen: Hesslow's pills: P(T) 0.30 either way, direct effect 0.2

5Causes as handlesIntroductory2 min

Russell's challenge was this. The fundamental laws of physics are differential equations. They relate the state of a system at one time to its state at others, forwards and backwards alike. They mention no causes, and no asymmetry between cause and effect. Yet medicine, engineering and policy all run on causal claims. The answer that won came from Cartwright's observation: we need causal knowledge to choose strategies. Causes are what we can use to change things.

James Woodward made the idea precise. X causes Y if some possible intervention on X would change Y, or its probability. An intervention is a special kind of cause. It sets the value of X, breaking every other influence on X: here the arrow from Z is cut. It affects Y only through X, and it is independent of Y's other causes. A randomized experiment is exactly such an intervention: the coin decides the treatment, and nothing else does.

Two further ideas complete the picture. Invariance: a causal generalization stays true when we intervene on its variables. Ohm's law survives our setting the voltage; the link between barometer and storm does not survive our setting the barometer. And explanation: to explain an event is to say what would have happened had things been different. The view descends from the manipulability theories of Collingwood, von Wright, and Peter Menzies and Huw Price. The old worry is that it makes causation anthropocentric: no one can manipulate an earthquake. Woodward's reply is that the definition uses possible interventions, not human ones: what would happen if the tectonic plate were moved, by anything at all.

What it establishes: Russell (1913); Woodward (2003); invariance; manipulability and anthropocentrism.

6Structural models and graphsAdvanced3 min

Judea Pearl, building on Sewall Wright's path analysis of 1921, gave causation a mathematical form: the structural causal model. Each variable is assigned a value by a function of its direct causes and an unobserved noise term. Cloudiness; the sprinkler, which depends on cloudiness; rain, which does too; wet grass, which depends on sprinkler and rain; and a slippery path, which depends on wet grass. The colon-equals is assignment, not equality: it says which variable listens to which. Draw an arrow from each variable to those that listen to it, and you have the model's causal graph.

Information flows through a graph along paths, and three kinds of junction govern it. A chain: A causes B, which causes C. A and C are correlated, but once B is known, A tells us nothing more about C. Conditioning on B blocks the path. A fork: B causes both A and C. Again correlated, again blocked by conditioning on B, the common cause. A collider: A and C both cause B. Now A and C are independent, but conditioning on B, or on anything B causes, makes them dependent. A path is blocked by a set Z when it contains a chain or fork node in Z, or a collider with nothing in Z at or below it. X and Y are d-separated by Z when every path between them is blocked, and then X and Y are independent given Z in every distribution the model can generate.

Colliders explain a famous illusion. Suppose talent and good looks are independent in the population: here are six hundred people, with no correlation at all. Suppose people become film actors when talent and looks together are high enough. Both cause the collider, being an actor. Among actors, talent and looks are strongly negatively correlated: minus point six six. The less talented actors had to be better looking to get in. Selecting on a common effect manufactures a correlation from nothing. Joseph Berkson found it among hospital patients in 1946, and it resurfaced in studies of patients tested for COVID-19.

The Reasoner implements d-separation and runs it on the sprinkler model. Sprinkler and rain are dependent, through the clouds. Given the clouds, they are independent: the fork is blocked. Given the clouds and the wet grass, they are dependent again, because wet grass is a collider; and conditioning on the slippery path, its descendant, opens it too. The remaining queries are blocked chains. Every one of these is a testable prediction about data, made from the graph alone. That is what makes causal graphs empirical.

What it establishes: structural causal models (Wright 1921; Pearl 2000); chains, forks, colliders; Berkson; d-separation.; Computed on screen: Berkson's paradox; seven d-separation queries

7Seeing and doingIntroductory3 min

Pearl's central distinction is between seeing and doing. Seeing: among patients who took the drug, how many recovered? Here age influences both who takes the drug and who recovers. Doing: if we made patients take the drug, how many would recover? The do-operator answers by surgery on the model: replace the drug's equation by a constant, and delete the arrows into it. Age no longer influences who is treated. The difference is the difference between patients who choose a drug and patients assigned to it, which is why randomized trials work.

When can the effect of doing be computed from data about seeing? Pearl's first answer is the back-door criterion. A set of variables Z qualifies if it contains no descendant of the treatment, and blocks every path from treatment to outcome that begins with an arrow into the treatment: every back door. Then the effect of doing is a weighted average of conditional probabilities: adjust for Z. On the drug model, the naive comparison of treated and untreated says the drug raises recovery by twelve points. Adjusting for age gives twenty, exactly the effect under intervention. From two hundred thousand simulated patients, the naive estimate is still twelve, the adjusted estimate twenty, matching a simulated randomized trial. The Reasoner confirms that age satisfies the criterion and the empty set does not.

Fisher's smoking objection has a surprising answer. Suppose a hidden gene causes both smoking and cancer, as Fisher proposed. The gene is unobserved, so no back-door adjustment is possible. But suppose smoking causes cancer only by depositing tar in the lungs, and the gene does not affect tar directly. Pearl's front-door formula then recovers the causal effect from observational data alone, in two steps: smoking's effect on tar, and tar's effect on cancer, adjusting for smoking. In the Reasoner's model, the naive difference is point six two, mostly the gene. The front-door formula gives point three four, exactly the effect under intervention, which the Reasoner also computes directly.

Sometimes no formula exists. In one model, X causes Y directly. In another, X has no effect at all on Y, and a hidden common cause produces their correlation. The Reasoner computes both observational distributions: they are identical, cell for cell. But the effect of intervening on X is point six in the first model and zero in the second. No quantity of passive data can tell them apart. Which causal effects can be computed, from which assumptions, is the subject of identification theory, and the next chapter gives its complete answer.

What it establishes: the do-operator; the back-door criterion; the front-door formula; non-identifiability.; Computed on screen: naive, adjusted and true effects, exact and sampled; the front door; two models, one distribution

8The do-calculusResearch4 min

In 1995 Pearl gave a calculus for the do-operator: three rules that turn expressions containing do into other expressions, each licensed by a d-separation in a surgically altered graph. Two surgeries are needed: delete the arrows into a variable, written with a bar above, or delete the arrows out of it, written with a bar below. Rule one: an observation may be ignored if, in the graph where X has been set, it is independent of Y given the rest. Rule two: an action may be exchanged for an observation, when no back-door path connects it to Y. Rule three: an action may be deleted, when it has no way to reach Y. In words: ignore what tells you nothing; treat doing as seeing when no back door is open; and ignore actions that cannot matter.

Here is the front-door formula, derived in the calculus. First, plain probability: sum over the values of tar. Smoking's effect on tar: by rule two, doing equals seeing, because once smoking's outgoing arrow is cut, nothing connects smoking to tar. Next, given smoking was set, observing tar is as good as setting it, by rule two again. Then the action on smoking can be deleted, by rule three: once tar is set, smoking cannot reach cancer. Tar's effect on cancer is a back-door adjustment, with smoking blocking the path through the gene. Assemble the pieces and the do has disappeared: an expression in observational probabilities only. In the bow arc, by contrast, neither rule applies to the first step, and no derivation can begin.

Is the calculus enough? Jin Tian and Pearl showed how to split a graph into pieces linked by hidden confounding, and identify each piece. Ilya Shpitser and Pearl gave an algorithm that returns a formula for the causal effect whenever one exists; when none does, it returns a structure called a hedge that proves it. Yimin Huang and Marco Valtorta proved, independently in the same year, that the three rules are complete: any identifiable effect can be derived with them. Elias Bareinboim and Pearl extended the machinery to transportability: when does a trial in one population tell us about another? The philosophical point is that every identification is relative to a graph. The absent arrows are the assumptions, and the graph puts them where everyone can see and dispute them.

One practical lesson cuts against a common habit: adjust for every variable you have. Here M is measured before the treatment, and correlates with both treatment and outcome: the textbook picture of a confounder. But M is a collider of two hidden causes. Without adjustment, the comparison is already unbiased: point three, the true effect. Adjusting for M opens the path through both hidden causes, and the estimate falls to point two two. The back-door criterion sees it at once: the empty set qualifies, and M does not. Mediators and descendants of the outcome are other bad controls. Which variables to adjust for is a causal question, not a statistical one.

What it establishes: Pearl's three rules (1995); completeness (Tian and Pearl 2002; Shpitser and Pearl, Huang and Valtorta 2006); transportability; M-bias.; Computed on screen: each rule's side condition along the front-door derivation; the bow arc; M-bias (0.30 → 0.22)

9The ladder of causationIntroductory4 min

Pearl arranges causal questions on a ladder of three rungs. The first is association, seeing: what does a symptom tell me about a disease? Its language is conditional probability. The second is intervention, doing: what will happen if I take the aspirin? Its language is the do-operator. The third is counterfactuals, imagining: my headache is gone; was it the aspirin? This asks about a world that did not happen, given what did. Each rung answers questions that the one below cannot.

Pearl's firing squad puts all three rungs on one model. A court may order an execution. If it does, the captain signals; both riflemen, A and B, shoot; and the prisoner dies. On rung one: the prisoner dies whenever A shoots, and survives whenever A does not. A's shot is a perfect sign. On rung two: if we restrain A, the prisoner still dies with probability point seven, whenever the court orders it, because B obeys the signal. On rung three: the prisoner is dead. Had A not shot, would he be alive? No, with certainty: the death tells us there was an order, so B shot too. This counterfactual is about this very case, and no experiment on other prisoners could answer it.

How is a counterfactual computed? Draw two copies of the model, the actual world and the hypothetical one, sharing the same background conditions. Step one, abduction: use the evidence to update what we know about the background. The prisoner died, so there was an order. Step two, action: in the hypothetical copy, set A to not shooting, cutting the arrow from the captain. Step three, prediction: solve the copy. The order still reaches B, B still shoots, and the prisoner still dies. This twin network, due to Alexander Balke and Pearl, turns every counterfactual query into an ordinary calculation on a larger graph.

Rung three has practical uses. Imagine three kinds of patient: responders, who recover exactly when treated; those who recover always; and those who never do. The probability of necessity asks, of a patient who was treated and recovered: would they not have recovered without treatment? Here it is point six. The probability of sufficiency asks, of an untreated patient who did not recover: would treatment have helped? Point three seven five. The probability of being both necessary and sufficient is the share of responders, and with no defiers it equals the difference of two interventional probabilities. The probability of necessity is the law's question. But for the exposure, would the harm have occurred? Civil courts ask whether it exceeds one half. Jin Tian and Pearl showed how to bound it by combining experimental and observational data. Here the bound is tight.

Is the ladder real, or could a clever enough analysis of the lower rungs answer the upper questions? Elias Bareinboim, Juan Correa, Duligur Ibeling and Thomas Icard proved the causal hierarchy theorem: for almost every model, data from one rung leave the answers on the next rung undetermined. Climbing therefore costs assumptions: a graph to reach rung two, and functional equations, not only a graph, to reach rung three. Pearl draws a moral for machine learning: a system that only fits conditional probabilities, however large, stays on the first rung. The reply is that human text is full of causal claims, which a model can absorb second-hand, and a system that can act can also experiment. Later parts return to agents. One that chooses among acts needs rung two, as causal decision theory in Part thirty-three will show; one that regrets, assigns blame, or judges fairness needs rung three, as in Part forty-one.

What it establishes: association, intervention, counterfactuals; twin networks (Balke and Pearl 1994); PN and PS (Tian and Pearl 2000); the causal hierarchy theorem.; Computed on screen: the firing squad on three rungs; PN 0.6, PS 0.375, PNS 0.3

10Actual causationAdvanced4 min

Joseph Halpern and Judea Pearl brought structural models to the question of actual causation: did this cause that, on this occasion? The trick is to model the case finely. Suzy and Billy throw; each rock may hit; the bottle shatters if either hits; and Suzy's hitting prevents Billy's. The definition, in Halpern's modified form of 2015, has three clauses. First, the cause and the effect both actually occur. Second, there is a contingency: hold some other variables fixed at their actual values, change the candidate cause, and the effect goes away. Third, minimality: no smaller part of the candidate already does the job. For Suzy, the witness is Billy's hit. Hold it at its actual value, which is no hit, and remove Suzy's throw: the bottle survives. For Billy, no contingency works, because Billy's rock never hit. The definition says what intuition says, though neither passes the simple but-for test.

The Reasoner runs the definition on six classic cases. Preemption: Suzy is a cause, and Billy is not, as intuition says. Overdetermination: lightning and a dropped match each would have started the forest fire alone. Intuition calls each a cause. The modified definition says the cause is the conjunction, lightning and match, and each is only part of it. When both are needed, lightning is a cause, by every test. Double prevention: Billy shoots down an enemy fighter that would have shot down Suzy's bomber, and Suzy destroys her target. The definition says Billy's shot is a cause. Ned Hall pointed out that no process connects them, and intuitions divide. Bogus prevention: a bodyguard puts antidote in the king's coffee, but no assassin ever poisoned it. The antidote is not a cause of survival. The original 2005 definition said it was; the 2015 version fixes this. Every proposed analysis faces such a list, and none yet agrees with intuition on every case.

Late preemption is a Price List. Causation requires counterfactual dependence, or a chain of it. Suzy's throw caused the shattering. And no chain of dependence links her throw to the shattering, because Billy's rock would have done it. The three cannot all be true. David Lewis considered denying the third, by making events fragile: the shattering caused by Billy would have been a different event, a moment later. Critics answered that fragility makes too much a cause, since nearly everything affects exactly when things happen. Ned Hall gave up the first: there are two concepts of cause, production and dependence, and Suzy produced the shattering. Halpern and Pearl give up the first in a different way: dependence is required, but only under a contingency. And a sceptic can give up the second, in a sense: that Suzy is the cause is a judgment about which factors matter, as Christopher Hitchcock and Joshua Knobe argue, not a further fact in nature.

Two refinements bring the theory closer to how people judge. Joshua Knobe and Ben Fraser's pen case: faculty are allowed to take pens from the office, administrative assistants are not. One morning a professor and an assistant each take a pen, and none are left for an important note. Most people say the assistant caused the problem, though the two acts are symmetric in the structure. Halpern and Christopher Hitchcock built this in, by ranking contingencies by how normal they are. And Hana Chockler and Halpern defined degrees of responsibility. In an eleven-voter election won six to five, each winning voter is pivotal: responsibility one. Won eleven to nothing, five votes must change before any one voter is pivotal: responsibility one sixth. Causation is all or nothing; responsibility, and with it blame, comes in degrees.

What it establishes: Halpern and Pearl (2005), modified (Halpern 2015); Price List for late preemption; normality (Halpern and Hitchcock 2015); responsibility (Chockler and Halpern 2004).; Computed on screen: the definition on six classic cases; responsibility in four elections

11Markov, faithfulness, and the common causeResearch4 min

Peter Spirtes, Clark Glymour and Richard Scheines made the link between causal graphs and probability into two explicit axioms. The first is the causal Markov condition. Each variable is independent of everything except its own effects, once its direct causes are given. Equivalently, the joint distribution factorizes: one conditional probability per variable, given its parents. For five binary variables this needs eleven numbers instead of thirty-one, which is why Bayesian networks made probabilistic reasoning tractable. Combined with d-separation, the condition says every independence the graph entails holds in the data.

The Markov condition generalizes an older idea, Hans Reichenbach's principle of the common cause. If two events are correlated and neither causes the other, there is a common cause. And it screens them off: given the cause, or given its absence, the events are independent. And the cause raises the probability of each. The barometer and the storm are correlated because air pressure drives both. The principle seems close to a law of thought. It has two famous counterexamples.

The first counterexample was noticed by George Udny Yule in 1926. Take two random walks, generated completely independently. These two have a correlation of point eight nine. Their individual steps are uncorrelated. The Reasoner generated two thousand such pairs. Forty percent show a correlation above one half in size. Trends produce correlation with no common cause at all. Elliott Sober's version: sea levels in Venice and bread prices in Britain have both risen for centuries. They are correlated, and nothing screens them off. Defenders reply that the principle applies to stationary processes, or to the steps, not the levels.

The second counterexample is deeper. A source sends a pair of particles to Alice and Bob, who each choose one of two measurements. Their results are correlated. Is there a common cause, some hidden variable fixed at the source? John Bell showed that common causes impose a bound. In the form of Clauser, Horne, Shimony and Holt, this combination of correlations can be at most two in size. The Reasoner checks every deterministic local strategy, sixteen in all, and so every mixture of them: the maximum is two. Quantum mechanics predicts two root two, about two point eight three. Experiments, from Alain Aspect's in 1982 to the loophole-free tests of 2015, find the quantum value. So some correlations have no screening common cause. What that means is the subject of Part twenty-six.

The second axiom is faithfulness. Every independence in the data is entailed by the graph; nothing is independent by an accident of cancelling parameters. Hesslow's pills violate it: the two paths cancel exactly, and a genuine cause looks irrelevant. The defence is that unfaithful parameter values form a set of measure zero, as Christopher Meek proved: exact cancellation is a coincidence of probability zero. The worry is that nearly cancelling parameters are not rare, and James Robins and colleagues showed that no discovery method can then be uniformly consistent: no sample size is guaranteed large enough. And Holly Andersen notes that some systems are designed to cancel: a thermostat, or the body's homeostasis, keeps the outcome constant whatever the cause. Nancy Cartwright attacked the Markov condition itself, with a factory whose single process sometimes makes both a chemical and a pollutant: knowing the process ran does not make its two products independent.

What it establishes: the causal Markov condition (Spirtes, Glymour and Scheines 1993); Reichenbach (1956); Yule (1926); Sober (2001); Bell and CHSH; faithfulness (Meek 1995; Robins et al. 2003).; Computed on screen: 11 parameters for 31; 2,000 random-walk pairs; all 16 local strategies

12Discovering causesAdvanced4 min

Can the graph itself be learned from data? Peter Spirtes and Clark Glymour's PC algorithm says yes, up to a limit. Start with every pair of variables connected. Round zero: test each pair for independence. In the sprinkler data every pair is dependent, so nothing goes. Round one: test each remaining pair for independence given one neighbour. Four edges go. For instance, sprinkler and rain are independent given the clouds: they are linked only through them. Round two, conditioning on two: clouds and wet grass are independent given sprinkler and rain. The Reasoner ran this on twenty thousand samples from the sprinkler model, with fifty-six statistical tests, and recovered the true skeleton.

Next, the algorithm orients what it can. Sprinkler and rain are both adjacent to wet grass, but not to each other, and wet grass was not among the variables that separated them. That pattern is only possible if both point into wet grass: a collider, which has a distinctive statistical signature. Christopher Meek's rules then propagate: the edge from wet grass to slippery must point away, or it would create a collider the data did not show. The edges from the clouds cannot be oriented. The output is a partially directed graph that stands for every causal graph the data cannot tell apart.

How many graphs does the output stand for? The Reasoner enumerates every way of orienting the skeleton without cycles, and keeps those with the same independences. Three remain. Thomas Verma and Pearl proved the general rule: two causal graphs are observationally equivalent exactly when they have the same skeleton and the same colliders. In one of these graphs the clouds cause the rain; in another the rain causes the clouds. No quantity of passive observation can decide which.

This is the seventeenth brick in the Wall. The dream: read causes off correlations, given enough data. The wall: Markov equivalence. Graphs with the same skeleton and the same colliders entail exactly the same independences, so even infinite observational data leave the direction of many arrows open. What it forces: intervene, or assume. An experiment breaks the symmetry; so do assumptions about time order, about the form of the equations, or about the noise, which is where the field went next.

Assumptions about the noise can break the symmetry. Let X cause Y linearly, with noise that is uniform, not bell-shaped. Regress Y on X: the residual is independent of X. Regress the wrong way, X on Y: the residual is still uncorrelated with Y, as least squares guarantees, but no longer independent of it; the cloud has a slanted, parallelogram shape. Shohei Shimizu and colleagues turned this into the LiNGAM algorithm. With Gaussian noise the trick fails, and both directions look the same: Markov equivalence is the Gaussian case. Other methods handle hidden variables, like Jiji Zhang's complete version of FCI; search over scores, like David Maxwell Chickering's GES; or turn acyclicity into a smooth constraint, as NOTEARS did in 2018, bringing discovery into deep learning.

What it establishes: PC (Spirtes and Glymour 1991); Meek's rules; Verma and Pearl (1990), the Wall's seventeenth brick; LiNGAM (Shimizu et al. 2006); FCI, GES, NOTEARS.; Computed on screen: PC from 20,000 samples; the 3-graph equivalence class; residual dependence both ways

13Potential outcomesAdvanced5 min

The second great framework for causation comes from statistics. Jerzy Neyman introduced it in 1923 for agricultural trials, and Donald Rubin made it general in 1974. Each patient has two potential outcomes: years lived without the drug, and years lived with it. Here the drug is harmful: on average it costs two years. Now a perfect doctor, who knows every patient's outcomes, gives each patient whichever option is better for them. Compare the treated with the untreated, and the drug appears to add five point six years. Paul Holland called this the fundamental problem of causal inference: for each patient we see only one potential outcome, never both. Causal inference is a missing-data problem.

Fisher's answer is randomization. There are seventy ways to give the drug to four of the eight patients. The Reasoner enumerates every one and computes the observed difference in means. Their average is exactly minus two: the true effect. A randomized comparison is unbiased. But with eight patients, thirty percent of the assignments get even the sign wrong. Randomization makes who is treated independent of the potential outcomes; only sample size makes the estimate precise. And the framework needs an assumption Rubin named SUTVA: one patient's treatment does not affect another's outcome, and there is only one version of the treatment. Vaccines, which protect the unvaccinated too, break it.

How does this relate to structural models? Pearl's answer: a potential outcome is the value Y takes in the model where X has been set by surgery, for a given background. So Rubin's notation and Pearl's say the same thing. Rubin's key assumption, that treatment is ignorable given some covariates, corresponds to those covariates satisfying the back-door criterion. David Galles and Pearl proved the two frameworks obey the same logic of counterfactuals. The quarrel is practical. Pearl says graphs make assumptions visible and checkable; Guido Imbens replies that economists find ignorability, stated directly, closer to what estimation needs. And Philip Dawid argues that unobservable counterfactuals are unnecessary: causal inference is about decisions, and can be done with ordinary probability.

When confounders are hidden and no front door exists, economists reach for an instrument. The idea goes back to Philip Wright in 1928, estimating the supply and demand for flaxseed and butter. An instrument Z shifts the treatment X, and affects the outcome only through X. Then the ratio of two covariances estimates the effect. In the Reasoner's simulation the true effect is point five. Least squares gives one point zero seven, inflated by the hidden confounder. The instrument gives point four nine. Joshua Angrist and Alan Krueger used the quarter of a person's birth, which affects how long they must stay in school, to estimate the return to education; Imbens and Angrist showed what an instrument identifies when effects vary across people: the effect among those the instrument moves.

Another design uses time. In 1992 New Jersey raised its minimum wage; neighbouring Pennsylvania did not. David Card and Alan Krueger counted jobs at fast-food restaurants in both states, before and after. Compare the states only afterwards, and New Jersey has fewer jobs; but it had fewer before. Compare New Jersey with itself, and jobs rose; but the whole region's economy was changing. The difference in differences subtracts Pennsylvania's change from New Jersey's: jobs rose by about two point seven per restaurant relative to the trend, against the textbook prediction. The assumption is parallel trends: without the law, New Jersey would have followed Pennsylvania's path, the dashed line. The design is old. John Snow, in 1855, compared London households in one area served by two water companies, one drawing sewage-laden water from the Thames, and found cholera's cause. Regression discontinuity, comparing people just either side of a cutoff, completes the economist's toolkit of natural experiments.

What it establishes: Neyman (1923), Rubin (1974), Holland (1986); SUTVA; Galles and Pearl (1998); Dawid (2000); Wright (1928); Card and Krueger (1994); Snow (1855).; Computed on screen: the perfect doctor; all 70 randomizations; IV against OLS; difference in differences

14Causes at workApplied5 min

The largest users of causal inference today are technology companies, which run tens of thousands of randomized experiments a year. One small piece of causal reasoning saves them a fortune. Subtract from each user's outcome a multiple of the same metric measured before the experiment began. The variance falls by the factor one minus rho squared, where rho is the correlation between before and after. The Reasoner ran four hundred simulated tests. Both estimates are centred on the true lift; the adjusted one is much less spread out. The variance is roughly halved, as the theory says: the same precision from half the users. Why is this adjustment safe, when Chapter eight warned against adjusting for the wrong variables? Because a quantity measured before randomization cannot be an effect of the treatment: it is neither a collider nor a mediator.

Marketing gives a sharper example. Customers come in four kinds: sure things, who buy either way; persuadables, who buy only if contacted; lost causes; and sleeping dogs, whom contact puts off. They are Chapter nine's types, with a fourth, the defiers. The Reasoner simulated a randomized campaign with two hundred thousand customers in sixteen segments, and then chose a fifth of the segments to contact. Contact the segments most likely to buy when contacted, as a standard response model would, and the campaign causes over five thousand fewer purchases: those segments are full of sure things and sleeping dogs. Contact at random, and it still loses. Contact by uplift, the difference the contact makes, and it causes over seven thousand extra purchases, the best possible. An uplift is a rung-two quantity. It cannot be learned from who bought, only from a comparison with a control group.

Machine learning and causal inference have merged into a field of their own. Doubly robust estimators, due to James Robins and colleagues, combine a model of the outcome with a model of who gets treated, and are right if either model is. Double machine learning, from Victor Chernozhukov and colleagues, lets both models be flexible learners such as forests or neural networks, and removes their bias by fitting on one part of the data and estimating on another. Causal forests, from Stefan Wager and Susan Athey, estimate how the effect differs from person to person. The division of labour is the lesson. Machine learning supplies flexible fits; the causal assumptions, which variables to adjust for and why, must still come from a graph or a design.

Chapter five's idea of invariance has become a method. X causes Y, and Y causes Z. Data come from two environments: in the second, X has a different distribution, and Z responds to Y differently. Regress Y on its cause: the coefficient is one in both environments. Regress Y on its effect: point eight nine in one, one point nine in the other. Only the causal relation survives the change. Jonas Peters, Peter Bühlmann and Nicolai Meinshausen turned this into invariant causal prediction: keep the predictors whose relation to the outcome is the same in every environment. The payoff is robustness. A model that predicts from effects and proxies may break when the world shifts; one that predicts from causes keeps working.

Do large language models reason causally? The evidence is mixed. Emre Kıcıman and colleagues found GPT-4 far above chance at naming the cause in well-known cause and effect pairs, drawing on what it had read rather than on any data. But on Corr2Cause, a benchmark that asks for causal conclusions from stated correlations, the kind of inference the PC algorithm makes, models of the time performed close to chance. CLadder poses questions on all three rungs of Pearl's ladder, and accuracy falls as the rungs rise. Matej Zečević and colleagues called such systems causal parrots: they can repeat causal facts without having a causal model. The open question is philosophical. Can training on text, which is rung-one data about rung-two facts, produce rung-two competence? Models that can use tools and run experiments may change the answer. Parts thirty and forty-two return to it.

What it establishes: CUPED (Deng et al. 2013); uplift; doubly robust and double ML; causal forests; invariant causal prediction (Peters et al. 2016); language models and causal benchmarks.; Computed on screen: 400 simulated A/B tests; uplift against response targeting; coefficients across environments

15Causation and the mindAdvanced3 min

Part 30 will ask what minds are; this chapter asks one causal question about them. I want water, and my arm reaches for the glass. Surely the wish caused the movement. But the wish is realized by a brain state, on which it supervenes; and that brain state, by the causal closure of physics, was already sufficient for the arm's motion. So what is left for the wish to do? Jaegwon Kim pressed this as the problem of causal exclusion, against everyone who holds that minds are physical but not reducible to physics.

Kim's argument is a Price List with five claims. Mental events cause physical events. Mental events are not physical events. Physics is closed: every physical event with a cause has a sufficient physical cause. Exclusion: no event has two distinct sufficient causes unless it is overdetermined. And the mind does not systematically overdetermine behaviour. The five are inconsistent; drop any one and the rest are fine. Kim dropped the second: the wish is the brain state, and causes by being physical. Thomas Huxley dropped the first: consciousness is like the steam whistle on a locomotive, which accompanies the work but does none of it. Dualists, from Descartes to Jonathan Lowe, drop closure. Theodore Sider asked what is so bad about overdetermination, and accepted it. And Karen Bennett, and interventionists following Woodward, reject exclusion as stated: a cause and the state that realizes it are not competitors, so the principle applies only to independent causes.

Stephen Yablo's pigeon makes the interventionist reply vivid. A pigeon is trained to peck at red things. It is shown a scarlet patch, and pecks. What caused the peck: the patch's being scarlet, or its being red? Take scarlet as the cause. Of the four other shades it might have been, only two would have changed the outcome; crimson and maroon would have been pecked as well. Take red as the cause. Its alternative, not red, always changes the outcome. Red is the proportional cause: neither too specific nor too general. Christian List and Peter Menzies argued that mental states can stand to their realizers as red stands to scarlet: the higher-level state is the better cause, and exclusion runs the other way. Which description of a cause is correct becomes Woodward's question: which variable, when wiggled, makes the difference?

What it establishes: Kim's exclusion argument (1998) as a Price List; Huxley, Sider, Bennett, List and Menzies; Yablo's pigeon (1992).; Computed on screen: the Price List's five exits; proportionality on five shades

Recap, problems, and where this comes backAll tracks2 min

Let's gather what we built. Hume's two definitions, al-Ghazālī's challenge, Mill's methods and Mackie's conditions. Lewis's counterfactual theory, and the cases that break it. Probability-raising, Russell's challenge, and Woodward's interventions. Structural models and graphs, the back door and the front door, and the do-calculus. The ladder of causation, and actual causation, run on the classic cases. The Markov condition, the common cause and its two counterexamples, and causal discovery, with this part's brick in the Wall. The statistician's framework, and causes at work in industry. And the problem of mental causation.

The Reasoner has a new module, causal. It solves structural models under intervention and computes counterfactuals by abduction, action and prediction; tests d-separation and checks each rule of the do-calculus; adjusts through back and front doors; decides actual causation by the Halpern-Pearl definition; runs the PC algorithm and enumerates equivalence classes; and estimates effects with instruments, differences in differences and uplift. And the Wall has its seventeenth brick.

Six problems, with full solutions in this part's notes. D-separation in the sprinkler graph; the back-door formula from the truncated factorization; a broken front door; necessity with defiers; Markov equivalence by hand; and trumping, modelled. Pause here, and try them.

Where this comes back. Causal explanation and underdetermination, in Part 18. Laws, chance and the direction of causation, in Part 24. Bell's correlations, in Part 26. Mental causation, in Part 30. Determinism and free will, in Part 32. Causal decision theory and Newcomb's problem, in Part 33. And counterfactual fairness and responsibility, in Part 41. Next, Part 18: theories and reality.

The books and papers this part follows are on screen, and in the notes. Thanks for watching.

Where it goes next. Causal explanation and underdetermination follow in Part 18; laws, chance and the direction of causation in Part 24; Bell's correlations in Part 26; mental causation in Part 30; determinism and free will in Part 32; causal decision theory and Newcomb's problem in Part 33; counterfactual fairness and responsibility in Part 41.

Key results

The part's results in one place, for revision.

Causal Markov factorization\(\displaystyle P(v_1, \dots, v_n) = \prod_i P\bigl(v_i \mid \mathrm{pa}_i\bigr)\)
Intervention as surgery\(\displaystyle P\bigl(v \mid do(X = x)\bigr) = \prod_{i\,:\,V_i \ne X} P\bigl(v_i \mid \mathrm{pa}_i\bigr)\Big|_{X = x}\)
Back-door adjustment\(\displaystyle P\bigl(y \mid do(x)\bigr) = \sum_z P(y \mid x, z)\,P(z)\)
Front-door adjustment\(\displaystyle P\bigl(y \mid do(x)\bigr) = \sum_m P(m \mid x) \sum_{x'} P(y \mid m, x')\,P(x')\)
Do-calculus, rule 2 (action and observation exchange)\(\displaystyle P(y \mid do(x), do(z), w) = P(y \mid do(x), z, w)\quad\allowbreak \text{if } (Y \perp Z \mid X, W)_{G_{\overline{X}\,\underline{Z}}}\)
Markov equivalence (Verma and Pearl)\(\displaystyle G_1 \sim G_2 \iff \text{same }\allowbreak \text{skeleton }\allowbreak \text{and }\allowbreak \text{same }\allowbreak \text{v-structures } a \to c \leftarrow b\)

Try it

Lab 17 · Seeing, adjusting, doing: two formulas against the interventional truth

Draw ten confounded models (age affects both drug and recovery) and ten front-door models (a hidden gene affects smoking and cancer; smoking acts only through tar) with random strengths. In each, compare the naive difference, the adjustment formula computed from the observational distribution alone, and the effect of an intervention computed by surgery on the model.

Figure produced by Lab 17: Seeing, adjusting, doing: two formulas against the interventional truth
Produced by the lab below, seed 0, in 1.3 s.
python -m videos.philosophy.labs 17 needs numpy, scipy, matplotlib · download lab17.py · source on GitHub
the film's drug: naive, adjusted, do()                   0.12   0.20   0.20
the film's smoking: naive, front door, do()              0.625   0.342   0.342
back door, 10 random models: largest |formula - do()|    2.2e-16   (theory 0)
back door: largest and mean |naive - do()|               0.330   0.077
front door, 10 random models: largest |formula - do()|   2.3e-14   (theory 0)
front door: largest and mean |naive - do()|              0.284   0.086
models where naive and true effects have opposite signs  3 of 20

Conditioning reports what is seen among those who took the drug; the adjustment formulas rebuild, from the same observational distribution and the graph, what would be seen if everyone were made to take it. The graph is the extra premise.
The code (96 lines; it asserts its own result)
"""Lab 17: build random structural causal models and check the back-door and front-door formulas against do()."""

import numpy as np

from videos.coursekit import labs
from explainer.philosophy.reasoner import causal as Ca

TITLE = "Seeing, adjusting, doing: two formulas against the interventional truth"
GOAL = ("Draw ten confounded models (age affects both drug and recovery) and ten front-door models (a "
        "hidden gene affects smoking and cancer; smoking acts only through tar) with random strengths. In each, "
        "compare the naive difference, the adjustment formula computed from the observational distribution "
        "alone, and the effect of an intervention computed by surgery on the model.")
TASKS = [
    "Give cancer a direct dependence on smoking in front_door_model (add 'S' to C's parents). How far is the "
    "front-door formula from the truth now, and which assumption broke?",
    "Adjust for a collider instead: add a variable caused by both drug and recovery and include it in Z. Check "
    "Ca.backdoor_ok first, then measure the bias.",
    "Sample 2,000 units from one confounded model with model.sample and estimate the adjusted effect from counts. "
    "How large is the sampling error compared with the confounding bias?",
]

GRID = 10  # exogenous noise takes the values 0/10 ... 9/10, so every probability is a multiple of 1/10


def _noise():
    return [(k / GRID, 1 / GRID) for k in range(GRID)]


def confounded_model(rng):
    """Age A -> drug D, A -> recovery R, D -> R, with random conditional probabilities."""
    pd = rng.integers(1, GRID, 2) / GRID            # P(D = 1 | A = a)
    pr = rng.integers(1, GRID, (2, 2)) / GRID           # P(R = 1 | D = d, A = a)
    return Ca.SCM(exo={"A": Ca.bern(0.5), "Ud": _noise(), "Ur": _noise()},
                  eqs={"D": (["A", "Ud"], lambda a, u: int(u < pd[a])),
                       "R": (["D", "A", "Ur"], lambda d, a, u: int(u < pr[d, a]))})


def front_door_model(rng):
    """Hidden gene G -> smoking S, G -> cancer C; S -> tar T -> C; no arrow from S to C."""
    ps = rng.integers(1, GRID, 2) / GRID            # P(S = 1 | G = g)
    pt = rng.integers(1, GRID, 2) / GRID            # P(T = 1 | S = s)
    pc = rng.integers(1, GRID, (2, 2)) / GRID           # P(C = 1 | T = t, G = g)
    return Ca.SCM(exo={"G": Ca.bern(0.4), "Us": _noise(), "Ut": _noise(), "Uc": _noise()},
                  eqs={"S": (["G", "Us"], lambda g, u: int(u < ps[g])),
                       "T": (["S", "Ut"], lambda s, u: int(u < pt[s])),
                       "C": (["T", "G", "Uc"], lambda t, g, u: int(u < pc[t, g]))})


def effects(m, X, Y, adjust):
    naive = m.prob(lambda w: w[Y] == 1, given=lambda w: w[X] == 1) - m.prob(lambda w: w[Y] == 1, given=lambda w: w[X] == 0)
    truth = m.prob(lambda w: w[Y] == 1, do={X: 1}) - m.prob(lambda w: w[Y] == 1, do={X: 0})
    return naive, adjust(m, 1) - adjust(m, 0), truth


def run(seed=0):
    rng = np.random.default_rng(seed)
    lab = labs.Lab()

    g = Ca.DAG([("A", "D"), ("A", "R"), ("D", "R")])
    gs = Ca.DAG([("G", "S"), ("G", "C"), ("S", "T"), ("T", "C")])
    assert Ca.backdoor_ok(g, "D", "R", {"A"}) and not Ca.backdoor_ok(g, "D", "R", set())
    assert not Ca.backdoor_ok(gs, "S", "C", {"T"}), "with the gene hidden there is no back door to close"
    film = Ca.adjustment_demo()
    assert abs(film["backdoor"]["adjusted"] - film["backdoor"]["truth"]) < 1e-9
    lab.row("the film's drug: naive, adjusted, do()", "{naive:.2f}   {adjusted:.2f}   {truth:.2f}".format(**film["backdoor"]))
    lab.row("the film's smoking: naive, front door, do()", "{naive:.3f}   {front:.3f}   {truth:.3f}".format(**film["frontdoor"]))

    n = 10
    back = np.array([effects(confounded_model(rng), "D", "R", lambda m, x: Ca.backdoor_adjust(m, "D", x, "R", 1, ["A"]))
                     for _ in range(n)])
    front = np.array([effects(front_door_model(rng), "S", "C", lambda m, x: Ca.frontdoor_adjust(m, "S", x, "T", "C", 1))
                      for _ in range(n)])
    for name, t in (("back door", back), ("front door", front)):
        err_adj, err_naive = np.abs(t[:, 1] - t[:, 2]), np.abs(t[:, 0] - t[:, 2])
        assert err_adj.max() < 1e-9, f"{name}: the formula equals the interventional truth"
        assert err_naive.max() > 0.03, f"{name}: the naive difference is confounded"
        lab.row(f"{name}, {n} random models: largest |formula - do()|", f"{err_adj.max():.1e}   (theory 0)")
        lab.row(f"{name}: largest and mean |naive - do()|", f"{err_naive.max():.3f}   {err_naive.mean():.3f}")
    flips = int(np.sum(np.sign(back[:, 0]) * np.sign(back[:, 2]) < 0) + np.sum(np.sign(front[:, 0]) * np.sign(front[:, 2]) < 0))
    lab.row("models where naive and true effects have opposite signs", f"{flips} of {2 * n}")
    lab.note = ("Conditioning reports what is seen among those who took the drug; the adjustment formulas rebuild, "
                "from the same observational distribution and the graph, what would be seen if everyone were made "
                "to take it. The graph is the extra premise.")

    fig, ax = labs.figure(2, size=(11, 4.4))
    for a, t, title, formula in ((ax[0], back, "Back door: adjust for age", "back-door formula"),
                                 (ax[1], front, "Front door: hidden gene, through tar", "front-door formula")):
        lim = max(0.3, np.abs(t).max() * 1.15)
        a.plot([-lim, lim], [-lim, lim], color=labs.MUTED, ls="--", lw=1, label="estimate = truth")
        a.scatter(t[:, 2], t[:, 0], s=36, color=labs.RED, marker="x", label="naive: P(y | x=1) - P(y | x=0)")
        a.scatter(t[:, 2], t[:, 1], s=30, color=labs.GREEN, label=formula, zorder=3)
        a.set(title=title, xlabel="true effect: P(y | do(x=1)) - P(y | do(x=0))", ylabel="estimate from observation",
              xlim=(-lim, lim), ylim=(-lim, lim))
        a.legend(loc="lower right")
    lab.fig = fig
    return lab

Now change it

  1. Give cancer a direct dependence on smoking in front_door_model (add 'S' to C's parents). How far is the front-door formula from the truth now, and which assumption broke?
  2. Adjust for a collider instead: add a variable caused by both drug and recovery and include it in Z. Check Ca.backdoor_ok first, then measure the bias.
  3. Sample 2,000 units from one confounded model with model.sample and estimate the adjusted effect from counts. How large is the sampling error compared with the confounding bias?

Problems, with solutions

Try each problem before opening its solution.

  1. In the sprinkler graph, list every set that d-separates \(S\) and \(R\). Does \(\{C, L\}\)?

    Solution

    The graph is \(C \to S\), \(C \to R\), \(S \to W\), \(R \to W\), \(W \to L\). Two paths join \(S\) and \(R\): the fork \(S \leftarrow C \to R\), blocked exactly when \(C\) is in the set, and the collider path \(S \to W \leftarrow R\), blocked exactly when neither \(W\) nor its descendant \(L\) is in the set. Among subsets of \(\{C, W, L\}\), only \(\{C\}\) blocks both. \(\{C, L\}\) does not: conditioning on \(L\), a descendant of the collider, opens \(S \to W \leftarrow R\).

  2. Derive the back-door formula from the truncated factorization \(\prod_{i \ne X} P(v_i \mid pa_i)\).

    Solution

    The truncated factorization says \(P(v \mid do(x)) = \prod_{i \ne X} P(v_i \mid pa_i)\) for \(v\) consistent with \(X = x\), which equals \(P(v)/P(x \mid pa_X)\). Let \(Z = pa_X\), which satisfies the back-door criterion. Summing over every variable except \(Y\) and \(Z\): \(P(y, z \mid do(x)) = P(y, x, z)/P(x \mid z) = P(y \mid x, z)\,P(z)\). Summing over \(z\) gives the adjustment formula \(P(y \mid do(x)) = \sum_z P(y \mid x, z)\,P(z)\). Any other set satisfying the back-door criterion gives the same answer, by the do-calculus's rule 2 applied to it.

  3. Let the gene also affect tar. Which front-door step fails, and which path is open?

    Solution

    Both conditions of the front door that mention the gene fail. Smoking's effect on tar is no longer identified by \(P(t \mid s)\): the path smoking \(\leftarrow\) gene \(\to\) tar is an open back door from smoking to tar. And tar's effect on cancer is no longer identified by adjusting for smoking: tar \(\leftarrow\) gene \(\to\) cancer does not pass through smoking, so smoking does not block it. With the gene unobserved, the effect of smoking on cancer is not identified.

  4. With 10% defiers, compute PN and PNS, and show PNS \(\ne P(y \mid do(x)) - P(y \mid do(x'))\).

    Solution

    Take the film's types and move a tenth of the population from "never" to defiers: responders 0.3, always 0.2, never 0.4, defiers 0.1, with treatment independent of type. Among the treated who recovered (responders and always-recoverers; defiers do not recover when treated), PN is the share who would not have recovered untreated: \(0.3/0.5 = 0.6\). PNS is the share of responders, 0.3. But \(P(y \mid do(x)) - P(y \mid do(x')) = 0.5 - 0.3 = 0.2\), the responders minus the defiers. With defiers the experimental difference understates PNS; it equals PNS only when there are none (monotonicity).

  5. Show that \(X \to Y \to Z\) and \(X \leftarrow Y \to Z\) are Markov equivalent, but \(X \to Y \leftarrow Z\) is not.

    Solution

    Both \(X \to Y \to Z\) and \(X \leftarrow Y \to Z\) have the skeleton \(X - Y - Z\) and no collider, and both entail exactly one independence, \(X \perp Z \mid Y\): they are Markov equivalent, and no data on \(X, Y, Z\) alone can tell them apart. \(X \to Y \leftarrow Z\) has the same skeleton but a collider at \(Y\): it entails \(X \perp Z\) unconditionally and dependence given \(Y\), the opposite pattern. Verma and Pearl's theorem: two graphs are Markov equivalent exactly when they share their skeleton and their colliders with unlinked parents.

  6. Model Schaffer's trumping case. Is the sergeant's order a cause by Halpern–Pearl?

    Solution

    Let each officer's order take three values, none, advance or retreat, with the soldiers obeying the major when he gives an order and the sergeant otherwise: \(A = M\) if \(M \ne\) none, else \(A = S\). Actually \(M = S =\) advance. The major's order is a cause by Halpern–Pearl: setting \(M\) to retreat makes the soldiers retreat. The sergeant's order is not: with the major's actual order in place, no value of \(S\) changes the advance, and there is no other variable to hold fixed. In a model with only two values per order (order or no order) the case collapses into overdetermination and neither order alone is a cause; the verdict depends on the model, which is the general lesson of Halpern and Hitchcock about choosing variables.

Notes and sources

Sources

Texts: Pearl, Causality (2000; 2nd ed. 2009); Pearl and Mackenzie, The Book of Why (2018); Spirtes, Glymour and Scheines, Causation, Prediction, and Search (1993; 2nd ed. 2000); Woodward, Making Things Happen (2003); Halpern, Actual Causality (2016); Paul and Hall, Causation: A User's Guide (2013); Imbens and Rubin, Causal Inference for Statistics, Social, and Biomedical Sciences (2015); Hernán and Robins, Causal Inference: What If (2020); Peters, Janzing and Schölkopf, Elements of Causal Inference (2017); Beebee, Hitchcock and Menzies (eds.), The Oxford Handbook of Causation (2009); Kim, Mind in a Physical World (1998).

Papers: Hume (1739, 1748); Mill (1843); Russell (1913); Wright (1921, 1928); Neyman (1923); Yule (1926); Reichenbach (1956); Hart and Honoré (1959); Mackie (1965); Suppes (1970); Lewis (1973, 2000); Rubin (1974); Hesslow (1976); Cartwright (1979); Holland (1986); Verma and Pearl (1990); Spirtes and Glymour (1991); Yablo (1992); Balke and Pearl (1994); Card and Krueger (1994); Pearl (1995); Meek (1995); Galles and Pearl (1998); Dawid (2000); Tian and Pearl (2000, 2002); Sober (2001); Robins et al. (2003); Sider (2003); Bennett (2003); Chockler and Halpern (2004); Hall (2004); Halpern and Pearl (2005); Shimizu et al. (2006); Shpitser and Pearl (2006); Huang and Valtorta (2006); Knobe and Fraser (2008); List and Menzies (2009); Hitchcock and Knobe (2009); Deng et al. (2013); Andersen (2013); Halpern (2015); Halpern and Hitchcock (2015); Peters, Bühlmann and Meinshausen (2016); Chernozhukov et al. (2018); Wager and Athey (2018); Zheng et al. (2018); Imbens (2020); Bareinboim, Correa, Ibeling and Icard (2022); Cinelli, Forney and Pearl (2022); Kıcıman et al. (2023); Jin et al. (2023, 2024); Zečević et al. (2023).

About this partfrom its README

Part 17 of Philosophy, Built (series plan, syllabus): the metaphysics and the mathematics of causation. Does smoking cause cancer? (Doll and Hill, Fisher's gene, Cornfield's inequality.) Hume's two definitions and al-Ghazālī's cotton eight centuries earlier; why regularity is not enough; Mill's methods run on a table of fires, Mackie's INUS conditions computed from a Boolean model, and the selection of "the" cause (Hart and Honoré); Lewis's counterfactual analysis, Suzy and Billy (late preemption), trumping, overdetermination, influence, and the boulder against transitivity; Suppes's probability-raising and screening off, Hesslow's pills (two paths that cancel), and Cartwright's effective strategies; Russell's "On the Notion of Cause", Woodward's interventions and invariance; structural causal models, chains, forks and colliders, Berkson's paradox (0.00 → −0.66), and d-separation on the sprinkler graph; the do-operator as graph surgery, the back-door criterion (naive 0.12, adjusted 0.20 = truth, and from 200,000 samples), the front door for smoking, tar and a hidden gene (0.342 = truth), and two models with one distribution and two effects; Pearl's do-calculus, its three rules checked by d-separation along the front-door derivation, completeness (Tian, Shpitser, Huang and Valtorta), and M-bias; the ladder of causation, the firing squad on three rungs, twin networks, and the probabilities of necessity and sufficiency; Halpern and Pearl's actual causation on six classic cases, the late-preemption Price List, normality, and degrees of responsibility; the causal Markov condition, Reichenbach's common cause, Yule's nonsense correlations (40% of independent random-walk pairs have |r| > 0.5), Bell's bound (2 against 2√2), and faithfulness; the PC algorithm from 20,000 samples, Meek's rules, the Markov equivalence class (the Wall's seventeenth brick), and LiNGAM's escape from it; potential outcomes, Rubin's perfect doctor and all 70 randomizations, the bridge to structural models, instruments (OLS 1.07, IV 0.49) and difference in differences (Card and Krueger, +2.7); causal inference at work (CUPED, uplift, double machine learning, invariant causal prediction, and language models); and Kim's exclusion argument as a Price List, with Yablo's pigeon.

The worked model results are computed by the Reasoner's new module explainer/philosophy/reasoner/causal.py (structural models, d-separation, the do-calculus's side conditions, Halpern–Pearl, PC), tested in tests/philosophy/test_causal.py and cached by compute.py.

Chapter notes
# Scene What it establishes Computed on screen
0 Hook Doll and Hill (1950, 1954); Fisher's gene (1958); Cornfield (1959); the plan. —
1 Hume Hume (1739, 1748): two definitions; al-Ghazālī (1095); regularity is not enough; Kant. —
2 Mill Mill's methods (1843); Mackie's INUS conditions (1965); Hart and Honoré (1959). agreement and difference on a table of fires; prime implicants and INUS
3 Lewis Lewis (1973, 2000); Suzy and Billy (Hall 2004); trumping (Schaffer 2000); overdetermination; transitivity. the but-for test on Suzy and Billy
4 Prob Suppes (1970); screening off; Hesslow (1976); Cartwright (1979). Hesslow's pills: P(T) 0.30 either way, direct effect 0.2
5 Intervene Russell (1913); Woodward (2003); invariance; manipulability and anthropocentrism. —
6 Graphs structural causal models (Wright 1921; Pearl 2000); chains, forks, colliders; Berkson; d-separation. Berkson's paradox; seven d-separation queries
7 Do the do-operator; the back-door criterion; the front-door formula; non-identifiability. naive, adjusted and true effects, exact and sampled; the front door; two models, one distribution
8 Calculus Pearl's three rules (1995); completeness (Tian and Pearl 2002; Shpitser and Pearl, Huang and Valtorta 2006); transportability; M-bias. each rule's side condition along the front-door derivation; the bow arc; M-bias (0.30 → 0.22)
9 Ladder association, intervention, counterfactuals; twin networks (Balke and Pearl 1994); PN and PS (Tian and Pearl 2000); the causal hierarchy theorem. the firing squad on three rungs; PN 0.6, PS 0.375, PNS 0.3
10 Actual Halpern and Pearl (2005), modified (Halpern 2015); Price List for late preemption; normality (Halpern and Hitchcock 2015); responsibility (Chockler and Halpern 2004). the definition on six classic cases; responsibility in four elections
11 Markov the causal Markov condition (Spirtes, Glymour and Scheines 1993); Reichenbach (1956); Yule (1926); Sober (2001); Bell and CHSH; faithfulness (Meek 1995; Robins et al. 2003). 11 parameters for 31; 2,000 random-walk pairs; all 16 local strategies
12 Discovery PC (Spirtes and Glymour 1991); Meek's rules; Verma and Pearl (1990), the Wall's seventeenth brick; LiNGAM (Shimizu et al. 2006); FCI, GES, NOTEARS. PC from 20,000 samples; the 3-graph equivalence class; residual dependence both ways
13 Outcomes Neyman (1923), Rubin (1974), Holland (1986); SUTVA; Galles and Pearl (1998); Dawid (2000); Wright (1928); Card and Krueger (1994); Snow (1855). the perfect doctor; all 70 randomizations; IV against OLS; difference in differences
14 Industry CUPED (Deng et al. 2013); uplift; doubly robust and double ML; causal forests; invariant causal prediction (Peters et al. 2016); language models and causal benchmarks. 400 simulated A/B tests; uplift against response targeting; coefficients across environments
15 Mind Kim's exclusion argument (1998) as a Price List; Huxley, Sider, Bennett, List and Menzies; Yablo's pigeon (1992). the Price List's five exits; proportionality on five shades
16 Outro recap; the Reasoner's module; the Wall; problems; payoffs; references. —

Companion material in this repository

The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
  1. Hume's two definitions; al-Ghazālī's occasionalism eight centuries earlier (the cotton and the fire).
  2. Mill's methods; Mackie's INUS conditions.
  3. Lewis's counterfactual analysis (1973) and its dependence chains; early and late preemption; trumping; overdetermination (Suzy and Billy's rocks, drawn).
  4. Probabilistic causation (Suppes, Cartwright) and Simpson's paradox again.
  5. Russell's "On the Notion of Cause" (1913): no causes in fundamental physics? Answers from interventionism.
  6. Interventionism (Woodward 2003): invariance under intervention.
  7. Structural causal models (Pearl): equations, graphs, d-separation. Built: the SCM engine.
  8. The do-operator; the back-door and front-door criteria, each proved and checked by simulation.
  9. The do-calculus's three rules; completeness (Shpitser and Pearl, Huang and Valtorta 2006).
  10. Pearl's ladder: association, intervention, counterfactuals; twin networks; the probabilities of necessity and sufficiency.
  11. Actual causation: Halpern–Pearl (2005, 2015). Built and run on the classic cases (preemption, double prevention, bogus prevention), with where the definition still disagrees with intuition.
  12. The causal Markov condition and faithfulness; Reichenbach's common cause principle (and its failure in quantum correlations, previewing Part 26).
  13. Causal discovery: the PC algorithm (built), recovering a DAG from data up to its Markov equivalence class; FCI with latent variables.
  14. Potential outcomes (Rubin) and their relation to SCMs; RCTs; instrumental variables; difference in differences.
  15. Industry: causal inference in tech (uplift modelling, experimentation platforms); LLMs and causal reasoning benchmarks (frontier, cited).
  16. Causation and the mind: Kim's exclusion argument (previews Part 30).
  17. Recap and Problems.

Built: reasoner.causal (SCMs, do, counterfactuals, Halpern–Pearl, PC). Wall: underdetermination of causal structure by observational data (Markov equivalence); the counterexamples that every analysis of actual causation faces. Price List: the preemption cluster (counterfactual dependence is necessary; Suzy's throw caused the breaking; Billy's would have; transitivity). Visuals: CausalDAG with scissors cutting arrows for do(x); back-door paths glowing; the PC algorithm removing edges round by round. References: Pearl, Causality; Spirtes, Glymour and Scheines; Woodward; Halpern, Actual Causality; Paul and Hall; Hernán and Robins, Causal Inference: What If.

Build the film

python -m videos.philosophy.philosophy17.compute        # the part's numbers, into .cache/philosophy17
python tools/build.py philosophy17                  # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py philosophy17 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/philosophy/philosophy17. Setup: see the course page. Source of these notes: the README and the scenes' narration.

Build it
python -m videos.philosophy.philosophy17.compute       # every computed item (a few seconds; .cache/philosophy17)
python tools/build.py philosophy17 -q l                # 480p preview
python tools/build.py philosophy17                     # 1080p30 -> renders/philosophy17.mp4
python tools/qa_scene.py philosophy17 Discovery        # one chapter, silent, with a contact sheet