Optimal subsampling for linear models with heteroscedasticity

Jiayi Zheng, Dongqi Fu, Ziqiao Xu, Nicholas RiosJournal of Data Science Statistics and Visualisation 2026

Abstract

In recent years, the size of datasets has dramatically increased. This has encouraged the use of subsampling, where only a subset of the full dataset is used to fit a model in a more computationally efficient manner. Existing methods do not provide much guidance on how to find optimal subsamples for a linear model when the variance of the errors depends on the model covariates through an unknown function. This paper presents three main contributions that aid in finding optimal subsamples in the case of heteroscedastic errors. First, a kernel-based method is proposed for estimating the error variances in the full dataset based on a Latin Hypercube subsample. Second, a generalized version of the Information-Based Optimal Subdata Selection (IBOSS) algorithm is introduced that uses the variance estimates to find subsamples with high D-efficiency. Third, an Approximate Nearest Neighbor Simulated Annealing (ANNSA) algorithm is used to find subsamples that are efficient under the I-optimality criterion, which seeks to minimize integrated prediction error variance. Simulations show that the proposed subsampling algorithms have better D- and I-efficiencies than existing methods. The subsampling methods are used to analyze an airline dataset with over 7 million rows.

Introduction

As datasets scale into the millions and billions of rows, the computational cost of fitting traditional linear models becomes prohibitive. Subsampling—the process of selecting a representative subset of data—offers a solution. However, a critical oversight in many existing subsampling frameworks is the assumption of homoscedasticity, where error variance is assumed to be constant across all observations.

In real-world scenarios, such as airline performance or financial modeling, variance often fluctuates based on input covariates (heteroscedasticity). Ignoring this variation can lead to subsamples that prioritize high-noise data points, resulting in biased or inefficient models. This paper introduces a framework to intelligently select informative, low-noise data points to maximize both parameter estimation and prediction accuracy.

Methodology

The proposed framework consists of a three-stage workflow designed to handle unknown variance functions in massive datasets.

1. Variance Estimation via Kernel Methods

Since the underlying variance function is typically unknown, the first step involves estimating the error variance for every point in the full dataset. The authors utilize a Latin Hypercube Design (LHD) to select a small, space-filling pilot sample. This ensures the pilot sample represents the entire range of the covariate space. A Nadaraya-Watson Estimator (NWE), a kernel-based smoothing technique, is then applied to this pilot sample to generate variance estimates for the entire $N$-row dataset.

2. Weighted IBOSS (WIBOSS)

To maximize information for parameter estimation (D-optimality), the authors adapt the Information-Based Optimal Subdata Selection (IBOSS) algorithm. While standard IBOSS selects points with extreme covariate values, the Weighted IBOSS (WIBOSS) algorithm first standardizes the data using the previously estimated variances. This ensures the selection of points that are not only extreme in the covariate space but also possess relatively low noise, providing a clearer signal for the model.

3. ANNSA and k-d Trees

For tasks focused on minimizing integrated prediction variance (I-optimality), the authors propose the Approximate Nearest Neighbor Simulated Annealing (ANNSA) algorithm. Simulated Annealing is an optimization technique that iteratively swaps points to improve the subsample's quality. To make this feasible for millions of rows, the authors employ k-d trees to partition the data space.

The KD-Tree structure enables efficient spatial partitioning for the ANNSA algorithm.

As shown in the figure above, the k-d tree allows the algorithm to quickly identify "Approximate Nearest Neighbors." This reduces the computational complexity of searching for swap candidates from $O(N^2)$ to a manageable level, allowing the algorithm to scale to extreme datasets.

Experimental Evaluation

The researchers validated their methods using both simulated environments and a massive real-world dataset:

  • Simulated Data: 1,000,000 observations were generated with four distinct variance functions to test the robustness of WIBOSS and ANNSA against varying types of heteroscedasticity.
  • Airline Dataset: Using the 2009 ASA Data Expo dataset, the authors analyzed over 7.2 million flights from 2007. The model aimed to predict arrival delays based on elapsed time, departure delay, and travel distance.

Key Results and Insights

  • Efficiency Gains: In simulations, WIBOSS consistently outperformed standard IBOSS and random sampling in D-efficiency. By filtering for low-variance points, the algorithm produced more stable parameter estimates.
  • Prediction Accuracy: The ANNSA algorithm achieved the lowest I-optimality scores across all tests. On the 7.2-million-row airline dataset, ANNSA resulted in the lowest Mean Squared Prediction Error (MSPE), and its calculated regression coefficients were the most accurate reflection of the "ground truth" coefficients derived from the full dataset.
  • Computational Feasibility: While variance estimation and k-d tree construction require an upfront computational investment, the resulting statistical efficiency provides a significant "return on interest," making it a practical choice for high-stakes big data analysis.

Conclusion

This research demonstrates that accounting for heteroscedasticity is vital for effective subsampling. By combining kernel-based variance estimation with specialized algorithms like WIBOSS and ANNSA, researchers can extract highly informative subsets from massive datasets. Future work will focus on extending these methods to handle categorical covariates and further optimizing the speed of variance estimation for even larger scales.

Summary updated

BibTeX
@article{zheng2026optimal,
  author = {Jiayi Zheng and Dongqi Fu and Ziqiao Xu and Nicholas Rios},
  title = {{Optimal subsampling for linear models with heteroscedasticity}},
  journal = {Journal of Data Science Statistics and Visualisation},
  year = {2026},
  doi = {10.52933/jdssv.v6i1.167},
}
Figure