2. Causal graphs and structural causal models for process engineering

In process engineering, we rarely ask purely associational questions. We ask whether increasing reactor temperature causes higher yield, whether a new catalyst reduces impurity formation, or whether a control-loop retune improves settling time. Answering these questions requires a formal language for encoding cause-and-effect assumptions. That language is the structural causal model (SCM), and its most practical visual representation is the directed acyclic graph (DAG).

From Process Knowledge to a DAG

A DAG is a set of nodes (variables) connected by directed edges (arrows) that carry causal meaning. An arrow X → Y asserts that X is a direct cause of Y relative to the other variables in the graph. The "acyclic" constraint forbids feedback loops in the causal structure itself — a subtle point in process engineering, where physical recycle streams and control loops abound. The resolution is to unroll feedback in time: a controller output at time t affects the process variable at t+1, which affects the controller output at t+2. The resulting time-indexed graph is acyclic.

Consider a distillation column where we want to estimate the causal effect of reflux ratio R on top-product purity P. A naive DAG might be simply R → P. But feed composition F influences both the operator's choice of reflux ratio and the achievable purity, so F is a confounder: F → R and F → P. Ignoring F biases the estimated effect of R on P.

Confounders, Mediators, and Colliders

Three structural roles dominate practical causal reasoning:

  • Confounder (common cause): X ← C → Y. Conditioning on C blocks the non-causal path and is usually necessary. In our column example, F is a confounder.
  • Mediator (on the causal path): X → M → Y. Conditioning on M blocks part of the causal effect, so it should not be adjusted when estimating the total effect of X on Y. If reboiler duty Q mediates the effect of feed rate on bottom composition, adjusting for Q removes the very mechanism we want to measure.
  • Collider (common effect): X → Z ← Y. Conditioning on Z opens a spurious association between X and Y. This is the classic "explaining-away" or selection-bias trap. For instance, if both high reactor temperature and high catalyst loading can independently cause a product to pass QC, then restricting analysis to passed batches induces a negative correlation between temperature and catalyst loading even if none exists in the population.
Common pitfall: "Adjust for everything you measured" is not a valid identification strategy. Adjusting for mediators destroys causal effects; adjusting for colliders creates bias where none existed. The DAG tells you which variables belong in the adjustment set — and which must be left alone.

Backdoor Paths and the Backdoor Criterion

A backdoor path is any path from treatment X to outcome Y that begins with an arrow pointing into X. Such paths transmit non-causal (confounding) association. The backdoor criterion states that a set S is sufficient for adjustment if:

  1. Every backdoor path from X to Y is blocked by S, and
  2. No element of S is a descendant of X.

Blocking a path means conditioning on a non-collider along it (or on a collider's non-descendant, which is more advanced). In the distillation example, S = {F} satisfies the backdoor criterion: it blocks R ← F → P and contains no descendant of R. The adjusted estimand is therefore P(P | do(R=r)) = Σ_f P(P | R=r, F=f) P(f), which can be computed by stratification or by fitting a model that includes F as a covariate.

Causal Structure of a Distillation Column Example Feed Composition F (confounder) Reflux Ratio R (treatment) Top Purity P (outcome) Reboiler Duty Q (mediator) QC Pass/Fail Z (collider) backdoor path: R ← F → P Legend Confounding path Causal path

Structural Causal Models: Equations Behind the Graph

A DAG is the qualitative skeleton; an SCM adds functional form. Each node is assigned a structural equation:

F  := U_F
R  := f_R(F, U_R)
Q  := f_Q(R, U_Q)
P  := f_P(R, Q, F, U_P)
Z  := f_Z(R, P, U_Z)

Here U_* are exogenous noise terms representing unmodeled influences. The key semantic difference from a regression equation is the := assignment: it encodes direction and invariance. P := f_P(R, Q, F, U_P) means that if we intervene to set R = r, the distribution of P changes according to f_P, while the equation for R is replaced by the constant r. This is the do-operator: do(R = r) surgically removes the arrow F → R.

In practice, process engineers rarely know f_P exactly. The SCM framework still helps because identification — deciding which variables to adjust for — depends only on the graph structure, not on the functional form. Once the adjustment set is fixed, any consistent estimator (linear regression, gradient boosting, matching) can be applied.

A Practical Workflow for Building and Using DAGs

  1. List variables from the process flow diagram, historian tags, and operator logs. Include treatment, outcome, and candidate confounders, mediators, and colliders.
  2. Draw arrows using engineering knowledge: mass/energy balances, control logic, and known disturbances. When uncertain about edge direction, note it explicitly.
  3. Identify the adjustment set using the backdoor criterion. Software such as dagitty or pgmpy can enumerate minimal sufficient sets.
  4. Check for colliders and mediators in your candidate set and remove them from the adjustment list.
  5. Estimate the causal effect using the chosen set, then run sensitivity analysis for unmeasured confounding.
Practical heuristic: If a variable is measured after the treatment is applied, it is a descendant of the treatment and must not be used as a confounder adjustment. This single rule prevents most mediator and collider mistakes in process data.

Worked Example: Estimating the Effect of Reflux Ratio on Purity

Suppose a historian contains 500 batches with columns F, R, Q, P, and Z. A naive regression of P on R alone yields a coefficient of +0.42 purity points per unit reflux. But the DAG shows a backdoor path through F. After including F as a covariate, the coefficient drops to +0.18. The difference (0.24) is confounding bias: operators tended to raise reflux when feed composition was already favorable, inflating the apparent effect.

If we additionally adjusted for Q (the mediator), the coefficient would fall further — but that would estimate only the direct effect of R on P not mediated by reboiler duty, which is usually not the total effect we want. And if we conditioned on Z (QC pass/fail), we would introduce collider bias, potentially flipping the sign of the estimate. These three numbers — 0.42, 0.18, and the collider-biased value — illustrate why the DAG must be drawn before the regression, not after.

Key Takeaways

  • DAGs encode causal assumptions; SCMs add functional form and the do-operator.
  • Confounders must be adjusted; mediators must not; colliders must not.
  • The backdoor criterion provides a graphical test for a valid adjustment set.
  • In process engineering, time-unrolling resolves apparent feedback cycles into acyclic graphs.
  • Identification is a graphical problem; estimation is a statistical one. Solve them in that order.