Research › Interactive tools

Granger causality with a hidden confounder

Does \(X\) help predict \(Y\)? If an unobserved driver \(Z\) moves both, a naive test says yes even when there is no link. Simulate a hidden confounder, give the test some noisy proxies of it, and compare the naive, proxy-adjusted and oracle tests. Based on Yin & Barucca, Expert Systems with Applications (2022), with code on GitHub. Everything runs in your browser.

Held-out prediction error of Y

For each test, the restricted model leaves out the lags of \(X\) and the full model adds them. Error bars are ±2 standard errors of the mean squared error on the test set (last 30% of the series).

The series (last 250 steps)

The hidden confounder \(Z\), its proxy average \(\hat Z\), the candidate cause \(X\) and the effect \(Y\), each standardised.