Nonparametric Instrumental Variable Regression through Stochastic Approximate Gradients

Yuri Fonseca, Caio Peixoto, Yuri Saporito

TL;DR

This paper introduces SAGD-IV, a novel algorithm for causal inference that uses functional stochastic gradient descent to solve the notoriously difficult "nonparametric instrumental variable" (NPIV) problem. By directly minimizing populational risk rather than relying on complex minimax games or two-stage least squares, the authors achieve superior stability and the flexibility to handle non-quadratic scenarios like binary outcomes.

Introduction: The NPIV Problem

In causal inference, we often want to know the effect of a treatment ($X$) on an outcome ($Y$). However, unobserved "confounders" frequently affect both, making simple regression biased. Instrumental Variables (IVs) offer a classic solution: finding a variable ($Z$) that affects $X$ but only affects $Y$ through $X$.

When we avoid assuming a linear relationship (the "nonparametric" setting), the math becomes an ill-posed inverse problem. Essentially, trying to recover the true causal function is like trying to un-blur a photo—there are many possible "sharp" images that could result in the same "blurry" observation. Existing methods like DeepIV or DeepGMM often struggle with training instability due to minimax "adversarial" setups, or they are restricted to specific types of data, such as continuous outcomes with additive noise.

Methodology: SAGD-IV

The authors propose Stochastic Approximate Gradient Descent for IV (SAGD-IV). Instead of the usual approach of minimizing empirical error or satisfying moment conditions, they derive an analytical functional gradient for the true populational risk.

The key technical innovation lies in how they estimate this gradient. They decompose it into components that can be estimated using standard supervised learning:

  1. Density Ratio Estimation ($\Phi$): Estimating the ratio of joint densities to marginal densities.
  2. Conditional Expectations ($P$ and $r$): Estimating the relationship between the instrument $Z$ and the other variables.

Because the algorithm is "agnostic" to the underlying model, the authors present two flavors:

  • Kernel SAGD-IV: Uses Reproducing Kernel Hilbert Space (RKHS) methods.
  • Deep SAGD-IV: Uses neural networks for the density ratios and regressions.

Crucially, because they aren't tied to a squared-loss function, they can swap in Binary Cross Entropy to handle causal inference for binary outcomes (e.g., "did the patient recover or not?"), a scenario often neglected in NPIV research.

Experimental Setup

The paper evaluates the method using synthetic data generating processes (DGPs) common in the NPIV literature.

  • Continuous Response: They test four different structural functions: step, abs, linear, and sin.
  • Binary Response: They adapt the continuous DGP to a binary setting using a logistic distribution.
  • Scale: Experiments typically used 3,000 samples for training and 1,000 for testing, ensuring a fair comparison with baseline methods like KIV, DualIV, DeepGMM, and DeepIV.

Key Insights and Results

  • Direct Risk Minimization: Most modern NPIV methods treat the problem as a "saddle-point" or minimax problem (like a GAN). These are notoriously hard to tune. SAGD-IV turns it back into a straightforward minimization problem, which is much more stable.
  • Bypassing the Adjoint Operator: Traditionally, estimating a complex "adjoint operator" ($P^*$) is required in every iteration. The authors show that by using density ratios ($\Phi$), they can compute an unbiased stochastic estimator of the gradient much more efficiently.
Out-of-sample log-MSE boxplots demonstrating the superior stability of SAGD-IV.
  • Stability is King: As shown in the out-of-sample log-MSE evaluations, Kernel SAGD-IV exhibited significantly lower variance across different data realizations compared to state-of-the-art methods like DualIV. In the abs and step function tests, SAGD-IV avoided the high-variance "failures" that plagued other methods. This suggests it is more reliable for real-world applications where you only get one dataset.
Qualitative comparison of estimated structural functions across different NPIV methods.
  • Competitive Performance: SAGD-IV performed on par with or better than state-of-the-art neural and kernel methods across the four continuous test functions, accurately recovering the true structural shapes.
  • Theoretical Guarantees: The authors provide a finite-sample bound on the "excess risk," proving that as you get more data and run more iterations, the algorithm's error converges toward zero.
  • Binary Success: On binary outcome tasks, Kernel SAGD-IV performed remarkably well, uncovering the true structural function where other methods would require significant manual modification to even run.

Limitations and Future Work

  • Operator Dependence: Even the "Deep" version of the algorithm still relies on kernel mean embeddings to estimate the conditional expectation operator ($P$). Finding a purely neural way to estimate this operator for massive "big data" scenarios would be a valuable next step.
  • The Consistency Gap: While the paper proves the risk converges, proving that the estimated function ($h$) converges to the true causal function ($h^*$) remains a challenging research question due to the ill-posed nature of the inverse problem.
  • Binary Deep Learning: Deep SAGD-IV had more trouble with binary outcomes than the kernel version, suggesting that neural network architectures for this specific gradient estimation might need more refinement.

Summary updated

BibTeX
@inproceedings{fonseca2024nonparametric,
  author = {Yuri Fonseca and Caio Peixoto and Yuri Saporito},
  title = {{Nonparametric Instrumental Variable Regression through Stochastic Approximate Gradients}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=VqxODXhU4k},
}
Figure