chapter three

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.

3.1 Introducing the causal DAG

3.1.1 How does a directed acyclic graph work as a causal model?

3.1.2 Case Study: A causal model for transportation

3.1.3 Why is it a directed acyclic graph?

3.2 The benefits of the DAG as a causal representation

3.2.1 DAGs are useful in communicating and visualizing causal assumptions.

3.2.2 It is easy to compute over DAGs.

3.2.3 DAGs link causality to conditional independence

3.2.4 DAGs can provide scaffolding for probabilistic ML models.

3.3 Building a probabilistic machine learn model on a causal DAG

3.3.1 Training a model on the causal DAG

3.3.2 Different techniques for parameter learning

3.3.3 Learning parameters when there are latent variables

3.3.4 Inference with a trained causal probabilistic machine learning model

3.4 Your causal question scopes the DAG

3.4.1 Causal DAGs for causal effect estimation

3.5 Causal invariance and parameter modularity

3.5.1 Independence of mechanism and parameter modularity

3.5.2 Causal invariance and domain transfer

3.5.3 Fitting parameters with common sense