Distributionally Robust Local Non-parametric Conditional Estimation

Viet Anh Nguyen, Fan Zhang, José H. Blanchet, Erick Delage, Yinyu Ye

TL;DR

This paper introduces a distributionally robust framework for local non-parametric conditional estimation (such as conditional mean or quantile regression) using an $\infty$-Wasserstein ambiguity set. By perturbing both covariates and responses within a local neighborhood, the proposed estimator systematically robustifies classical $k$-nearest neighbors and can be efficiently solved via convex optimization (including second-order cone programming).

What Problem Does This Paper Address?

Estimating conditional statistics—such as the regression function $\mathbb{E}[Y \mid X = x_0]$ or conditional quantiles—is a cornerstone of statistical learning. Classical non-parametric estimators (like $k$-nearest neighbors and kernel regression methods such as Nadaraya-Watson) typically estimate local quantities by smoothing over a neighborhood around $x_0$.

However, these classical approaches assume homogeneous, well-behaved data generating distributions (e.g., stationarity, weak dependence). Consequently, they struggle when:

  1. Training sample sizes are small.
  2. The covariate distribution has abrupt density jumps or spatial heterogeneity.
  3. The data are subject to adversarial corruption or label noise.

While previous distributionally robust optimization (DRO) methods handle response-variable perturbations, handling perturbations to both covariates $X$ and responses $Y$ under a conditioning event $\mathbb{P}(X = x_0) = 0$ presents major analytical and computational hurdles.

Methods

The authors formulate the Distributionally Robust Conditional Mean Estimator (DRCME) by relaxing the conditioning event $X = x_0$ to a local neighborhood $\mathcal{N}_\gamma(x_0) = \{x : \mathbb{D}_X(x, x_0) \le \gamma\}$ and solving a min-max problem:

$$\min_{\beta} \sup_{Q \in \mathcal{B}_\rho^\infty, \, Q(X \in \mathcal{N}_\gamma(x_0)) > 0} \mathbb{E}_Q \left[ \ell(Y, \beta) \;\middle|\; X \in \mathcal{N}_\gamma(x_0) \right]$$

Key methodological components include:

  • Type-$\infty$ Wasserstein Ambiguity Ball ($\mathcal{B}_\rho^\infty$): An ambiguity ball centered at the empirical measure $\widehat{\mathbb{P}}$ bounding the maximum pointwise perturbation distance by $\rho$.
  • Local Index Partitioning: Only samples within distance $\rho + \gamma$ from $x_0$ affect the worst-case distribution. The sample indices $\mathcal{I}$ are split into those strictly inside the neighborhood ($\mathcal{I}_1$) and those on the boundary ring ($\mathcal{I}_2$).
  • Quasi-Closed-Form Evaluation: The inner worst-case conditional loss reduces to evaluating independent worst-case perturbations $v_i^*(\beta)$ for each local point, followed by a simple sorting and greedy weighting procedure.
  • Tractable Convex Reformulations: For 1D outputs, the problem is solvable via golden section search. For multivariate outputs with $\ell_2$ or $\ell_\infty$ ground metrics, the authors reformulate the problem into an exact Second-Order Cone Program (SOCP) solvable with off-the-shelf solvers like MOSEK.

Datasets

The authors evaluated the method on two datasets:

  • Synthetic 1D Step-Density Dataset: Covariates $X \in [0, 1]$ generated from a discontinuous, piecewise constant density with jump points at $x = 0.3$ and $x = 0.7$, paired with $Y = \sin(10X) + \varepsilon$ with Gaussian noise $\varepsilon \sim \mathcal{N}(0, 0.01)$.
  • MNIST Handwritten Digits: 60,000 images normalized so that $\|x\|_1 = 1$, evaluated under low-sample regimes ($N = 50, 100, 500$). To test resilience against adversarial corruption, test images were smoothly morphed between digit classes using entropic-regularized Wasserstein barycenters.

Key Insights and Ideas

  • Worst-Case as Maximum Conditional Variance: For squared error loss, the worst-case conditional mean estimate $\beta^*$ exactly equals the conditional mean under the adversarial distribution that maximizes conditional variance in the ambiguity ball.
  • Robustification of $k$-NN: When $\rho = 0$ and the neighborhood radius $\gamma$ is chosen to encompass the $k$-th nearest neighbor, DRCME recovers the standard $k$-NN regression estimator. Adding $\rho > 0$ provides a principled, systematic DRO robustification.
  • Delicate Balance Between $\gamma$ and $\rho$:
  • If $\rho = 0$ and $\gamma \to 0$ appropriately as $N \to \infty$, the estimator is consistent.
  • However, if $\gamma = 0$ and $\rho > 0$ is fixed, the estimator diverges to $+\infty$ almost surely under unbounded noise, illustrating that neighborhood relaxation ($\gamma > 0$) is mathematically vital.
  • Localization Keeps Computation Cheap: Even with huge training datasets, the objective depends strictly on points falling within $\rho + \gamma$ of $x_0$, keeping optimization localized and scalable.

Key Results

  • Synthetic Discontinuous Density: DRCME uniformly outperformed $k$-NN, Nadaraya-Watson (N-W), Nadaraya-Epanechnikov (N-E), and the response-only robust method from Bertsimas et al. (2019) near the density discontinuity ($x_0 = 0.3$).
  • Low-Data MNIST Digit Estimation:
  • When rounded to classification labels, DRCME achieved 36% ($N=50$), 46% ($N=100$), and 71% ($N=500$) accuracy, outperforming all baseline estimators by at least 4 percentage points across every sample size.
  • At $N=500$, DRCME had the highest probability of exact label prediction (66% vs. 60% for N-W and 55% for $k$-NN).
  • Adversarial Resilience: When tested on interpolated Wasserstein barycenters between different digits, DRCME exhibited a "sticking" property—retaining the true label until substantial morphological evidence appeared, whereas Nadaraya-Watson drifted immediately toward intermediate, nonsensical predictions.

Limitations and Future Work

  • Tuning Interdependence: Performance depends on three hyperparameters ($\gamma$, $\rho$, and metric scaling $\theta$), which currently require leave-one-out cross-validation.
  • Asymptotic Sensitivity: If the scaling between $\rho$ and $\gamma$ is miscalibrated as $N \to \infty$, the estimator can lose consistency.
  • Computational Scaling for General Losses: Non-smooth or non-standard multivariate loss functions beyond $\ell_2$/$\ell_\infty$ norms do not map cleanly to SOCPs and must fall back on subgradient optimization methods.

Summary updated

BibTeX
@inproceedings{nguyen2020distributionally,
  author = {Viet Anh Nguyen and Fan Zhang and José H. Blanchet and Erick Delage and Yinyu Ye},
  title = {{Distributionally Robust Local Non-parametric Conditional Estimation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=b72Qx4bSfI},
}
Figure