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 communicatlion, 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 the previous chapter, I introduced the concept of the data generating process and how it relates to the joint probability distribution of the variables in your modeling domain and the data you use in your model. In this chapter, we'll build our first models of the data generating process using the causal directed acyclic graph (causal DAG) and causal graphical models built on top of that DAG.
Learning causal modeling requires a bit of a mental refactor. Causal modelers don't model the data; they model the data generating process (DGP). That model attempts to capture how variables relate causally instead of just statistically.
The model-the-data mindset works well for predictions. For example, suppose the DGP yields examples of some predictors and a prediction target. A decent predictive modeling approach will pick up on the the statistical patterns stemming from the probabilistic dependence between the predictors and prediction target. That model would probably produce decent predictions.