# 拉丁超立方抽样

拉丁超立方抽样（Latin hypercube sampling，LHS）是一种分层蒙特卡罗方法，它从多维分布中生成参数向量样本，同时对每个输入维度进行分层，使得即使变量是随机配对的，每个变量的取值范围也能被均匀覆盖。它是一种广泛使用的随机抽样方法，用于基于蒙特卡罗的不确定性量化，应用于计算科学、工程和数学领域。<sup>[1](https://ar5iv.labs.arxiv.org/html/1507.06716)</sup> 在蒙特卡罗不确定性分析中，它充当随机抽样与分层抽样之间的折中方案：它对每个变量的范围进行密集分层，而不需要在完整样本空间中定义分层，并且比随机抽样产生更稳定的分析结果。<sup>[2](https://www.osti.gov/servlets/purl/806696)</sup>

| 关键事实 | 详情 |
|---|---|
| 产出什么 | 一个 \( n \times d \) 设计，在每个输入变量的 \( n \) 个等概率区间中各恰好有一个点<sup>[3](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.qmc.LatinHypercube.html)</sup> |
| 提出者 | M. D. 麦凯（M. D. McKay）、R. J. 贝克曼（R. J. Beckman）和 W. J. 康诺弗（W. J. Conover），《技术计量学》（Technometrics），1979年<sup>[4](https://doi.org/10.2307/1268522)</sup> |
| 保证的方差界 | \( n \) 个点的LHS的方差永远不会大于 \( n-1 \) 个点的简单蒙特卡罗<sup>[3](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.qmc.LatinHypercube.html)</sup> |
| 最佳情形 | 近似可加的被积函数，此时方差缩减可以非常大<sup>[5](https://people.maths.ox.ac.uk/gilesm/infomm/lec2.pdf)</sup> |
| 主要失效模式 | 随机配对可能在双因子投影中将点排列在对角线上，留下大片区域未被探索<sup>[6](https://arxiv.org/html/2203.06334)</sup> |
| 常用软件 | R包lhs、SciPy `stats.qmc.LatinHypercube`、MATLAB `lhsdesign`、桑迪亚LHS库<sup>[7](https://cran.r-project.org/web/packages/lhs/vignettes/lhs_basics.html)</sup><sup> • </sup><sup>[8](https://www.osti.gov/servlets/purl/919175)</sup> |

## 工作原理

LHS对每个维度分别进行分层。每个输入变量 \( X_k \) 的范围被划分为 \( n \) 个边际概率均为 \( 1/n \) 的分层，从每个分层中抽取一个值，因此每个边际的每个区间都恰好被表示一次。<sup>[4](https://doi.org/10.2307/1268522)</sup> 该样本的主要特征是，与简单随机抽样不同，它同时对所有输入维度进行分层。<sup>[9](https://projecteuclid.org/journalArticle/Download?urlId=10.1214%2Faos%2F1069362310)</sup>

这种分层以可量化的方式带来方差缩减。对于具有 \( N \) 个分层和可微被积函数的一维分层抽样，若导数平方可积，则均方根误差为 \( O(N^{-3/2}) \)，而非标准蒙特卡罗的 \( O(N^{-1/2}) \)；LHS将这一思想推广到多维。<sup>[5](https://people.maths.ox.ac.uk/gilesm/infomm/lec2.pdf)</sup> 如果被积函数是一维函数之和，LHS在每个维度上退化为该维度的一维分层抽样，随着样本量增大，方差缩减的潜力非常大。<sup>[5](https://people.maths.ox.ac.uk/gilesm/infomm/lec2.pdf)</sup> 斯坦（Stein）证明了LHS样本均值估计量的渐近方差低于基于独立同分布样本的估计量的渐近方差，增益来自函数的主效应。<sup>[9](https://projecteuclid.org/journalArticle/Download?urlId=10.1214%2Faos%2F1069362310)</sup><sup> • </sup><sup>[10](https://doi.org/10.1080/00401706.1987.10488205)</sup> 麦凯、贝克曼和康诺弗还证明了一个单调性定理：如果函数对每个自变量单调，且 \( g(Y) \) 对 \( Y \) 单调，则 \( \mathrm{Var}(T_L) \le \mathrm{Var}(T_R) \)，因此在该情形下，LHS在估计均值和分布函数方面永远不会比随机抽样差。<sup>[4](https://doi.org/10.2307/1268522)</sup> 欧文（Owen）后来证明，大小为 \( n \) 的LHS的方差永远不会大于 \( n-1 \) 个点的简单蒙特卡罗。<sup>[3](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.qmc.LatinHypercube.html)</sup>

## 具体做法

标准构造有三个步骤。<sup>[8](https://www.osti.gov/servlets/purl/919175)</sup>

1. **对每个变量分层。** 将每个变量的范围划分为 \( n \) 个等概率的不重叠区间。根据每个区间内的概率密度，从每个区间中随机抽取一个值。操作上，这是在CDF轴上、在 \( (0,1) \) 的 \( n \) 个等分切片内均匀采样，然后反演CDF以获得实际参数值。<sup>[8](https://www.osti.gov/servlets/purl/919175)</sup>
2. **对每列进行置换。** 为每个输入变量关联前 \( n \) 个整数的一个独立随机置换，如1979年原始方案那样，使各列的分层顺序不同。<sup>[8](https://www.osti.gov/servlets/purl/919175)</sup>
3. **配对列。** 每个变量的 \( n \) 个值被随机组合成 \( n \) 个输入向量。在每次试验中，层序编号被随机分配给各个变量，因此层在维度之间被随机组合。<sup>[11](https://www.intechopen.com/chapters/50120)</sup>

由于配对是随机的，列之间的样本相关性一般不等于零，即使输入是独立的，也纯粹源于抽样波动。<sup>[12](https://nepis.epa.gov/Exe/ZyPURL.cgi?Dockey=940008KB.TXT)</sup> 在实践中，重复抽样——即将 \( M \) 个独立生成的LHS集合取平均——提供了跨集合的经验方差，从而给出抽样误差的置信区间。<sup>[2](https://www.osti.gov/servlets/purl/806696)</sup><sup> • </sup><sup>[5](https://people.maths.ox.ac.uk/gilesm/infomm/lec2.pdf)</sup>

## 起源

拉丁超立方抽样由M. D. 麦凯、R. J. 贝克曼和W. J. 康诺弗在1979年发表于《技术计量学》的论文《比较三种为计算机代码输出分析选择输入变量值的方法》中提出，该文比较了随机抽样、分层抽样和拉丁超立方抽样。<sup>[4](https://doi.org/10.2307/1268522)</sup> 该方法由W. J. 康诺弗构思，其原始未发表手稿记录了这一思想，后与洛斯阿拉莫斯科学实验室的同事正式发表；该论文是在核管理委员会反应堆安全研究处的支持下完成的。<sup>[2](https://www.osti.gov/servlets/purl/806696)</sup> 康诺弗的学生、桑迪亚国家实验室职员R. L. 伊曼（R. L. Iman）编写了第一个广泛分发的拉丁超立方抽样程序。<sup>[2](https://www.osti.gov/servlets/purl/806696)</sup> 作者将该方法描述为配额抽样的扩展和拉丁方抽样的 \( K \) 维推广。<sup>[4](https://doi.org/10.2307/1268522)</sup>

## 变体

随机配对是普通LHS的主要弱点，若干变体系列针对这一问题。

**优化设计与正交设计。** 正交阵列拉丁超立方体由唐本信（Boxin Tang）于1993年提出，也称为U设计，保证多维空间填充，并通过同时消除双因子交互作用贡献的方差来实现进一步的方差缩减。<sup>[13](https://doi.org/10.1080/01621459.1993.10476423)</sup><sup> • </sup><sup>[6](https://arxiv.org/html/2203.06334)</sup> 最大最小距离准则由约翰逊（Johnson）、摩尔（Moore）和伊尔维萨科（Ylvisaker）于1990年提出，倾向于产生聚集的一维投影，因此莫里斯（Morris）和米切尔（Mitchell）于1995年提出最大最小拉丁超立方设计，以平衡空间填充与良好的边际。<sup>[14](https://doi.org/10.1016/0378-3758%2890%2990122-b)</sup><sup> • </sup><sup>[15](https://doi.org/10.1016/0378-3758%2894%2900035-t)</sup> 帕克（Park）于1994年开发了最优拉丁超立方设计，金（Jin）、陈（Chen）和苏佳托（Sudjianto）于2004年引入了增强随机进化算法来构造最优设计。<sup>[16](https://doi.org/10.1016/0378-3758%2894%2990115-5)</sup><sup> • </sup><sup>[17](https://doi.org/10.1016/j.jspi.2004.02.014)</sup> 2026年，埃尔·哈达德（El Haddad）、韦赫贝（Wehbe）、威克（Wicker）和谭（Tan）发表论文，引入一种马尔可夫链蒙特卡罗算法，在多项式时间内生成空间填充LHS，其混合时间界通过置换抽样的规范路径方法获得；在他们的测试中，按空间填充准则抽样优于均匀LHS抽样。<sup>[18](https://doi.org/10.1016/j.jspi.2026.106387)</sup>

**相关输入。** 伊曼和康诺弗提出了一种无分布方法，在输入变量之间诱导秩相关，这种受限配对保持了LHS分层和边际分布，同时使样本相关性更接近预期相关性；桑迪亚软件建议该方法的观测数至少为随机变量数的 \( 4/3 \) 倍。<sup>[19](https://doi.org/10.1080/03610918208812265)</sup><sup> • </sup><sup>[8](https://www.osti.gov/servlets/purl/919175)</sup>

**结构化推广。** 切片拉丁超立方设计由钱（Qian）于2012年提出，将一个设计划分为若干切片，每个切片本身是较小的拉丁超立方设计，适用于同时具有定性和定量因子的实验。<sup>[20](https://doi.org/10.1080/01621459.2011.644132)</sup> 最大投影设计将一维均匀性性质扩展到更大的子空间。<sup>[21](https://doi.org/10.1093/biomet/asv002)</sup> 拉丁超立方体抽样将输入变量分组为子集，在每个子集内应用低维拟蒙特卡罗方法，将QMC的优势扩展到极高维；即使分组不佳，预期效果也仍不亚于LHS。<sup>[22](https://doi.org/10.1145/272991.273010)</sup>

**软件。** R包lhs使用`randomLHS`创建基本设计，并提供包括`optimumLHS`、`maximinLHS`、`improvedLHS`和`geneticLHS`在内的优化方法，还提供切片设计、嵌套设计和正交阵列LHS。<sup>[7](https://cran.r-project.org/web/packages/lhs/vignettes/lhs_basics.html)</sup><sup> • </sup><sup>[23](https://bertcarnell.r-universe.dev/lhs/lhs.pdf)</sup> SciPy的`stats.qmc.LatinHypercube`在每个边际的 \( [j/n, (j+1)/n) \) 中恰好放置一个点，在 \( n \ll d \) 时仍然适用，支持需要 \( n = p^2 \) 个点（\( p \) 为素数）的强度2正交阵列LHS，并提供`random-cd`和`lloyd`优化。<sup>[3](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.qmc.LatinHypercube.html)</sup> MATLAB的`lhsdesign`产生近似最大最小设计。<sup>[6](https://arxiv.org/html/2203.06334)</sup>

## 应用

LHS的最早应用是在反应堆安全中的冷却剂丧失事故分析中，自1975年以来该技术已应用于许多计算机模型，早期应用包括斯特克（Steck）、伊曼和达尔格伦（Dahlgren）于1976年的工作。<sup>[2](https://www.osti.gov/servlets/purl/806696)</sup><sup> • </sup><sup>[12](https://nepis.epa.gov/Exe/ZyPURL.cgi?Dockey=940008KB.TXT)</sup> 大型核计划采用了它：LHS被用于WIPP放射性废物合规分析和尤卡山项目深地质处置设施。<sup>[2](https://www.osti.gov/servlets/purl/806696)</sup> 在流行病建模中，一个具有6个参数和50个LHS样本的应用显示，与网格抽样相比，将响应面误差保持在2%以下所需的样本数降至原来的十四分之一。<sup>[3](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.qmc.LatinHypercube.html)</sup>

## 局限与替代方案

**失效模式。** 随机生成的拉丁超立方设计通常表现出较差的空间填充：投影到两个因子上时，其点可能大致位于对角线上，两个设计列变得高度相关，设计空间的大片区域未被探索。<sup>[6](https://arxiv.org/html/2203.06334)</sup> 张（Zhang）、科尔（Cole）和格拉梅西（Gramacy）展示了在使用最大最小设计和LHS等空间填充设计与高斯过程代理模型时的病态行为，尤其是在贝叶斯优化中作为小种子设计时。<sup>[24](https://bookdown.org/rbg/surrogates/chap4.html)</sup>

**高维。** LHS保证一维边际均匀，但不能防止联合分布中的混叠；在高维中，当维度相对于 \( n \) 较大时，均匀随机抽样与LHS之间的区别已无实际意义。<sup>[24](https://bookdown.org/rbg/surrogates/chap4.html)</sup> 优化设计在计算上是困难的，因为对于 \( n \) 次运行和 \( k \) 个因子，可能有 \( (n!)^k \) 种配置。<sup>[25](https://link.springer.com/article/10.1007/s42519-026-00618-8)</sup>

**与拟蒙特卡罗的比较。** 拟蒙特卡罗方法生成确定性低差异序列，专门适用于均匀性和方差缩减重要的情形。<sup>[26](https://wires.onlinelibrary.wiley.com/doi/10.1002/wics.1637)</sup> 索博尔（Sobol）序列由I. M. 索博尔于1967年提出，在5到100维的数值比较中在高维表现优异，而哈默斯利（Hammersley）和霍尔顿（Halton）抽样适合较低维度；实践中8维及以上避免使用霍尔顿序列。<sup>[27](https://doi.org/10.1016/0041-5553%2867%2990144-9)</sup><sup> • </sup><sup>[28](https://como.ceb.cam.ac.uk/media/preprints/c4e-Preprint-182.pdf)</sup> 在约 \( 10^6 \) 个样本的金融篮子期权比较中，蒙特卡罗的误差界为0.0239，采用乔尔斯基排序的LHS为0.0081，采用相同排序的索博尔QMC为0.0007；在该问题中LHS优于蒙特卡罗但不及QMC。<sup>[5](https://people.maths.ox.ac.uk/gilesm/infomm/lec2.pdf)</sup> 2017年一项对CVT、最优拉丁超立方设计和三种准随机序列的比较研究得出结论，对于计算机实验选择合适的抽样方法仍无明确指南。<sup>[29](https://link.springer.com/article/10.1007/s00158-016-1490-6)</sup>

## References

1. [The generalization of Latin hypercube sampling (Shields et al.)](https://ar5iv.labs.arxiv.org/html/1507.06716)
2. [Latin Hypercube Sampling and the Propagation of Uncertainty in Analyses of Complex Systems (Helton & Davis, Sandia report)](https://www.osti.gov/servlets/purl/806696)
3. [scipy.stats.qmc.LatinHypercube, SciPy Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.qmc.LatinHypercube.html)
4. [M. D. McKay, R. J. Beckman, W. J. Conover (1979). A Comparison of Three Methods for Selecting Values of Input Variables in the Analysis of Output from a Computer Code. Technometrics.](https://doi.org/10.2307/1268522)
5. [Monte Carlo Methods for Uncertainty Quantification, Lecture 2 (Mike Giles, Oxford)](https://people.maths.ox.ac.uk/gilesm/infomm/lec2.pdf)
6. [Latin Hypercubes and Space-filling Designs (Handbook chapter, Lin & Tang)](https://arxiv.org/html/2203.06334)
7. [Basic Latin hypercube samples and designs with package lhs (R vignette)](https://cran.r-project.org/web/packages/lhs/vignettes/lhs_basics.html)
8. [A User's Guide to Sandia's Latin Hypercube Sampling Software: LHS UNIX Library/Standalone Version](https://www.osti.gov/servlets/purl/919175)
9. [Latin hypercube sampling and the construction of nonparametric confidence regions (Loh, Annals of Statistics)](https://projecteuclid.org/journalArticle/Download?urlId=10.1214%2Faos%2F1069362310)
10. [Michael Stein (1987). Large Sample Properties of Simulations Using Latin Hypercube Sampling. Technometrics.](https://doi.org/10.1080/00401706.1987.10488205)
11. [Latin Hypercube Sampling (Menčík, Concise Reliability for Engineers, IntechOpen 2016)](https://www.intechopen.com/chapters/50120)
12. [A FORTRAN 77 Program and User's Guide for the Generation of Latin Hypercube and Random Samples for use with Computer Models (Iman, Davenport, Zeigler / Iman & Shortencarier)](https://nepis.epa.gov/Exe/ZyPURL.cgi?Dockey=940008KB.TXT)
13. [Boxin Tang (1993). Orthogonal Array-Based Latin Hypercubes. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1993.10476423)
14. [Minimax and maximin distance designs (Journal of Statistical Planning and Inference, 1990)](https://doi.org/10.1016/0378-3758%2890%2990122-b)
15. [Exploratory designs for computational experiments (Journal of Statistical Planning and Inference, 1995)](https://doi.org/10.1016/0378-3758%2894%2900035-t)
16. [Optimal Latin-hypercube designs for computer experiments (Journal of Statistical Planning and Inference, 1994)](https://doi.org/10.1016/0378-3758%2894%2990115-5)
17. [Ruichen Jin, Wei Chen, Agus Sudjianto (2004). An efficient algorithm for constructing optimal design of computer experiments. Journal of Statistical Planning and Inference.](https://doi.org/10.1016/j.jspi.2004.02.014)
18. [Rami El Haddad and colleagues (2026). A Markov chain Monte Carlo construction of space-filling Latin Hypercube Samples. Journal of Statistical Planning and Inference.](https://doi.org/10.1016/j.jspi.2026.106387)
19. [Ronald L. Iman, W. J. Conover (1982). A distribution-free approach to inducing rank correlation among input variables. Communications in Statistics - Simulation and Computation.](https://doi.org/10.1080/03610918208812265)
20. [Peter Z. G. Qian (2012). Sliced Latin Hypercube Designs. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.2011.644132)
21. [V. Roshan Joseph, Evren Gul, Shan Ba (2015). Maximum projection designs for computer experiments. Biometrika.](https://doi.org/10.1093/biomet/asv002)
22. [Art B. Owen (1998). Latin supercube sampling for very high-dimensional simulations. ACM Transactions on Modeling and Computer Simulation.](https://doi.org/10.1145/272991.273010)
23. [lhs: Latin Hypercube Samples (R package documentation, v1.4.0)](https://bertcarnell.r-universe.dev/lhs/lhs.pdf)
24. [Chapter 4 Space-filling Design | Surrogates (graduate textbook, online)](https://bookdown.org/rbg/surrogates/chap4.html)
25. [Musings on Constructions of Optimal Latin Hypercube Designs with Flexible Sizes (Journal of Statistical Theory and Practice, 2026)](https://link.springer.com/article/10.1007/s42519-026-00618-8)
26. [A review of Monte Carlo and quasi-Monte Carlo sampling techniques (WIREs Computational Statistics)](https://wires.onlinelibrary.wiley.com/doi/10.1002/wics.1637)
27. [On the distribution of points in a cube and the approximate evaluation of integrals (USSR Computational Mathematics and Mathematical Physics, 1967)](https://doi.org/10.1016/0041-5553%2867%2990144-9)
28. [Design of Computer Experiments: A Review](https://como.ceb.cam.ac.uk/media/preprints/c4e-Preprint-182.pdf)
29. [Comparison study of sampling methods for computer experiments using various performance measures (Structural and Multidisciplinary Optimization, 2017)](https://link.springer.com/article/10.1007/s00158-016-1490-6)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026; Oct 25, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Sampling design and survey methodology › Sampling designs and estimators

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/latin-hypercube-sampling

English original: https://www.edgepedia.org/latin-hypercube-sampling
