# 连续均匀分布

连续均匀分布是这样一种随机变量的概率分布：该随机变量在固定区间 \([a, b]\) 内取任何值的可能性相同；其概率密度在该区间上为常数，在区间外为零。它也被称为矩形分布，而在 \([0, 1]\) 上的特殊情形即标准均匀分布，是随机数生成器的基本输出。<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup>

| 关键事实 | 详情 |
|---|---|
| 密度 | 当 \( A \le x \le B \) 时 \( f(x) = 1/(B-A) \)，其余情况为零；标准形式在 \([0, 1]\) 上为 \( f(x) = 1 \)<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup> |
| 中心 | 均值与中位数均等于 \( (A+B)/2 \)，即区间中点<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup> |
| 离散程度 | 标准差 \( \sqrt{(B-A)^{2}/12} \)；偏度为 0；峰度为 9/5<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup> |
| 熵 | 在具有有限支撑的分布中，均匀分布达到最大可能的微分熵<sup>[2](https://link.springer.com/chapter/10.1007/978-3-030-95860-2_4)</sup> |
| 随机数 | 几乎所有随机数生成器都在 (0,1) 区间上产生数值，其他分布则通过对这些均匀值进行变换而得到<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup> |
| 估计 | 矩估计法：\( \hat{A} = \bar{x} - \sqrt{3}\,s \)，\( \hat{B} = \bar{x} + \sqrt{3}\,s \)；最大似然法：样本最小值与最大值<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup> |
| 历史 | 由亚伯拉罕·棣莫弗（Abraham de Moivre）于 1725 年引入，是第一个连续概率分布；托马斯·辛普森（Thomas Simpson）于 1756 年和 1757 年将其卷积应用于观测误差<sup>[3](https://www.researchgate.net/publication/240763067_On_the_relevance_of_convolution_of_uniform_distributions_to_the_theory_of_errors)</sup> |

## 定义与基本函数

以 \( A \) 为位置参数、\( B - A \) 为尺度参数，密度在两个端点之间恒为 \( 1/(B-A) \)，因此任何长度相等的子区间都具有相同的概率。\( A = 0 \)、\( B = 1 \) 的情形即标准均匀分布。<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup> 标准区间上的累积分布函数简单地就是 \( 0 \le x \le 1 \) 时的 \( F(x) = x \)，分位点函数为 \( G(p) = p \)，生存函数为 \( S(x) = 1 - x \)，危险函数为 \( 0 \le x < 1 \) 时的 \( h(x) = 1/(1-x) \)。<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup>

该分布关于其中点对称，这正是偏度为 0、均值与中位数重合的原因。<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup> 对于标准均匀分布，方差为 \( 1/12 \)，约为 0.0833，R 的文档正是用这个值来检验模拟样本。<sup>[4](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Uniform.html)</sup>

## 最大熵

在所有局限于有限区间的分布中，均匀分布具有最大的微分熵，\( h(p) = -\int p(\theta) \log p(\theta)\,d\theta \)。这正是最大熵原理的基础：如果唯一的先验知识是某参数位于 \([a, b]\) 内，那么最能代表这一知识状态的分布就是均匀分布，其密度在该区间上为 \( 1/(b-a) \)。<sup>[2](https://link.springer.com/chapter/10.1007/978-3-030-95860-2_4)</sup> 同样的最大化在离散情形下也成立，此时离散均匀分布在有限取值集合上最大化香农熵。<sup>[5](https://statproofbook.github.io/P/duni-maxent.html)</sup>

这种作为最大熵、最大无知模型的作用有其局限。一个量上的均匀分布在变量变换后并不均匀：正方形边长的均匀分布意味着其面积上的非均匀分布，反之亦然。贝特朗悖论（Bertrand's paradox）展示了类似的不唯一性：在同一对象空间上，“均匀”可以有多种定义方式。<sup>[6](https://www.mdpi.com/2227-7390/11/15/3282)</sup>

## 随机数生成与模拟

均匀分布在模拟中占据核心地位，因为几乎所有随机数生成器都在 (0,1) 区间上产生数值，而其他分布的数值则通过对这些均匀抽样进行变换而得到。<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup> 通用的变换方法是逆变换采样：若 \( U \) 在 \([0,1]\) 上均匀分布，\( F \) 是连续且严格递增的累积分布函数，则 \( X = F^{-1}(U) \) 服从分布 \( F \)。<sup>[7](https://riskhub.org/maths-for-quants/course-content/numerical-analysis-primer/making-random-numbers-work-simulation-and-its-error/where-a-random-number-actually-comes-from-3794)</sup> 当累积分布函数的逆没有闭式表达时，则用数值方法求逆。<sup>[8](https://www.researchgate.net/publication/46269220_Black-Box_Algorithms_for_Sampling_from_Continuous_Distributions)</sup>

软件反映了这一结构。R 提供了 `dunif`、`punif`、`qunif` 和 `runif`，分别用于密度、累积分布、分位数以及在从 `min` 到 `max` 的区间上的随机生成，默认值为 0 和 1；默认情况下 `runif` 不生成两个极端值。<sup>[4](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Uniform.html)</sup> 在 SciPy 中，`scipy.stats.uniform` 的标准形式是 \([0, 1]\) 上的均匀分布，通过 `loc` 和 `scale` 参数给出 \([loc, loc + scale]\) 上的分布。<sup>[9](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.uniform.html)</sup> 生成的数值是伪随机的：确定性算法产生一个除总体统计性质外无可辨规律的序列，生成器以系统时钟等熵源为种子。<sup>[10](https://xlinux.nist.gov/dads/HTML/pseudorandomNumberGen.html)</sup>

## 从数据估计

给定一个样本，矩估计法将端点估计为 \( \hat{A} = \bar{x} - \sqrt{3}\,s \) 和 \( \hat{B} = \bar{x} + \sqrt{3}\,s \)，其中 \( \bar{x} \) 是样本均值，\( s \) 是样本标准差。最大似然估计量是样本最小值 \( Y_1 \) 和最大值 \( Y_n \)，可通过令 \( A = a - h \)、\( B = a + h \)，用中程数估计 \( a \)、用样本极差的一半估计 \( h \) 而得到。<sup>[1](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)</sup> 对该分布而言，次序统计量具有简单的形式：容量为 \( n \) 的样本中第 \( r \) 个次序统计量的期望值为 \( E(u_{r:n}) = r/(n+1) \)。<sup>[11](https://itl.nist.gov/div898/software/dataplot/refman2/auxillar/ordstmea.htm)</sup>

## 测量不确定度

在测量科学中，均匀（矩形）分布是输入量的默认 B 类模型，适用于该量的值仅已知位于界限 \( a_{-} \) 与 \( a_{+} \) 之间、且没有矛盾信息的情形。最佳估计为其中点 \( (a_{+} + a_{-})/2 \)，标准不确定度为半宽 \( a = (a_{+} - a_{-})/2 \) 除以 \( \sqrt{3} \)。如果已知区间中心附近的值更可能出现，则三角形分布或正态分布可能是更好的模型。<sup>[12](https://pml.nist.gov/cuu/Uncertainty/typeb.html)</sup> 在端点 \( \pm a \) 已知的分布中，均匀分布给出保守的不确定度估计，但并非可能的最大标准差。<sup>[13](https://www.itl.nist.gov/div898/handbook/mpc/section5/mpc541.htm)</sup><sup> • </sup><sup>[14](https://www.scirp.org/journal/paperinformation?paperid=74880)</sup>

## 历史

均匀分布似乎是第一个连续概率分布。埃德蒙·哈雷（Edmund Halley）1694 年关于数学人口学的论文和尼古拉·伯努利（Nicolas Bernoulli）1709 年的学位论文中包含了它的初步经验形式。亚伯拉罕·棣莫弗在其 1725 年关于年金的著作中赋予该分布确定的形态，用均匀随机变量表示寿命长度，并以此引入了连续概率分布；他也是第一个考虑正态分布的人，尽管只是作为二项分布的近似。托马斯·辛普森随后做出了重要贡献，于 1756 年和 1757 年将均匀分布的卷积——即三角形分布——应用于观测误差的分布，使他成为第一个引入误差概率分布概念的人。于是，均匀分布在误差理论的最初起源处便已出现，早于正态分布成为标准误差模型。<sup>[3](https://www.researchgate.net/publication/240763067_On_the_relevance_of_convolution_of_uniform_distributions_to_the_theory_of_errors)</sup>

## References

1. [Uniform Distribution, NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.6.6.2](https://itl.nist.gov/div898/handbook/eda/section3/eda3662.htm)
2. [Bayesian Interpretation of Regularization, Springer Nature Link](https://link.springer.com/chapter/10.1007/978-3-030-95860-2_4)
3. [On the relevance of convolution of uniform distributions to the theory of errors, Acta Geod. Geoph. Hung. 40 (2005)](https://www.researchgate.net/publication/240763067_On_the_relevance_of_convolution_of_uniform_distributions_to_the_theory_of_errors)
4. [R: The Uniform Distribution, R stats manual](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Uniform.html)
5. [Discrete uniform distribution maximizes entropy for finite support, The Book of Statistical Proofs](https://statproofbook.github.io/P/duni-maxent.html)
6. [Bertrand's Paradox Resolution and Its Implications for the Bing–Fisher Problem, Mathematics 11 (2023)](https://www.mdpi.com/2227-7390/11/15/3282)
7. [Where a Random Number Actually Comes From, Risk Hub numerical analysis primer](https://riskhub.org/maths-for-quants/course-content/numerical-analysis-primer/making-random-numbers-work-simulation-and-its-error/where-a-random-number-actually-comes-from-3794)
8. [Black-Box Algorithms for Sampling from Continuous Distributions](https://www.researchgate.net/publication/46269220_Black-Box_Algorithms_for_Sampling_from_Continuous_Distributions)
9. [scipy.stats.uniform, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.uniform.html)
10. [pseudo-random number generator, NIST Dictionary of Algorithms and Data Structures](https://xlinux.nist.gov/dads/HTML/pseudorandomNumberGen.html)
11. [ORDER STATISTIC MEANS, Dataplot Reference Manual, NIST](https://itl.nist.gov/div898/software/dataplot/refman2/auxillar/ordstmea.htm)
12. [Evaluating uncertainty components: Type B, NIST Physics Laboratory](https://pml.nist.gov/cuu/Uncertainty/typeb.html)
13. [Standard deviations from assumed distributions, NIST/SEMATECH e-Handbook, section 2.5.4.1](https://www.itl.nist.gov/div898/handbook/mpc/section5/mpc541.htm)
14. [The Uncertainty Principle in Terms of Isoperimetric Inequalities](https://www.scirp.org/journal/paperinformation?paperid=74880)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Probability distributions › Distribution families and classification › Continuous univariate distribution families

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/continuous-uniform-distribution

English original: https://www.edgepedia.org/continuous-uniform-distribution
