liveBook · Manning

Causal graphical model

As explained in Causal AI

A causal generative model is a generative probabilistic model whose structure represents causal mechanisms and supports intervention-based generation of distributions.

Suppose an urban planner wants to understand what shapes a person’s commute. A model that predicts travel choices from survey columns is not enough to answer what might change those choices. A causal graphical model starts with assumptions about the data-generating process: which variables cause which others, including variables the survey did not measure. section 3.1.1 section 3.3

Its scaffold is a causal directed acyclic graph (DAG). Nodes are variables; an arrow from one node to another asserts that the first causes the second. The graph communicates *what causes what*, not the strength or functional form of a cause’s effect. Those details belong in a probabilistic model built on the graph. section 3.1 section 3.1.3

Modeling a commute

One proposed graph has age and gender pointing to education; education pointing to occupation and residence; and occupation and residence pointing to travel choice. If A, S, E, O, R, and T denote those variables, its joint distribution factors as P(A)P(S)P(E|A,S)P(O|E)P(R|E)P(T|O,R). Each factor conditions a variable on its direct parents. This is a set of strong causal and conditional-independence assumptions, not a pattern established merely by fitting the survey. section 3.1.1 section 3.1.6

Listing 3.2 Building the transportation DAG in pgmpy
from pgmpy.models import BayesianNetwork
model = BayesianNetwork(    #1
       [
        ('A', 'E'),    #2
        ('S', 'E'),   #2
        ('E', 'O'),   #2
        ('E', 'R'),   #2
        ('O', 'T'),   #2
        ('R', 'T')    #2
     ]
)

The pgmpy listing makes the proposed commuting assumptions concrete as a list of directed edges; it specifies graph structure, not learned probabilities. section 3.1.1

To make the graph generative, assign each node a causal Markov kernel: a distribution for that node given its parents. These kernels can use conditional probability tables, regressions, or neural networks; their parameters can be learned with methods such as maximum likelihood or Bayesian estimation. Treating kernels as distinct mechanisms gives the model parameter modularity and a potential source of invariance when settings change. section 3.2 section 3.5

A practical workflow is:

  • Start with the causal question, then include relevant causes even when they are absent from the dataset; add variables needed for causal analysis and for a clear account of the process. section 3.3 section 3.5
  • Specify arrows using domain assumptions, then choose and learn the parent-conditioned kernels. If a variable is latent, its kernel may require a method such as structural expectation maximization—and its parameters may not be identifiable from the available data. section 3.1.1 section 3.1.10
  • Seek evidence against the graph. Its implied conditional independences can be checked against data; a detected dependence where independence was asserted calls for revision. Such tests are useful for refutation, not proof that the graph is true. section 4.1 section 4.3

A well-fitting graphical model is therefore not automatically a sound causal model. The graph omits mechanism details and may omit measured-data distinctions; latent variables can limit what its parameters reveal. Keep its assumptions explicit, test what can be tested, and use it as a scaffold for downstream causal questions rather than as a guarantee of causal truth. section 3.1.3 section 4.3

How Causal AI covers it

How deep it goes
Works through graph construction, parent-conditioned factorization, parameter learning, and refutation; defers more sophisticated neural-network models.
Examples
Uses commuting choices, rock throwing, and digit handwriting to make causal assumptions concrete.
What it assumes
Assumes some familiarity with probability and Python while defining the causal DAG and developing parent-based factorization.
What you can do after
Build it from scratch with pgmpy, learn its parameters, and diagnose conflicting conditional-independence claims through refutation.
How it connects
Links causal Markov kernels, conditional independence, parameter modularity, d-separation, latent variables, and causal discovery.

Also explained in

Compare how 2 books explain causal graphical model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal AI. The section links point to the parts of the book it draws on.