Suppose a revenue model learns that signs of a bad quarter predict higher revenue. The company may have responded to those signs by advertising, which raised revenue. If the model later drives advertising decisions, its decisions change the data-generating process it was trained to predict. An intervention is an action that changes that process; a causal model must be able to reason about the resulting change. section 7.1.1 section 7.0
An ideal intervention, written do(X=x), targets X, fixes it at x, and blocks the influence of X’s causes. Its consequences can still propagate to variables downstream of X, changing their distributions. This differs from observing X=x: observation can retain information about the causes of X. Thus, asking what purchases would be if engagement were high is not the same as asking about purchases among players whose engagement happens to be high. section 7.2 section 8.2.3
An intervention operator makes that change explicit in a causal model:
- In a structural causal model, replace the target’s assignment function with the intervention value. section 7.2.2
- In a causal DAG, remove edges entering the target. In a causal graphical model, also replace its causal Markov kernel with a distribution placing all probability on the chosen value. section 7.2.5
- In Pyro, pyro.do replaces a targeted pyro.sample result with the specified value. Do not assume every library method named do implements an ideal intervention: the described pgmpy BayesianNetwork.do does not fix the target to a supplied value. section 7.2.6 section 7.2.5
From a hypothetical change to a distribution
To ask how height would vary if femur length were 46 cm, apply pyro.do to set the femur variable to 46, repeatedly sample from the resulting model, and plot the sampled heights. The histogram represents an interventional distribution, not merely heights observed among people with a 46 cm femur. section 9.3.2
Comparing expected outcomes under two interventions yields a causal effect, such as an average treatment effect; conditioning those expectations gives a conditional average treatment effect. Random assignment is a stochastic intervention rather than a fixed-value intervention. It can eliminate incoming influence from unknown common causes that a nonrandom assignment rule might leave intact. section 7.7 section 7.5.1
The modeled intervention must match a meaningful action. If a stressor has no clear single target or fixed value, it may be more practical to represent it as a root node affecting several variables than as an ideal intervention. When a real intervention is feasible, compare its outcome with the model’s prediction; a conflict refutes the model. Predictions can also help prioritize which costly interventions to test. section 7.6.4 section 7.6.2

