Tech Blog · Algorithms Explained
[Prescription Methods 8] Prescribing from causes, not correlations — Causal inference
On days with more chemical dosing, quality was worse. So should you dose less? The confounder trap hidden in operating data, and the conditions needed for historical data to answer "what happens if I change this?"
Aug 13, 2026 · OPTI-X
Series “Prescription Methods” · Part 8
Suppose an analysis of operating data finds that the more chemical was dosed on a given day, the worse the quality. Would dosing less chemical then improve quality?
The surrogate from the previous part faces the same question. A model trained on operating history may predict "on days like this, quality is like that" well, yet still give the wrong answer to "what happens to quality if I change the dosing?"
The trap in operating data: people have already reacted
Usually not. In reality, it is because operators added more chemical on days when the raw material was in poor condition. What made quality worse was the raw material, and the chemical was actually reducing its effect. A variable like raw material condition, which affects both the manipulation and the result, is called a confounder.
Why the correlation appears reversed
Operating data is not experimental data
- 1Raw material condition worsensThe real cause that lowers qualityOperator notices
- 2Operator increases chemical dosingResponds based on experienceQuality still drops somewhat
- 3What remains in the dataA correlation of 'more chemical = worse quality'Learned as is → a wrong prescription to reduce chemical
Split by raw material condition, the relationship can flip. Within the same raw material condition, days with more chemical show better quality, yet pooling all days shows the opposite. Such a reversal is known as Simpson's paradox, and Pearl (2009) describes it as a phenomenon that can be resolved only through a causal interpretation.
Medicine has the same structure. In a hypothetical example from Hernán and Robins (2020), patients in more critical condition are more likely to receive a heart transplant. As a result, the risk ratio of 1.1 from the observational study is a mix of the truly beneficial effect of the transplant and the higher underlying death risk of those who received it.
Fine for prediction, dangerous for prescription
Correlational models vs. causal models
It depends on whether the question is "prediction" or "intervention"
For prediction alone, correlation may be enough. The prediction "if a lot of chemical was dosed, quality is likely to be poor" is itself correct. But prescription asks about an intervention, "if I change the chemical," so it needs causal relationships.
Pearl (2009) expresses this difference with the do operator. "Quality on days with high dosing" conditions on the observed data. "Quality when dosing is set to that value" is computed in a model where the operator's dosing decision rule is deleted and replaced by that fixed value, with all other relationships left unchanged.
He stresses that the distribution of the data alone cannot tell how it would change if conditions changed. Behind every causal conclusion lies a causal assumption that cannot be tested with observational data. Confounders, too, cannot be found or corrected by statistics alone; a judgment about what affects what must come first. And unlike statistical assumptions, the influence of causal assumptions on the conclusion does not shrink as the sample grows. Collecting more data alone does not solve the problem.
Pearl divides causal questions into three kinds. "What happens to quality if I increase the chemical?" is about the effect of an intervention; "what if we had dosed less in yesterday's batch?" is a counterfactual; and "how much of the chemical's effect on quality passes through an intermediate state?" is about direct and indirect effects. Prescription mainly asks the first, and after-the-fact root cause analysis asks the second.
What to adjust for: the back-door criterion
Pearl's back-door criterion is used to choose the variables to adjust for. You choose a set of variables that blocks every back-door path, the paths that start with an arrow coming into the manipulation and lead to the result. The path along which raw material condition sends arrows to both the chemical dosing and the quality is exactly such a back door.
There is one more condition. Variables that change as a result of the manipulation are not put into the adjustment set. An intermediate measurement taken after the chemical is dosed is correlated with both the chemical and the quality, but it is not a confounder. Conversely, some variables correlated with both sides must still be left out of the adjustment.
If you compare within groups defined by variables that satisfy the criterion, the difference in each group is the causal effect in that group. Pearl concludes that in this case the causal effect can be estimated without bias from pre-intervention data, that is, from operating history alone. If several sets satisfy the criterion, you can choose the one that is cheaper to measure or gives more stable estimates.
Variable roles and whether to adjust
Not everything that is correlated gets adjusted for
| Role of the variable | Process example | Include in adjustment? |
|---|---|---|
| Confounder | Something like raw material condition that affects both dosing and quality | Include |
| Variable changed by the manipulation | Intermediate measurement after dosing | Do not include |
| Unrecorded confounder | Raw material condition judged by the operator's eye | Cannot be adjusted for with data alone |
Three conditions for using historical data like an experiment
Hernán and Robins (2020) state that treating observational data like a "conditionally randomized experiment" requires three conditions: the manipulation being compared must be a well-defined intervention that corresponds to the actual manipulation in the data (consistency); the way the manipulation was decided must depend only on measured variables (exchangeability); and at every value of the measured variables, each manipulation must have a probability above zero (positivity).
Translated to a process: "increasing the chemical" must be defined in terms of when, how much and how. The information the operator used to decide must remain in the data. And there must be records of dosing less chemical even on days when the raw material was poor.
The last condition is often broken in operating data. If chemical was always dosed heavily on bad raw material days, the result of dosing less on such days is not in the data. The authors explain that, unlike exchangeability, positivity can sometimes be checked with the data. A starting point is to count, in a table, whether several dosing levels are recorded within each raw material condition band.
The three conditions as process questions
If any answer is no, it is hard to claim a prescription effect from data alone
When data is not enough: small, planned changes
Of the three conditions, exchangeability cannot be verified with observational data. Hernán and Robins explain that in an ideal randomized experiment these conditions hold by design. Rubin (1974) likewise concludes that randomization should be used whenever possible, but that estimating causal effects from carefully controlled nonrandomized data is a reasonable and necessary procedure in many cases.
Approaches to estimating causal effects from data
No method is perfect; the key is to make assumptions explicit
A fully randomized experiment is hard on a process. But deliberately changing the chemical dosing slightly within the allowed range is often possible. A change decided independently of the operator's judgment provides grounds for cutting off confounding within that range.
This is also why knowledge from the floor matters. Only when you know what operators look at when they change a manipulation can you know what to adjust for in the data.
Relationship to other methods
In the design of experiments in Part 2, the person running the experiment decides the manipulations in advance, so operators' judgment does not get in. Causal inference tries to recover the effect of manipulations from operating data that accumulated without such a plan.
Offline reinforcement learning in Part 5 and surrogates in Part 7 cannot avoid the same question. Levine et al. (2020) explain that the core of offline reinforcement learning is answering the counterfactual question "what if we had acted differently from the data?" If the actions in the data were decided by operators' judgment, confounding can creep into that answer.
Prescription asks "what happens if I change this?", so you must first check what judgments shaped the data as it accumulated. In the next part, we wrap up the series with criteria for choosing and combining prescription methods to fit the problem.
References
- Cambridge University Press, 2nd ed. (Pearl), "Causality" (2009-09-14) ↗
- Journal of Educational Psychology 1974 (Rubin), "Estimating causal effects of treatments in randomized and nonrandomized studies" ↗
- Statistics Surveys 2009 (Pearl), "Causal inference in statistics: An overview" ↗
- Chapman & Hall/CRC 2020 (Hernán and Robins), "Causal Inference: What If" ↗
- arXiv 2020 (Levine et al.), "Offline Reinforcement Learning: Tutorial, Review, and Perspectives on Open Problems" (2020-05-04) ↗
Could this work for your process?
Talk to us