LHS in LHS: A new expansion strategy for Latin hypercube sampling in simulation design

Matteo Boschini, Davide Gerosa, Alessandro Crespi, Matteo FalconearXiv 2025 · DOI

Abstract

Latin Hypercube Sampling (LHS) is a cornerstone of computer experimental design, valued for its ability to provide uniform marginal distributions and excellent space-filling properties. However, standard LHS algorithms are typically non-sequential, requiring the total number of samples to be fixed in advance. This paper introduces "LHS in LHS," a novel expansion strategy implemented in the expandLHS Python package. This method allows for the addition of $M$ new samples to an existing set of $N$ points while preserving the structural integrity of the Latin Hypercube. By utilizing a three-step process of regridding, void extraction, and nested sampling, the algorithm maintains high space-filling quality across arbitrary dimensions.

Introduction

In computational science, from astrophysics to pharmacokinetics, high-fidelity simulations are often the primary bottleneck due to their extreme computational cost. To maximize information gain per simulation, researchers employ Space-Filling Designs (SFDs), with Latin Hypercube Sampling (LHS) being the most prominent. LHS ensures that for $N$ samples in $P$ dimensions, each dimension's range is divided into $N$ equally probable intervals, with exactly one sample falling into each interval.

A significant limitation of standard LHS is its lack of flexibility for iterative sampling. In many real-world scenarios, researchers may find that an initial sample set is insufficient and wish to augment it. Simply adding random points or a second independent LHS set destroys the "one point per bin" property. Existing sequential LHS methods often impose restrictive conditions, such as requiring the sample size to be doubled, or involve high computational complexity. The "LHS in LHS" approach addresses these challenges by providing a model-free, computationally efficient method for arbitrary expansion.

Methodology: The LHS in LHS Algorithm

The proposed expansion strategy transforms an initial set of $N$ points into an expanded set of $N + M$ points through three primary stages:

  1. Regridding: The parameter space is re-discretized into $N + M$ equal-width bins per dimension. This shift in the grid often results in "collisions" where multiple original points occupy the same new bin, or "voids" where bins are left empty.
  2. Void Extraction: The algorithm identifies the specific intervals in the new $(N+M) \times (N+M)$ grid that do not contain any of the original $N$ points.
  3. LHS in LHS: This core step involves performing a nested Latin Hypercube Sample within the identified voids. By treating the collection of empty regions as a sub-grid, the algorithm draws $M$ new samples that satisfy the LHS property relative to the available space.
The three-step expansion process: (a) Regridding the space into $N+M$ bins, (b) identifying empty bins or "voids", and (c) performing a nested LHS within those voids.

To quantify the quality of the resulting design, the authors define the LHS degree ($\mathcal{D}$). A value of $\mathcal{D} = 1$ indicates a perfect Latin Hypercube. The expansion process aims to maximize this degree, often incorporating optimization techniques like discrepancy minimization to refine the placement of the $M$ new points.

Results and Performance

Evaluation of the "LHS in LHS" strategy across various dimensions ($P=2, 4, 8$) and sample sizes ($N=10$ to $1000$) revealed several key properties:

  • The Spike Phenomenon: The algorithm achieves a perfect LHS ($\mathcal{D} = 1$) whenever the number of added points $M$ is an integer multiple of the original size $N$. In these instances, the new grid boundaries align perfectly with the old ones, eliminating bin collisions.
  • Dimension Independence: The quality of the expansion, as measured by the LHS degree, is primarily a function of the expansion ratio $M/N$ and is remarkably consistent across different numbers of dimensions ($P$).
  • Optimization Benefits: While the basic expansion provides a good distribution, applying optimization (e.g., minimizing centered $L_2$ discrepancy) significantly enhances the space-filling performance. As shown in Figure 4, the optimized expansion effectively pushes new points into the largest gaps of the existing design.
Visual comparison of the initial LHS design, the basic expanded set (eLHS), and the optimized expanded set. Optimization significantly improves the uniformity and space-filling properties of the final design.

The implementation of this algorithm in the expandLHS Python package utilizes Numba for just-in-time compilation. This ensures that the expansion and optimization processes are highly efficient, making the tool suitable for large-scale simulation designs.

Conclusion and Future Work

The "LHS in LHS" strategy provides a robust and flexible solution for the sequential expansion of Latin Hypercube designs. By allowing researchers to add arbitrary numbers of points while maintaining high space-filling quality, it supports more efficient, iterative simulation workflows.

While highly effective, the method currently focuses on uniform hypercubes. Future work will focus on extending the method to non-uniform distributions and constrained parameter spaces, further broadening its applicability in complex engineering and scientific domains.

Summary updated

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Illustrative 2D LHS expansionLHS in LHS (eLHS)LHS degree1Experimental Design · dimensions=2 · new_samples=18 · initial_samples=20
Source quote
L170: 4.7 × 10 (-4) for the optimized expansion. This particular case happens to be a perfect expansion, \mathcal{D}\xspace({\rm eLHS}) = 1.
Illustrative optimal-expansion exampleExpandLHS.optimal_expansiondegree0.9107Experimental Design · dimensions=2 · initial_samples=20 · selected_new_samples=8 · candidate_new_samples=4–12
Source quote
L192: (8, 0.9107) # worst option
Illustrative optimal-expansion exampleExpandLHS.optimal_expansiondegree0.9828Experimental Design · dimensions=2 · initial_samples=20 · selected_new_samples=9 · candidate_new_samples=4–12
Source quote
L185: (9, 0.9828),
Illustrative optimal-expansion exampleExpandLHS.optimal_expansiondegree1.0Experimental Design · dimensions=2 · initial_samples=20 · selected_new_samples=12 · candidate_new_samples=4–12
Source quote
L184: (12, 1.0), # best option
BibTeX
@misc{boschini2025lhs,
  author = {Matteo Boschini and Davide Gerosa and Alessandro Crespi and Matteo Falcone},
  title = {{LHS in LHS: A new expansion strategy for Latin hypercube sampling in simulation design}},
  year = {2025},
  eprint = {2509.00159},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.00159},
}
Figure