3 Building a Causal Graphical Model
This chapter covers
- Building a causal directed acyclic graph (DAG) to model a data generating process
- Using your causal graph as a communication, computation and reasoning tool
- Building a causal DAG in pgmpy and pyro (PyTorch)
- Training a probabilistic machine learning model using the causal DAG as a scaffold.
In this chapter, we'll build our first models of the data generating process using the causal directed acyclic graph (causal DAG) – a directed graph without cycles where the edges represent causal relationships. We’ll also look at how to train a statistical model using the causal DAG as a scaffold.
3.1 Introducing the causal DAG
Let’s assume we can partition the DGP into a set of variables where a given combination of variable values represents a possible state of the DGP. Those variables may be discrete or continuous. They can be univariate, or they can be multivariate vectors or matrices.
A causal DAG is a directed graph where the nodes are this set of variables and the directed edges represent the causal relationships between them. When we use a causal DAG to represent the DGP, we assume the edges reflect true causality in the DGP.