Latin Hypercube Sampling — Stratified Simulation Design

Simulation
Year
1979
Type
Stratified space-filling sampling design

What does it do?

Latin Hypercube Sampling (LHS) is a stratified space-filling design for computer experiments, introduced by McKay, Beckman, and Conover in 1979.

It divides each input variable's range into equally probable strata and draws exactly one sample from each stratum, so every input is covered evenly across the design. It is often paired with global sensitivity analysis, in particular Sobol indices, to quantify how much each input contributes to output variability.

The intuition behind the method

Suppose a computer model has several uncertain inputs and each run is expensive, so only a limited number of input combinations can be tried. Random sampling can, by chance, leave parts of one input's range heavily sampled and others empty. LHS avoids this by cutting each input into equally likely slices and making sure every slice is represented exactly once, so the sample spreads more evenly over each input's range than a random draw of the same size. The points can still cluster when two or more inputs are considered together, a limitation discussed below. The resulting runs can then feed a sensitivity analysis that ranks which inputs drive the output.

History

McKay, Beckman, and Conover introduced Latin Hypercube Sampling in a 1979 Technometrics paper, where it was compared with simple random sampling and stratified random sampling as ways of selecting input values for analysing computer code output. The name refers to the Latin square, in which each symbol appears once per row and column; LHS extends this one-per-row-and-column idea to several input dimensions. Variance-based global sensitivity analysis, which is commonly used with LHS designs, is treated in Saltelli et al.'s Global Sensitivity Analysis: The Primer.

When to use it

Choose LHS when a computationally expensive model must be explored across a multi-dimensional input space and a full factorial design would be too costly. Each input needs bounds and at least an approximate marginal distribution; these determine the design, so they should be stated deliberately. LHS suits global sensitivity analysis with continuous inputs. If inputs are strongly correlated, apply the Iman-Conover correction before analysis. Do not choose it when the model is very cheap to evaluate, where plain Monte Carlo with a large sample is simpler, or when only local sensitivity around one point is wanted, where gradient-based methods are more informative.

Limitations and considerations

  • Results depend on the marginal distributions and bounds specified for each input; a poor choice misrepresents the parameter space the design covers.
  • Stratification acts on each input separately. Because columns are permuted independently, two-dimensional and higher projections can still show gaps or clusters, and this becomes more pronounced as the number of inputs grows.
  • Sobol sensitivity estimation requires a number of model evaluations that depends on the estimator and grows with the number of inputs k, which can become large when k is high.
  • The design alone does not estimate the uncertainty of the output distribution; output statistics and their uncertainty must be computed from the model runs.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Each input's range is divided into equal-probability strata with one sample in each, so no stratum of a marginal range is left unsampled at the chosen N.
  • Compared with independent random draws of the same size, the stratification reduces clustering of values along each input, which matters when each run is costly.
  • The design can feed global variance-based sensitivity analysis, allowing inputs to be ranked by their contribution to output variance.
  • Only the ability to run the model at chosen input values is required; no derivatives or analytic form are needed.
  • The Iman-Conover step can induce rank correlations between inputs while preserving each input's marginal distribution and its stratification.

Applications

  • Uncertainty and sensitivity analysis in environmental and climate models, where running the model thousands of times at full resolution is infeasible.
  • Reliability engineering and structural safety: propagating uncertain material properties and loads through finite-element models to estimate failure probabilities.
  • Pharmaceutical and biomedical modelling: exploring how uncertain physiological parameters affect drug concentration predictions in pharmacokinetic models.
  • Financial risk analysis: sampling uncertain market parameters to estimate portfolio value-at-risk under a complex pricing model.
  • Agent-based social simulations: systematically exploring how uncertain behavioural parameters affect aggregate outcomes.

How it works

How it works

1

Each uncertain input is assigned a probability distribution (uniform, normal, lognormal, or another form) and a plausible range. This step makes explicit what the analyst knows or assumes about each parameter before sampling begins. If inputs are correlated, the Iman-Conover method can be applied to the design afterwards to induce the desired rank correlations while keeping each input's marginal distribution.

2

Each input's cumulative distribution is divided into N equally probable intervals (strata). In probability space, stratum i of input j is the interval [(i−1)/N, i/N]. One value is drawn at random within each stratum, and the N values for each input are then permuted independently across inputs. The permuted values are mapped back to the input scale through the input's inverse cumulative distribution. The result is an N × k matrix (N runs, k inputs) in which every input has exactly one value in each stratum. Because the columns are permuted independently, stratification holds for each input separately but does not by itself control coverage of joint combinations of inputs.

Formula
u_{ij} = \frac{\pi_j(i) - 1 + \xi_{ij}}{N}, \quad \xi_{ij} \sim U(0,1), \quad x_{ij} = F_j^{-1}(u_{ij})
3

The model (a simulation, finite-element solver, agent-based model, or any black-box function) is evaluated at each of the N input rows, producing an output vector Y of length N. The number of runs is usually set by the computational budget. If the design will feed a Sobol analysis, the total number of model evaluations depends on the sample-matrix scheme of the chosen estimator, so the budget must be set from that scheme's documentation. Small N relative to k produces noisy sensitivity indices.

4

Variance-based Sobol indices are estimated from the model outputs. The first-order index S_i measures the fraction of total output variance attributable to input i alone; the total-order index S_Ti includes input i together with its interactions with other inputs. Sobol estimation uses its own sample matrices, which are constructed separately from the LHS design and set up explicitly according to the chosen estimator rather than assumed to come from the LHS run. Together the indices rank inputs by importance and indicate which parameters could be fixed without losing much information.

Common pitfalls

  • Using too small a sample for the sensitivity analysis: Sobol indices computed from few runs have high variance, so rankings of inputs with similar importance may not be reliable.
  • Ignoring input correlations: treating correlated inputs as independent distorts the sample and can yield misleading sensitivity estimates. Apply the Iman-Conover correction when correlations are not negligible.
  • Confusing first-order and total-order Sobol indices: a small S_i does not mean an input is unimportant if it takes part in strong interactions, which the total-order index S_Ti captures.
  • Using LHS for a deterministic, very smooth model: surrogate-model or gradient-based methods may give similar insight at lower cost.

Frequently asked questions

How is LHS different from standard Monte Carlo sampling?

Both methods sample an input space for simulation, but they place samples differently. Standard Monte Carlo draws each sample point independently from the input distributions, so some regions can be over-represented and others sparse by chance. LHS enforces stratification: each input's range is divided into equally probable intervals and each interval receives exactly one value. This gives more even marginal coverage for the same number of runs. It does not guarantee lower estimation variance for every quantity of interest, and the gain depends on the model.

How many samples are needed?

There is no universal minimum; the number of runs depends on the computational budget and the analysis planned. For Sobol sensitivity analysis, the total number of model evaluations depends on the sample-matrix scheme of the chosen estimator, and N is the base sample size. As an illustration, if a scheme requires N·(k+2) evaluations, with k = 10 inputs and N = 1024 the total is 12 288 model evaluations. When N is small relative to k, the Sobol indices become highly uncertain.

What are Sobol indices and why are they used with LHS?

Sobol indices are variance-based sensitivity measures. The first-order index S_i gives the share of total output variance explained by input i alone; the total-order index S_Ti captures input i together with all its interactions with other inputs. LHS is useful for exploring the input space before a sensitivity study, but Sobol estimators are built on their own sample matrices, so the two should be set up explicitly rather than assumed to be the same design. Together the indices show which inputs drive the output and which can be treated as fixed.

What should I do when inputs are correlated?

Standard LHS assumes independent inputs. When inputs are correlated, the Iman-Conover method can be applied as a post-processing step: it reorders values within each input column so the sample has the desired rank correlations, keeping each marginal distribution and its stratification. Ignoring known correlations can inflate or deflate sensitivity estimates and give a misleading ranking of inputs.

Related methods

Sources

  1. McKay, M.D., Beckman, R.J. & Conover, W.J. (1979). A Comparison of Three Methods for Selecting Values of Input Variables in the Analysis of Output from a Computer Code. Technometrics, 21(2), 239-245.

    Open DOI reference
  2. Saltelli, A., Ratto, M., Andres, T., Campolongo, F., Cariboni, J., Gatelli, D., Saisana, M. & Tarantola, S. (2008). Global Sensitivity Analysis: The Primer. Wiley.

    Open DOI reference
  3. Applied Choice Analysis, 2nd Edition, §5.4.5, eq. (5.22)