Lably
Skip to content

Continuous uniform distribution

Uniform distribution on an interval

  • 10 min read
  • 7 chapters

Related on Lably

Through Statistics, Probability distribution and Interval (mathematics)

Definitions

Probability density function

The probability density function of the continuous uniform distribution is f(x)={1b−afor a≤x≤b,0for x<a or x>b.

The values of f(x) at the two boundaries a and b are usually unimportant, because they do not alter the value of ∫cdf(x)dx over any interval [c,d], nor of ∫abxf(x)dx, nor of any higher moment. Sometimes they are chosen to be zero, and sometimes chosen to be 1b−a. The latter is appropriate in the context of estimation by the method of maximum likelihood. In the context of Fourier analysis, one may take the value of f(a) or f(b) to be 12(b−a), because then the inverse transform of many integral transforms of this uniform function will yield back the function itself, rather than a function which is equal "almost everywhere", i.e. except on a set of points with zero measure. Also, it is consistent with the sign function, which has no such ambiguity.

Any probability density function integrates to 1, so the probability density function of the continuous uniform distribution is graphically portrayed as a rectangle where ⁠b−a⁠ is the base length and ⁠1b−a⁠ is the height. As the base length increases, the height (the density at any particular value within the distribution boundaries) decreases.

In terms of mean μ and variance σ2, the probability density function of the continuous uniform distribution is f(x)={12σ3for −σ3≤x−μ≤σ3,0otherwise.

Cumulative distribution function

The cumulative distribution function of the continuous uniform distribution is: F(x)={0for x<a,x−ab−afor a≤x≤b,1for x>b.

Its inverse is: F−1(p)=a+p(b−a) for 0<p<1.

In terms of mean μ and variance σ2, the cumulative distribution function of the continuous uniform distribution is: F(x)={0for x−μ<−σ3,12(x−μσ3+1)for −σ3≤x−μ<σ3,1for x−μ≥σ3;

its inverse is: F−1(p)=σ3(2p−1)+μ for 0≤p≤1.

Example 1. Using the continuous uniform distribution function

For a random variable X∼U(0,23), find Pr(2<X<18): Pr(2<X<18)=(18−2)⋅123−0=1623.

In a graphical representation of the continuous uniform distribution function [f(x) vs x], the area under the curve within the specified bounds, displaying the probability, is a rectangle. For the specific example above, the base would be ⁠16,⁠ and the height would be ⁠123.⁠

Example 2. Using the continuous uniform distribution function (conditional)

For a random variable X∼U(0,23), find Pr(X>12∣X>8): Pr(X>12∣X>8)=(23−12)⋅123−8=1115.

The example above is a conditional probability case for the continuous uniform distribution: given that ⁠X>8⁠ is true, what is the probability that ⁠X>12?⁠ Conditional probability changes the sample space, so a new interval length ⁠b−a′⁠ has to be calculated, where b=23 and a′=8. The graphical representation would still follow Example 1, where the area under the curve within the specified bounds displays the probability; the base of the rectangle would be ⁠11,⁠ and the height would be ⁠115.⁠

Generating functions

Moment-generating function

The moment-generating function of the continuous uniform distribution is: MX=E⁡[etX]=∫abetxdxb−a=etb−etat(b−a)=Bt−Att(b−a), from which we may calculate the raw moments mk: m1=a+b2, m2=a2+ab+b23, mk=∑i=0kaibk−ik+1.

For a random variable following the continuous uniform distribution, the expected value is m1=a+b2, and the variance is m2−m12=(b−a)212.

For the special case a=−b, the probability density function of the continuous uniform distribution is: f(x)={12bfor −b≤x≤b,0otherwise;

the moment-generating function reduces to the simple form: MX=sinh⁡btbt.

Cumulant-generating function

For ⁠n≥2,⁠ the n-th cumulant of the continuous uniform distribution on the interval ⁠[−12,12]⁠ is Bnn, where Bn is the n-th Bernoulli number.

Standard uniform distribution

The continuous uniform distribution with parameters a=0 and b=1, i.e. U(0,1), is called the standard uniform distribution.

One interesting property of the standard uniform distribution is that if u1 has a standard uniform distribution, then so does 1−u1. This property can be used for generating antithetic variates, among other things. In other words, this property is known as the inversion method where the continuous standard uniform distribution can be used to generate random numbers for any other continuous distribution. If u1 is a uniform random number with standard uniform distribution, i.e. with U(0,1), then x=F−1(u1) generates a random number x from any continuous distribution with the specified cumulative distribution function F.

Relationship to other functions

As long as the same conventions are followed at the transition points, the probability density function of the continuous uniform distribution may also be expressed in terms of the Heaviside step function as: f(x)=H⁡(x−a)−H⁡(x−b)b−a,

or in terms of the rectangle function as: f(x)=1b−arect⁡(x−a+b2b−a).

There is no ambiguity at the transition point of the sign function. Using the half-maximum convention at the transition points, the continuous uniform distribution may be expressed in terms of the sign function as: f(x)=sgn⁡(x−a)−sgn⁡(x−b)2(b−a).

Sign in to keep reading

6 more chapters are free with a Lably account.

More in Statistics and probability