What are Causal Graphs?

A Gentle Guide to Causal Inference with Machine Learning Pt. 3

Jakob Runge
Causality in Data Science
6 min readMar 14, 2023

--

Sometimes we need to give things a visual structure to understand them. That’s not only true for learning how brain cells work in school. It is also true for understanding any kind of phenomena. In causal inference, the most important way to depict causal relationships is via so-called Causal Graphs. So let’s use the next article and family Skywalker to understand them. May the force be with you!

Basic Graphs

In simple words, a graph is a network. You have nodes V, say V = {X, Y, Z}, and you have edges E. The edges connect two nodes, while each node represents a (random) variable. Edges and nodes together make up a graph G = (V, E) that can be depicted as shown below.

There are many examples of graphs. For example, the instagram network could be depicted by a graph, with the users being the nodes and the edges representing whether these people are friends or not. Such big graphs tend to look more beautiful than the simple ones. But beware, the more beautiful they are, the more complex it gets to understand their relations!

(Baird et al., 2012)

From Graphs to Node Relationships: Directed Acyclic Graphs

To represent causal relations, we need to move from undirected to directed graphs. Then we can express relations between nodes by kinship relations and speak of parents, children, ancestors, and descendants.

Let’s use i and j to indicate two nodes in a graph. Then node i is a parent of j if the graph contains the edge E(i,j) but not E(j,i). In other words, node i is a parent of j when there is an edge from i to j but not the other way around (Darth Vader for example “caused” Luke Skywalker to be there but not the other way around). Node j is then called a child.

Node i and j are also called to be adjacent which means that they are connected. If all nodes of G would be adjacent, then we would have a fully connected graph.

As you probably noticed, the concept of direction is necessary for defining parents and children. If all edges in G have such directions we speak of a directed graph. If you encounter the term “skeleton”, this is the simplified graph that does not take the directions into account. Thus, there is no distinction between two graphs with different directions if the same nodes are adjacent.

A more specific version of a directed graph is a directed acyclic graph, also called DAG. It can be characterized as a directed graph without directed cycles. Simply speaking, there is no loop in the system (e.g., altitude causes temperature but not also the other way around). The rationale behind this restriction is that trying to identify a reason prohibits the reason from being the reason of itself, otherwise we could not identify a reason (makes sense, right?). We will learn more about cyclic graphs and how they often can be resolved in later blog posts.

Nodes do not have to be directly connected through one edge. Sometimes they are connected through several edges (similar to Luke Skywalker being connected to Shmi Skiwalker, his grandmother). The list of distinct nodes you “walk” along from i to j is called a path. This path can include several edges or just one, but a path has no repeated nodes. If the edges on a path are all oriented from i to j, i is an ancestor of j and j a descendant of i.

From DAGs to Causal Graphs

What makes a DAG a causal graph? Well, essentially it is the interpretation that we give to the directed edges. If we assume that they represent a causal relationship between the connected nodes along with the direction of the edge, we found a visual representation of a causal relation (e.g. Shim Skywalker directly causing Darth Vader and indirectly Luke Skywalker). This makes causal graphs very powerful, as they provide us with an intuitive way to represent complex causal phenomena, while also helping us make the distinction between causal and non-causal associations.

It is important to note that every edge in a causal graph indicates a direct and no indirect causal effect or correlation through other nodes of the graph. This not only makes our graphs less complex, but also enables us to model the effect of interventions (read more on interventions in another article).

For now, let’s call it a blog post. In the next one, we will discuss important concepts of relationships within causal graphs and how they influence the process of uncovering causal relationships. More specifically we will discuss Simpson’s paradox, confounding, colliders, mediators, and d-separation, before moving on to some of the most important assumptions that help us identify causal effects in an observational setting. Follow each blog post step by step. It will get more and more intriguing.

Thanks for reading!

About the authors:

Kenneth Styppa is part of the Causal Inference group at the German Aerospace Center’s Institute of Data Science. He has a background in Information Systems and Entrepreneurship from UC Berkeley and Zeppelin University, where he has engaged in both startup and research projects related to Machine Learning. Besides working together with Jakob, Kenneth worked as a data scientist at BMW and currently pursues his graduate degree in Applied Mathematics and Computer Science at Heidelberg University. More on: https://www.linkedin.com/in/kenneth-styppa-546779159/

Jakob Runge heads the Causal Inference group at German Aerospace Center’s Institute of Data Science in Jena and is chair of computer science at TU Berlin. The Causal Inference group develops causal inference theory, methods, and accessible tools for applications in Earth system sciences and many other domains. Jakob holds a physics PhD from Humboldt University Berlin and started his journey in causal inference at the Potsdam Institute for Climate Impact Research. The group’s methods are distributed open-source on https://github.com/jakobrunge/tigramite.git. More about the group on www.climateinformaticslab.com

Picture References:

Oleson, E. M., Boggs, C. H., Forney, K. A., Hanson, M. B., Kobayashi, D. R., Taylor, B. L., … & Ylitalo, G. M. (2012). Reevaluation of the DPS designation for Hawaiian (now Main Hawaiian Islands) insular false killer whales. Honolulu, HI.

--

--

Jakob Runge
Causality in Data Science

Jakob Runge heads the Causal Inference group at German Aerospace Center’s Institute of Data Science in Jena and is a guest professor at TU Berlin.