Probability density functions

The preceding page explained why a continuous distribution assigns zero probability to an exact value. Suppose R is the speaking rate of an utterance in syllables per second. A table of point masses thus cannot describe how probability is arranged across its support.

A probability density function, abbreviated PDF, is a function f_R:\mathbb R\to[0,\infty) satisfying

\mathbb{P}(R\in A)=\int_A f_R(r)\,\mathrm{d}r

for every measurable set A. Probability is obtained by integration, not by reading the density at one point.

The distinction is visible in the statement

\mathbb{P}(R=4)=0

even when f_R(4) is positive. The height describes how quickly probability accumulates near 4 syllables per second.

Beginning with a simple density

Consider the constructed function

f_R(r)\equiv \begin{cases} \frac{1}{4} & \text{if }2\leq r\leq6,\\ 0 & \text{otherwise}. \end{cases}

The density has height 1/4 across an interval of width 6-2=4. Its total area is

4\times\frac{1}{4}=1.

Thus the function allocates one unit of total probability across its support.

Finding an interval probability by hand

What is the probability that speaking rate falls between 3 and 5 syllables per second? The interval has width 2 and density height 1/4, so its area is

\begin{aligned} \mathbb{P}(3\leq R\leq5) &=2\times\frac{1}{4}\\ &=.50. \end{aligned}

Integral notation expresses the same area calculation:

\mathbb{P}(3\leq R\leq5) =\int_3^5 f_R(r)\,\mathrm{d}r.

The integral adds the areas of narrow strips across the selected interval. In this constant height example, it reduces to width times height.

Checking the two PDF requirements

A density must be nonnegative:

f_R(r)\geq0 \qquad\text{for every }r.

Its total area must equal one:

\int_{-\infty}^{\infty}f_R(r)\,\mathrm{d}r=1.

These conditions concern area. A density height may exceed one when it is concentrated on a narrow interval. For instance, height 2 across an interval of width .5 gives area 2\times.5=1.

Checking the area in base R

Code
rate_density <- function(r) {
  ifelse(r >= 2 & r <= 6, 1 / 4, 0)
}

integrate(rate_density, lower = 2, upper = 6)$value
integrate(rate_density, lower = 3, upper = 5)$value

The returned values are one for the complete support and .5 for the selected interval.

Interpreting density in measurement units

The density f_R(r) has units reciprocal to those of R. Because R is measured in syllables per second, f_R(r) is measured in seconds per syllable. Multiplying by an interval width measured in syllables per second cancels the units and produces a unitless probability.

This unit check is another reason not to interpret density height as probability. The two objects have different units as well as different mathematical roles.

Density height is not point probability

The value f_R(r) is not \mathbb{P}(R=r). If f_R(4)=.25, it is incorrect to say that the probability of exactly 4 syllables per second is .25. The point probability is zero under the continuous model.

The valid interpretation concerns a region: probability near 4 accumulates at a rate described by the density height, and an interval probability is the area across that region.

Check your understanding

  1. Under the constructed density, compute \mathbb{P}(2\leq R\leq3) by width times height.
  2. Why may a density height exceed one without producing a probability larger than one?
  3. Explain what f_R(4)=.25 says and what it does not say.
  4. A candidate density has height .2 from 0 to 4 and zero elsewhere. Does it have total area one?

Mass and density represent probability differently. The next page gives one threshold function that applies to both representations.