Uniform Distribution#

Univariate, Continuous, Symmetric, Bounded

The Uniform distribution is a continuous probability distribution bounded between two real numbers, \(lower\) and \(upper\), representing the lower and upper bounds, respectively.

The probability density of the Uniform distribution is constant between \(lower\) and \(upper\) and zero elsewhere. Some experiments of physical origin exhibit this kind of behaviour. For instance, if we record, for a long time, the times at which radioactive particles are emitted within each hour, the outcomes will be uniform on the interval [0, 60] minutes interval.

The Uniform distribution is the maximum entropy probability distribution for a random variable under no constraint other than that it is contained in the interval \([lower,upper]\). It’s often employed for generating random numbers from the cumulative distribution function (see inverse transform sampling). It is also used as the basis of some statistical tests (see probability integral transform). Sometimes, it can be used as a “non-informative” (flat) prior in Bayesian statistics when there is no prior knowledge about the parameter other than its range, but this is discouraged unless the range has a physical meaning and values outside of it are impossible.

Key properties and parameters#

Support

\(x \in [lower, upper]\)

Mean

\(\dfrac{lower + upper}{2}\)

Variance

\(\dfrac{(upper - lower)^2}{12}\)

Parameters:

  • \(lower\) : (float) Lower bound of the distribution.

  • \(upper\) : (float) Upper bound of the distribution, \(upper > lower\).

Probability Density Function (PDF)#

\[\begin{split} f(x \mid lower, upper) = \begin{cases} \dfrac{1}{upper - lower} & \text{for } x \in [lower, upper] \\ 0 & \text{otherwise} \end{cases} \end{split}\]
Uniform Distribution PDF

Cumulative Distribution Function (CDF)#

\[\begin{split} F(x \mid lower, upper) = \begin{cases} 0 & \text{for } x < lower \\ \dfrac{x - lower}{upper - lower} & \text{for } x \in [lower, upper] \\ 1 & \text{for } x > upper \end{cases} \end{split}\]
Uniform Distribution CDF

See also

Related Distributions:

  • Beta - The Uniform distribution with \(lower=0\), \(upper=1\) is a special case of the Beta distribution with \(\alpha = \beta = 1\).

  • Beta Scaled - The Uniform distribution is a special case of the Beta Scaled distribution with \(\alpha = \beta = 1\) and \(lower\), \(upper\) parameters.

  • Discrete Uniform - The discrete version of the Uniform distribution.

References#