The uniform distribution

The earlier density page represented continuous probability by area. Suppose a psycholinguistic experiment places an auditory cue at a randomized time between 200 and 800 ms after word onset, with equal width intervals inside this window equally probable.

The continuous uniform distribution represents a constant density across a bounded interval. Write

X\sim\operatorname{Uniform}(a,b), \qquad a<b.

For the cue procedure, a=200 and b=800.

Deriving the density height

The support width is

b-a.

If the constant density height is h, the rectangular area must equal one:

h(b-a)=1.

Solving gives

h=\frac{1}{b-a}.

Thus the PDF is

f_X(x)\equiv \begin{cases} \dfrac{1}{b-a} & \text{if }a\leq x\leq b,\\ 0 & \text{otherwise}. \end{cases}

For the 200 to 800 ms window, the width is 600 ms and the density height is

\frac{1}{600}

per millisecond.

Calculating an interval probability

What is the probability that the cue occurs between 350 and 500 ms? The selected interval has width

500-350=150\text{ ms}.

Its probability is the rectangular area

\begin{aligned} \mathbb{P}(350\leq X\leq500) &=150\left(\frac{1}{600}\right)\\ &=.25. \end{aligned}

Every 150 ms interval fully contained in the support has the same probability. This equal area property is the meaning of uniformity.

An individual point still has probability zero:

\mathbb{P}(X=350)=0.

The family is uniform over interval widths, not positive point masses.

Reading the mean and variance

The mean lies at the midpoint:

\mathbb{E}[X]=\frac{a+b}{2}.

For the cue window,

\mathbb{E}[X]=\frac{200+800}{2}=500\text{ ms}.

The variance is

\operatorname{Var}(X)=\frac{(b-a)^2}{12}.

Here

\operatorname{Var}(X)=\frac{600^2}{12}=30{,}000\text{ ms}^2.

The mean describes the center of repeated random cue placements. It does not make 500 ms more likely than another exact value in the window.

Checking the calculations in base R

Code
dunif(400, min = 200, max = 800)
punif(500, min = 200, max = 800) -
  punif(350, min = 200, max = 800)
(200 + 800) / 2
(800 - 200)^2 / 12

The four results are the density height, interval probability, mean, and variance.

A density height may exceed one

If the support is (0,.5), its width is .5 and its density height is 2. The total area remains

.5(2)=1.

The height exceeds one because it is measured per unit of X. It is not itself a probability.

Uniform density does not give positive point probabilities

Under a continuous uniform model, every point has probability zero. Equal width intervals, not individual points, have equal positive probability.

The distinction matters when a randomization program uses a finite set of integer millisecond times. That implementation is discrete, even if a continuous uniform family is a useful approximation.

Check your understanding

  1. For a cue window from 100 to 400 ms, compute the density height.
  2. In that window, what is the probability of an onset between 175 and 250 ms?
  3. Why is the density at 200 ms not the probability of exactly 200 ms?
  4. How would a program restricted to the integer values 100 through 400 change the support?

The uniform family fixes density height across a bounded interval. The next page retains a bounded support while allowing density to change across it.