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 hidden confounder \(Z\), its proxy average \(\hat Z\), the candidate cause \(X\) and the effect \(Y\), each standardised.
Run 40 independent series with the link absent and 40 with it present, at the current settings, and count how often each test says "X Granger-causes Y". A good test has a low false-positive rate and a high detection rate. Press Error rates.
Vary the noise on \(Y\) with the link present and follow the p-value of each test, as in the paper's signal-to-noise analysis: below a critical signal-to-noise ratio the true link is no longer detected. Press Noise sweep.
Mean over 6 seeds per point, log scale. The dashed line is \(p=0.05\). Signal-to-noise \(\gamma=\frac{1}{T}\sum_t|s_t|/\sigma\), with \(s_t\) the noise-free part of \(Y\), as in the paper.
Zexuan Yin's work with me
Zexuan's PhD at UCL (2024, co-supervised with Fabio Caccioli) was about forecasting time series driven by quantities we never observe: regimes, volatility, confounders. Neural networks with latent variables carry that hidden state.
- Deep recurrent modelling of Granger causality with latent confounding. Z. Yin, P. Barucca, Expert Systems with Applications 207, 118036 (2022). Journal · arXiv · Code. A GRU infers a substitute confounder from proxies; a dual decoder gives restricted and full predictive distributions trained jointly; a t-test on their errors decides. It finds the right answer in every synthetic scenario and on Danube river discharges, where LPCMCI and SVAR-FCI report a spurious link or miss a true one.
- Stochastic recurrent neural network for multistep time series forecasting. Z. Yin, P. Barucca, Neural Information Processing (ICONIP 2021), Springer, pp. 14–26. arXiv. A GRU with a latent random variable in its transitions, trained by variational inference, gives probabilistic multistep forecasts and beats its deterministic counterpart on six public datasets.
- Variational heteroscedastic volatility model. Z. Yin, P. Barucca (2022). arXiv. A variational autoencoder for the dependence between assets and a recurrent network for its dynamics produce time-varying covariance matrices, compared with GARCH and stochastic volatility models on multivariate FX data.
- Neural time series forecasting with latent dynamics. Z. Yin, PhD thesis, UCL (2024). UCL Discovery.
Results in the paper
| Scenario | Truth | Deep latent model | LPCMCI | SVAR-FCI |
|---|---|---|---|---|
| Dataset 1 | causal | causal | causal | causal |
| Dataset 1 | not causal | not causal | causal | causal |
| Dataset 2 | causal | causal | not causal | not causal |
| Dataset 2 | not causal | not causal | not causal | not causal |
| Danube (Iller → Danube, lagged) | not causal | not causal | not causal | not causal |
Detection needs enough signal: in the paper the true link stops being detected below a signal-to-noise ratio of about 59 for Dataset 1 and 28 for Dataset 2.
Granger causality
\(X\) Granger-causes \(Y\) if the past of \(X\) improves the forecast of \(Y\) beyond what the past of \(Y\) (and of everything else we condition on) already gives. Compare a restricted predictor with a full one,
$$\hat Y^{\,\text{res}}_{t}=f\big(Y_{t-L:t-1},\,C_{t-L:t-1}\big),\qquad \hat Y^{\,\text{full}}_{t}=g\big(Y_{t-L:t-1},\,X_{t-L:t-1},\,C_{t-L:t-1}\big),$$where \(C\) is the conditioning set. If an unobserved \(Z\) drives both \(X\) and \(Y\), the past of \(X\) carries information about \(Z\) and therefore about \(Y\), and the test reports a link that is not there. Conditioning on \(Z\) removes it; when \(Z\) is hidden, the paper infers a substitute from proxies.
Data-generating processes
Following the paper's synthetic datasets, with a more active confounder and noisier observations of \(X\), so that the effects are visible in short series:
$$Z_t=0.95\tanh(Z_{t-1})+0.3\,\varepsilon_t,\qquad X_t=\sigma(c\,Z_{t-2})+\sigma_X\varepsilon_t,$$Dataset 1: \(Y_t=\sigma(c\,Z_{t-4})+\beta\,\sigma(4X_{t-2}-2)+\sigma_Y\varepsilon_t\). Dataset 2: \(Y_t=\tfrac{c^2}{4}Z_{t-3}Z_{t-4}+16\beta\,(X_{t-1}-\tfrac12)(X_{t-2}-\tfrac12)+\sigma_Y\varepsilon_t\). \(\sigma\) is the logistic function, \(\varepsilon\) standard Gaussian noise, \(c\) the confounder strength and \(\beta\) the link (zero when absent). Proxies are \(U^{(i)}_t=Z_t+\sigma_U\varepsilon^{(i)}_t\) or \(Z_t^2+\sigma_U\varepsilon^{(i)}_t\), and \(\hat Z_t\) is their average.
Three tests
- Naive: \(C\) is empty, the classical bivariate test.
- Proxy-adjusted: \(C=\hat Z\), the average of the proxies, standing in for the paper's GRU encoder of the proxies.
- Oracle: \(C=Z\), the hidden confounder itself; the best any method could do.
Predictors and verdict
Inputs are the standardised lags. Each predictor is a ridge regression (penalty 1) on the inputs and on \(M\) random features \(\tanh(w_k^\top x+b_k)\) with \(w_k\sim\mathcal N(0,1/d)\), a fast stand-in for the paper's recurrent networks. Models are fitted on the first 70% of the series. On the remaining 30%, with \(d_t=e^{\text{res}}_t{}^2-e^{\text{full}}_t{}^2\), the one-sided paired t-test of \(\mathbb E[d]>0\) gives the p-value; below 0.05 the verdict is "X Granger-causes Y". The paper instead draws 50 predictive samples from each decoder and runs a two-sample t-test.
What to try
- Link absent, \(n=0\): the naive test is fooled; add linear proxies and the adjusted test recovers.
- Switch to squared proxies: the sign of \(Z\) is lost, and the adjusted test drifts back toward the naive one.
- Set random features to 0 with Dataset 2: the linear test cannot see the product structure and misses the true link.