01 — Causality

Causality and ML-3

Introduction

This post primarily serve to shape and understand causality in terms of Directed Acyclic Graphs (DAGs), for myself.

Directed Acyclic Graphs (DAGs)

A core assumption of DAGs is that cycles (mututal causations) are excluded. In other words, feedback loops between variables are omiited. This can be done if we assume that the observation period of the variables is sufficiently defined to exclude such mutual dependencies. For example, price and demand relationship may have cycle if a long period of time is considered. DAGs do not always show causal relationships. Bayesian Networks also use DAGs, and it represents conditional dependencies between random variables.

Markov Assumption

When given a set of random variables, we can use the ‘chain rule’ to decompose the joint probability of the random variables, into a product of conditional probabilities. The Markov Assumption can reduce the terms appearing in this decomposition, by only retaining the terms which has random variables conditioned on their parents only. A more generalized concept is the ‘Markov Blanket’ - a random variable is conditionally independent of the entire network if its Markov Blanket is given. The Markov Blanket contains its parents, children and co-parents.

graph LR
  A([A]) --> B([B]) --> C([C])
  A([A]) --> D([D])

For example, the joint distribution in the above DAG now would be,

\[P(A,B,C,D) = P(A)*P(B|A)*P(D|A)*P(C|B)\]

This is because $A$ is not a parent of C, under the Markov assumption.

d-Separation

d (dependency)-separation is applied to ‘paths’, at its simplest level. However, it is nodes that we are interested in. Two nodes (variables) are said to be d-separated if all the ‘undirected’ paths between the two nodes are blocked. The opposite of this is d-connectedness. Such blocked paths would mean that the two variables are independent, when conditioned on $Z$ - some other variables that lie on the paths. The three common paths in a DAG are the chain (mediator), fork and the collider patterns. Only with collider, no conditioning is needed to block a path as it is naturally blocked. ‘Berkson’s Paradox’ is an example for the spurious correlations (resulted by the dependency) created by conditioning on collider. In the same DAG above, it can be said that, $A ⊥ C|B$ as conditioning on $B$ blocks the only path from $A$ to $B$. In its unconditioned version, $A$ and $C$ are not independent.

Markov Equivalence

A major limitation of Bayesian networks is that they do not guarantee to preserve the causal relationships within their decomposition of the joint probability. This happens because the decomposition does not have a unique DAG, and one decomposition can represent many DAGs (with different directions, same variables) - Markov equivalent graphs. At the core, this happens for a simple reason - the joint probability representation is not unique. The two rules to identify equivalent graphs are,

  1. The undirected graph of the DAG has the same skeleton.
  2. If exists, they should have the same collider patterns (‘v-structure’).

Removing confounders

Counfounding mainly comes from backdoor paths which need conditioning. The 3 main adjusting methods are,

  1. Backdoor adjustment - coondition on the confounder
  2. Disjunctive Cause Criterion - without trying to find the confounders, condition on all the parent variables of the treatment, that are also not the decsendent of the outcome variable.
  3. Frontdoor adjustment - when faced with unknown confounders/backdoors, use a mediator variable. First, measure the effect of the treatment of the mediator. Then, measure the effect of the mediaor on the outcome, while conditioning on the treatment. Finally, combine them. It has to be ensured that the mediator has no backdoor path to the outcome variable.

Sampling methods

References

[1] - Notes on causal inference and directed acyclic graphs, Lansdell, Ben.