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 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.

3.1.1 Case study: A causal model for transportation

3.1.2 Why use a causal DAG?

3.1.3 DAGs are useful in communicating and visualizing causal assumptions.

3.1.4 We have many tools for computing over DAGs

3.1.5 Causal DAGs can represent time

3.1.6 DAGs link causality to conditional independence

3.1.7 DAGs can provide scaffolding for probabilistic ML models.

3.2 Building a probabilistic machine learning model on a causal DAG

3.2.1 Training a model on the causal DAG

3.2.2 Different techniques for parameter learning

3.2.3 Learning parameters when there are latent variables

3.2.4 Inference with a trained causal probabilistic machine learning model

3.3 Causal invariance and parameter modularity

3.3.1 Independence of mechanism and parameter modularity

3.3.2 Causal transfer learning, data fusion, and invariant prediction

3.3.3 Fitting parameters with common sense

3.4 Your causal question scopes the DAG

3.4.1 Including variables in causal DAGs by their role in inference

3.5 Looking ahead: model testing and combining causal graphs with deep learning

3.6 Summary