{
  "id": "latin-hypercube-sampling",
  "title": "Latin Hypercube Sampling",
  "lang": "en",
  "source_lang": "en",
  "summary": "Latin hypercube sampling is a stratified sampling method that spreads points evenly across each input distribution, often improving the efficiency of simulation and numerical integration.",
  "category": "mathematics",
  "subcategory": "probability-statistics",
  "type": "concept",
  "aliases": [
    "LHS",
    "Latin hypercube design",
    "Latin hypercube sampling design"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/latin-hypercube-sampling/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/latin-hypercube-sampling/",
      "json": "https://aiwiki.page/zh/latin-hypercube-sampling.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Latin hypercube sampling (LHS) is a method of stratified sampling in which every input variable is divided into equally probable intervals and sampled once in each interval. The sampled values are combined so that a design with \\(n\\) points uses every interval exactly once in every coordinate. Widely used in experimental design, computer simulation, and uncertainty analysis, it provides more regular coverage of individual input distributions than unrestricted random sampling, without requiring a full multidimensional grid."
    },
    {
      "heading": "Principle and construction",
      "text": "Suppose a model has \\(d\\) input variables and will be evaluated at \\(n\\) input combinations. First construct points in the unit hypercube \\([0,1]^d\\). Divide each coordinate axis into the \\(n\\) intervals\n\n\\[I_k=\\left[\\frac{k-1}{n},\\frac{k}{n}\\right), \\qquad k=1,\\ldots,n.\\]\n\nA Latin hypercube contains exactly one point in each interval along each coordinate. This is a condition on one-dimensional projections: looking only at any one coordinate, the points occupy all \\(n\\) strata.\n\nA standard randomized construction uses an independently chosen random permutation \\(\\pi_j\\) of \\(\\{1,\\ldots,n\\}\\) for each coordinate \\(j\\), together with independent random variables \\(V_{ij}\\) having the uniform distribution on \\((0,1)\\). Define\n\n\\[U_{ij}=\\frac{\\pi_j(i)-1+V_{ij}}{n}, \\qquad i=1,\\ldots,n,\\quad j=1,\\ldots,d.\\]\n\nThe rows \\(\\mathbf U_i=(U_{i1},\\ldots,U_{id})\\) are the design points. The permutations determine which strata are paired across coordinates, while the \\(V_{ij}\\) determine the positions within strata.\n\nFor example, a four-point, two-dimensional Latin hypercube could use the following stratum pairs:\n\nPoint | First-coordinate stratum | Second-coordinate stratum\n1 | 1 | 3\n2 | 2 | 1\n3 | 3 | 4\n4 | 4 | 2\n\nEach column contains every stratum exactly once. The design occupies four of the sixteen possible two-dimensional cells; it does not require one point in every cell.\n\nTransformation to input distributions\n\nTo represent an input variable with cumulative distribution function \\(F_j\\), transform the corresponding coordinate using its generalized quantile function:\n\n\\[X_{ij}=F_j^{-1}(U_{ij}), \\qquad F_j^{-1}(u)=\\inf\\{x:F_j(x)\\geq u\\}.\\]\n\nFor a continuous distribution, this creates strata of equal probability, not necessarily equal width in the variable’s physical units. A normally distributed input, for example, has narrower strata near its center and wider strata in its tails.\n\nWith independently generated columns and separate marginal transformations, the construction represents a target distribution with independent inputs. It does not automatically reproduce dependence between inputs."
    },
    {
      "heading": "Why it is called “Latin”",
      "text": "The name refers to a Latin square, an array in which every symbol appears once in each row and column. Latin hypercube sampling uses a related non-repetition rule: each coordinate’s stratum labels occur exactly once.\n\nThe analogy does not mean that an ordinary Latin hypercube balances every pair or higher-dimensional combination of inputs. Its defining balance is one-dimensional.\n\nThe modern method was introduced in a 1979 paper by Michael D. McKay, Richard J. Beckman, and William J. Conover comparing methods for selecting inputs in the analysis of computer-code output. It subsequently became a standard approach for propagating input uncertainty through computational models and constructing simulation experiments."
    },
    {
      "heading": "Estimation and variance reduction",
      "text": "For a model response \\(f(\\mathbf X)\\), a common objective is to estimate its expected value\n\n\\[\\mu=\\mathbb E[f(\\mathbf X)].\\]\n\nUsing a randomized Latin hypercube, the estimator is the sample mean\n\n\\[\\widehat\\mu_{\\mathrm{LHS}} =\\frac{1}{n}\\sum_{i=1}^{n}f(\\mathbf X_i).\\]\n\nUnder the standard construction, each individual point has the intended joint distribution for independent inputs. Consequently, the estimator is unbiased whenever the expectation exists.\n\nHowever, the design points are not mutually independent: their coordinates are constrained to occupy different strata. This dependence is deliberate and is central to the method’s reduction of variance.\n\nMain effects and interactions\n\nThe strongest gains occur when the model is approximately additive:\n\n\\[f(\\mathbf x)\\approx \\mu+\\sum_{j=1}^{d}g_j(x_j).\\]\n\nFor such a model, controlling coverage separately along every coordinate controls much of the response variation.\n\nMore formally, for independent inputs, a square-integrable response can be written as\n\n\\[f(\\mathbf X) =\\mu+\\sum_{j=1}^{d}g_j(X_j)+r(\\mathbf X),\\]\n\nwhere\n\n\\[g_j(X_j) =\\mathbb E[f(\\mathbf X)\\mid X_j]-\\mu.\\]\n\nHere the functions \\(g_j\\) describe one-variable main effects, using conditional expectation, while \\(r\\) contains effects that cannot be represented by their sum. These include interactions between variables.\n\nFor standard randomized Latin hypercube sampling, with fixed dimension and suitable square-integrability conditions,\n\n\\[\\operatorname{Var}(\\widehat\\mu_{\\mathrm{LHS}}) = \\frac{\\operatorname{Var}(r(\\mathbf X))}{n} +o(n^{-1}).\\]\n\nBy comparison, independent Monte Carlo sampling gives\n\n\\[\\operatorname{Var}(\\widehat\\mu_{\\mathrm{MC}}) = \\frac{\\operatorname{Var}(f(\\mathbf X))}{n}.\\]\n\nThus, Latin hypercube sampling removes the one-variable main effects from the leading-order variance. If those effects dominate, the improvement can be substantial. If the response is dominated by interactions, the improvement may be small.\n\nThis asymptotic result is not a universal finite-sample guarantee that every Latin hypercube outperforms every independent random sample.\n\nSmooth additive responses\n\nA simple special case illustrates the potential gain. Suppose, on the unit hypercube,\n\n\\[f(\\mathbf u)=c+\\sum_{j=1}^{d}g_j(u_j),\\]\n\nand each \\(g_j\\) has a bounded derivative. With independent random sampling inside each stratum, the estimator variance is \\(O(n^{-3})\\), rather than the usual \\(O(n^{-1})\\).\n\nThe gain comes from making each stratum narrow enough that a smooth one-variable function varies little inside it. Responses with singularities, extreme tails, discontinuities, or strong interactions need not exhibit this rate."
    },
    {
      "heading": "Design variants",
      "text": "Randomized and centered designs\n\nA randomized Latin hypercube selects a random position within each occupied stratum. Its randomization supports unbiased integration and repeated-design uncertainty assessment.\n\nA centered Latin hypercube instead uses stratum midpoints:\n\n\\[U_{ij}=\\frac{\\pi_j(i)-1/2}{n}.\\]\n\nThis preserves the Latin property and removes within-stratum randomness. However, its points no longer have continuous uniform marginal distributions under randomization of the permutations alone. For general integrands, the corresponding integration rule need not be unbiased.\n\nSpace-filling optimization\n\nA valid Latin hypercube can still contain nearby points or leave substantial gaps in multidimensional projections. Designs may therefore be selected or improved through optimization.\n\nCommon criteria include:\n\n- Maximin distance: maximize the smallest distance between any two points.\n- Low discrepancy: reduce departures from uniform coverage of the domain.\n- Low coordinate correlation: reduce empirical correlation between columns.\n- Projection quality: improve coverage when the design is viewed in selected coordinate subsets.\n\nDistance criteria are often evaluated using Euclidean distance in normalized coordinates. Their meaning can change after nonlinear transformations to physical input distributions.\n\nOptimizing geometric quality changes the sampling procedure. Unbiasedness and variance formulas established for the standard randomized construction should not automatically be assumed for an optimized design.\n\nOrthogonal-array-based designs\n\nAn orthogonal array can impose balance on combinations of coordinate levels, extending stratification beyond individual variables. Orthogonal-array-based Latin hypercubes combine such balance with the ordinary Latin condition.\n\nThese designs can improve coverage of low-order interactions, but their construction usually imposes restrictions on the number of points, factors, and levels."
    },
    {
      "heading": "Dependent inputs and constrained domains",
      "text": "Separate quantile transformations preserve marginal distributions but do not create a specified dependent joint distribution. If the inputs are dependent, that dependence must be incorporated explicitly.\n\nApproaches include rank-based rearrangement, conditional-distribution transformations, and sampling through a copula. Different approaches preserve different properties. A rearrangement may retain each column’s Latin stratification while only approximating a target dependence structure. A transformation that accurately represents dependence may destroy the Latin property in the final physical coordinates.\n\nMatching a correlation matrix alone does not generally determine a joint distribution. In particular, variables can have zero correlation without statistical independence.\n\nConstraints create a related difficulty. Rejecting points outside a permitted region can destroy both equal stratum occupancy and the intended sampling distribution. Designs for constrained domains therefore require additional construction or weighting methods rather than simple removal of invalid points."
    },
    {
      "heading": "Applications",
      "text": "Latin hypercube sampling is especially useful when individual model evaluations are expensive and the evaluation budget is fixed.\n\nTypical applications include:\n\n- Uncertainty propagation: estimating response distributions, means, and other summaries induced by uncertain inputs.\n- Sensitivity analysis: exploring how changes in inputs influence model outputs.\n- Computer experiments: choosing input combinations for deterministic simulators.\n- Surrogate modeling: producing training designs for response surfaces and Gaussian process models.\n- Engineering and environmental modeling: exploring uncertain parameters in structural, thermal, hydrological, and related computational models.\n\nFor integration, the target is an accurate estimate of an expectation. For surrogate modeling, the target may instead be accurate prediction throughout a domain. A design optimized for one purpose need not be optimal for the other."
    },
    {
      "heading": "Limitations and uncertainty assessment",
      "text": "Latin hypercube sampling controls marginal coverage, not complete multidimensional coverage. It therefore does not remove the curse of dimensionality. Many-variable interactions, narrow response features, and rare events requiring simultaneous extreme inputs may remain poorly sampled.\n\nDiscrete distributions can also reduce its geometric benefit: distinct probability strata may transform to the same physical value. The method remains definable through generalized quantiles, but distinct stratum labels do not guarantee distinct observed values.\n\nOrdinary Latin hypercubes are not naturally sequential. Adding arbitrary points usually destroys the exact Latin property at the new sample size. Specialized nested, sliced, or augmentation constructions address this problem, often with additional restrictions.\n\nFinally, the usual independent-sample formula for a standard error does not generally describe the uncertainty of a Latin hypercube estimator, because observations within one design are dependent. One approach is to generate several independent randomized Latin hypercubes and use the variation among their estimated means. A resulting confidence interval must reflect the number of independent designs and any approximation used for their sampling distribution."
    }
  ],
  "links": [
    "stratified-sampling",
    "experimental-design",
    "random-sampling",
    "permutation",
    "uniform-distribution",
    "cumulative-distribution-function",
    "quantile",
    "probability",
    "expected-value",
    "sample-mean",
    "variance",
    "conditional-expectation",
    "statistical-interaction",
    "monte-carlo-method",
    "derivative",
    "mathematical-optimization",
    "correlation",
    "euclidean-distance",
    "joint-probability-distribution",
    "statistical-independence",
    "sensitivity-analysis",
    "gaussian-process",
    "curse-of-dimensionality",
    "standard-error",
    "confidence-interval"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}