Abstract
Estimating causal effects from observational data often relies on K-Nearest Neighbour Matching (K-NNM). However, traditional K-NNM uses a fixed $K$ for all samples, which ignores local data variations and can introduce significant bias. This paper introduces Dynamic K-NNM (DK-NNM), a novel approach that leverages sparse representation learning to automatically determine the optimal, personalized $K$ value for each individual. By integrating dynamic neighborhood sizing with propensity and prognostic scores, DK-NNM effectively reduces confounding bias and outperforms traditional matching methods across synthetic and real-world benchmarks.
Introduction
In causal inference, estimating the effect of a treatment using observational data requires accounting for confounding variables—factors that influence both treatment assignment and outcomes. Matching is a standard technique used to construct a pseudo-control group by finding untreated individuals similar to treated ones.
K-Nearest Neighbour Matching (K-NNM) is widely used but suffers from a fundamental limitation: it typically employs a fixed $K$ value for every sample. In practice, data density is non-uniform. A sample in a dense region might have many high-quality matches, while an outlier might have very few. Forcing a fixed $K$ leads to a trade-off where dense samples ignore useful information (increasing variance) and sparse samples are matched with dissimilar units (introducing bias). DK-NNM addresses this by dynamically determining the optimal $K$ for each individual based on local data structure.
Methodology: Dynamic K-NNM
The DK-NNM framework operates in two primary phases: sparse representation for neighborhood selection and dual-score matching.
1. Learning Personalized $K$ via Sparse Representation
Instead of pre-selecting $K$, the algorithm reconstructs each sample as a linear combination of all other samples. By applying an $\ell_1$-norm penalty, the model induces sparsity in the coefficient matrix. The number of non-zero coefficients for a specific sample identifies its most relevant neighbors, effectively defining a personalized $K$ value. To maintain local geometric relationships in high-dimensional spaces, the method incorporates Locality Preserving Projections (LPP).
2. Matching via Dual Scores
To overcome the "curse of dimensionality" associated with matching on raw high-dimensional covariates, DK-NNM projects data into a 2D space defined by:
- Propensity Score: The estimated probability of treatment assignment.
- Prognostic Score: The baseline expected outcome for an individual.
The algorithm calculates the Mahalanobis distance within this 2D score space and selects the personalized $K$ neighbors identified in the first phase to estimate counterfactual outcomes.
Experimental Evaluation
The authors evaluated DK-NNM against several benchmarks using synthetic, semi-synthetic, and real-world datasets:
- Synthetic Datasets: Tested robustness across linear and nonlinear outcomes with varying sample sizes.
- IHDP (Semi-synthetic): A standard causal inference benchmark based on the Infant Health and Development Program.
- Real-world Datasets: Included the Jobs dataset (labor market intervention), Cattaneo2 (maternal smoking impact), and RHC (Right Heart Catheterization mortality).
Key Results and Insights
DK-NNM demonstrated superior performance across multiple metrics:
- Accuracy: On the IHDP dataset, DK-NNM achieved a Root Mean Square Error (RMSE) of 0.0252, outperforming Bayesian Additive Regression Trees (BART) and Causal Forests (CF).
- Bias Reduction: In synthetic linear tests with 500 samples, DK-NNM reduced estimation bias to 5.01%, compared to 17.79% for standard NNM and 24.61% for Propensity Score Matching (PSM).
- Consistency: Real-world results on the Jobs and Cattaneo2 datasets aligned with empirical ground truths while maintaining significantly lower standard deviations than competing methods.
The core insight is that sparsity equals relevance. Using $\ell_1$-regularized self-representation allows the data to dictate its own neighborhood, effectively acting like an adaptive bandwidth that smooths estimates in dense regions and preserves fidelity in sparse ones.
Conclusion and Future Work
DK-NNM provides a robust, data-driven alternative to fixed-K matching. While highly effective, the computational cost of solving the sparse representation optimization problem can be significant for very large datasets. Future research will focus on scalability, exploring data subsampling and distributed computing frameworks to apply DK-NNM to massive, enterprise-scale observational data.
Summary updated