Suppose an advertising decision raises future revenue. A model trained before that decision may not describe the data collected afterward: the action has changed the process producing the data. That real-world causal process is the data-generating process (DGP). A statistical model can match patterns in recorded outcomes without capturing how decisions change those outcomes. section 2.3 section 7.1.1
Observed data are sampled outcomes, not the DGP itself. For discrete variables, counting each outcome combination and dividing by the sample size gives an empirical joint distribution. A zero count does not establish a zero probability: an outcome may simply be missing from a small sample. The observational joint distribution also leaves out latent variables. Even if that distribution were known, multiple DGPs could be consistent with it. section 2.3.2
Listing 2.11 An example of a DGP in code form
def true_dgp(jenny_inclination, brian_inclination, window_strength): #1
jenny_throws_rock = jenny_inclination > 0.5 #2
brian_throws_rock = brian_inclination > 0.5 #2
if jenny_throws_rock and brian_throws_rock: #3
strength_of_impact = 0.8 #3
elif jenny_throws_rock or brian_throws_rock: #4
strength_of_impact = 0.6 #4
else: #5
strength_of_impact = 0.0 #5
window_breaks = window_strength < strength_of_impact #6
return jenny_throws_rock, brian_throws_rock, window_breaks
The Python function makes causal steps explicit: inclinations determine who throws, throws determine impact strength, and impact strength together with window strength determines whether the window breaks. section 2.3.2
A causal directed acyclic graph (DAG) is a less detailed representation: its arrows state what causes what without specifying every calculation in the underlying process. Scope the graph to the causal question, not just the dataset. Include causally relevant variables even when they were not measured; do not redraw the graph merely to make an effect identifiable from available data. section 3.1.2 section 3.3 section 11.3.5
The assumptions determine which questions a model can answer:
- Statistical assumptions describe associations, such as a conditional relationship fitted by regression or a neural network. section 10.1.2
- A causal DAG adds assumptions about what causes what, supporting reasoning about interventions. section 10.1.2
- Assumptions about how one variable affects another specify mechanisms beyond the DAG’s arrows; structural causal models are an example. section 10.1.2
Prediction versus intervention
Bringing an umbrella does not change future weather. Advertising can change future business performance, so a predictor retrained on post-advertising revenue encounters data from a changed DGP. Treat the advertising decision as an intervention rather than assuming the old predictive relationship will remain reliable. section 7.1.1
When an intervention’s direct targets are unclear, it can be represented explicitly as a root node with edges to variables it might affect. If the resulting causal query is not identifiable with the measured variables, seek additional data rather than changing causal assumptions to fit the dataset. section 7.6.4 section 11.3.5

