NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Sampling from Gaussian Processes: A Tutorial and Applications in Global Sensitivity Analysis and Optimization

Bach Do, Nafeezat A. Ajenifuja, Taiwo A. Adebiyi, Ruda ZhangarXiv 2025 · OpenReview

Abstract

High-fidelity simulations and physical experiments are essential for engineering analysis and design, yet their high cost often makes two critical tasks—global sensitivity analysis (GSA) and optimization—prohibitively expensive. This limitation motivates the common use of Gaussian processes (GPs) as proxy regression models that provide uncertainty-aware predictions from a limited number of high-quality observations. GPs naturally enable efficient sampling strategies that support informed decision-making under uncertainty by extracting information from a subset of possible functions for the model of interest. However, direct sampling from GPs is inefficient due to their infinite-dimensional nature and the high cost associated with large covariance matrix operations. Despite their popularity in machine learning and statistics communities, sampling from GPs has received little attention in the community of engineering optimization. In this paper, we present the formulation and detailed implementation of two notable sampling methods—random Fourier features and pathwise conditioning—for generating posterior samples from GPs at reduced computational cost. Alternative approaches are briefly described. Importantly, we detail how the generated samples can be applied in GSA, single-objective optimization, and multi-objective optimization. We show successful applications of these sampling methods through a series of numerical examples.

1. Introduction

In modern engineering, analyzing complex systems often requires "black-box" functions—simulations or experiments that are computationally expensive or time-consuming to execute. To mitigate these costs, Gaussian Processes (GPs) are frequently employed as surrogate models. GPs are particularly valued for their ability to provide not just predictions, but also a measure of uncertainty. However, many critical downstream tasks, such as Global Sensitivity Analysis (GSA) and Bayesian Optimization (BO), require drawing thousands of sample paths from the GP posterior.

2. The Computational Challenge

The traditional method for sampling from a GP, often referred to as exhaustive sampling via Cholesky decomposition, scales cubically ($O(N^3)$) with the number of query points $N$. This scaling becomes a significant bottleneck when a sample must be evaluated at thousands of grid points to calculate a sensitivity index or to find the global minimum of a sample path. This paper addresses this gap by introducing efficient sampling techniques that are well-established in the machine learning community but underutilized in engineering optimization.

3. Efficient Sampling Methods

The authors detail two primary "weight-space" approaches that transform the infinite-dimensional GP sampling problem into a finite, manageable one, reducing the computational complexity to linear $O(N)$ scaling.

3.1 Random Fourier Features (RFF)

Based on Bochner’s Theorem, RFF approximates the GP kernel using a finite set of trigonometric basis functions. This method effectively transforms the GP into a linear model in a high-dimensional feature space. Once the weights are drawn, generating a sample path is extremely fast, making it ideal for large-scale Monte Carlo simulations.

3.2 Pathwise Conditioning (PC)

Pathwise Conditioning is highlighted as a particularly robust method. It employs Matheron’s rule to update a prior sample (which can be generated via RFF) with a data-driven update term. This ensures that the resulting sample path exactly matches the GP's posterior mean and covariance at the observed data points. This "anchoring" makes PC more reliable than pure RFF, especially when extrapolating beyond the training data.

Conceptual transformation of standard normal noise into a correlated Gaussian vector. (a) Standard normal noise $\mathbf{e}$. (b) Correlated zero-mean vector $\mathbf{f}-\mathbf{m}$. (c) Final sample $\mathbf{f}$ shifted by mean $\mathbf{m}$.

4. Applications and Key Results

The utility of these sampling methods is demonstrated through several applications:

  • Global Sensitivity Analysis (GP-GSA): By using efficient samples, the authors estimate Sobol’ indices (variance-based sensitivity) for complex models. On a ten-bar truss structure with 15 input variables, the GP-based GSA correctly ranked variable importance using only a few hundred observations, matching expensive Monte Carlo baselines.
  • Bayesian Optimization via Thompson Sampling (GP-TS): Thompson Sampling involves drawing a sample path and minimizing it to find the next query point. This approach naturally manages the exploration-exploitation trade-off. In high-dimensional tasks, such as the 16D Ackley function, Thompson Sampling variants (specifically "TS-roots") significantly outperformed standard methods like Expected Improvement (EI) and Lower Confidence Bound (LCB).

5. Discussion and Limitations

While RFF and PC provide a path to breaking the $O(N^3)$ barrier, some challenges remain. The current framework assumes homoscedastic noise and uncorrelated objectives in multi-objective optimization. Furthermore, while these methods scale well, other techniques like Orthonormal Expansions struggle as dimensionality increases beyond five variables. However, the "embarrassingly parallel" nature of these sampling methods offers a clear path for significant speedups in industrial settings.

6. Conclusion

Efficient sampling from Gaussian Processes is a transformative tool for engineering optimization. By adopting methods like Random Fourier Features and Pathwise Conditioning, researchers can perform complex sensitivity analyses and optimizations that were previously computationally out of reach. This tutorial serves as a foundational guide for implementing these scalable techniques in real-world engineering workflows.

Summary updated

BibTeX
@misc{do2025sampling,
  author = {Bach Do and Nafeezat A. Ajenifuja and Taiwo A. Adebiyi and Ruda Zhang},
  title = {{Sampling from Gaussian Processes: A Tutorial and Applications in Global Sensitivity Analysis and Optimization}},
  year = {2025},
  eprint = {2507.14746},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.14746},
}
Figure