Continuous distributions and density functions
Introduced| English | Meaning |
|---|---|
| probability density function/ˌprɒbəˈbɪlɪti ˈdensɪti ˈfʌŋkʃn/ | A function whose area over an interval gives the probability that a continuous random variable falls within that interval. |
| continuous random variable/kənˈtɪnjuːəs ˈrændəm ˈveərɪəbl/ | A random variable modelled over a continuous range, with probabilities represented by areas under a density function. |
| mode/məʊd/ | A most frequent data value, or a value where a continuous density attains its maximum. |
Erlang's telephone calls, 1909
- In 1909, Agner Krarup Erlang, an engineer at the Copenhagen Telephone Company, published a study of how long calls last and how often they arrive. A call length can be any value, not just whole minutes, so he described it with a curve instead of a table.
- Such a curve is a probability density function 概率密度函数 (pdf). In S2, probabilities for a continuous random variable 连续型随机变量 are areas under it.
The density function
- A pdf $f(x)$ is never negative and has total area 1: $\displaystyle\int f(x)\,dx = 1$. Then $\mathrm{P}(a < X < b) = \displaystyle\int_a^b f(x)\,dx$.
- $f(x) = \dfrac{x}{8}$ on $0 \le x \le 4$ is a pdf, since $\displaystyle\int_0^4 \frac{x}{8}\,dx = \frac{16}{16} = 1$. For a single value, $\mathrm{P}(X = 2) = 0$.
$f(x) = kx^2$ for $0 \le x \le 3$ is a pdf. Find $k$, to 4 d.p.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
$k \times \tfrac{27}{3} = 1$, so $k = \tfrac{1}{9}$.
For $f(x) = \tfrac{x}{8}$ on $0 \le x \le 4$, find $\mathrm{P}(1 < X < 3)$.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
$\tfrac{9 - 1}{16} = 0.5$.
The cumulative distribution function
- $F(x) = \mathrm{P}(X \le x) = \displaystyle\int_{-\infty}^{x} f(t)\,dt$. It rises from 0 to 1, and $f(x) = F'(x)$.
- For $f(x) = \tfrac{x}{8}$: $F(x) = \dfrac{x^2}{16}$ on $0 \le x \le 4$, with $F(x) = 0$ below and $F(x) = 1$ above.
Continuous distributions and density functions
A density f must be nonnegative and integrate to 1 over its support
Compare the model with the worked case and explain one change.
$F(x) = \tfrac{x^3}{27}$ for $0 \le x \le 3$. What is $f(x)$ there?
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Differentiate: $\tfrac{3x^2}{27}$.
Worked example: mean, variance and median
$X$ has pdf $f(x) = \dfrac{x}{8}$ for $0 \le x \le 4$. Find $\mathrm{E}(X)$, $\mathrm{Var}(X)$, the median and $\mathrm{P}(X > 3)$.
- Mean: $\mathrm{E}(X) = \displaystyle\int_0^4 \frac{x^2}{8}\,dx = \frac{64}{24} = \frac{8}{3}$.
- Variance: $\mathrm{E}(X^2) = \displaystyle\int_0^4 \frac{x^3}{8}\,dx = 8$, so $\mathrm{Var}(X) = 8 - \tfrac{64}{9} = \tfrac{8}{9}$.
- Median and tail: $F(m) = \tfrac{m^2}{16} = 0.5$ gives $m = 2\sqrt{2} = 2.83$; $\mathrm{P}(X > 3) = 1 - \tfrac{9}{16} = \tfrac{7}{16}$.
For $f(x) = \tfrac{1}{9}x^2$ on $0 \le x \le 3$, find $\mathrm{E}(X)$.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
$\int_0^3 \tfrac{x^3}{9}\,dx = \tfrac{81}{36} = 2.25$.
Mode and quartiles
- The mode 众数 is where $f(x)$ is greatest — at the top of the curve, found by differentiating or from a sketch. For $f(x) = \tfrac{x}{8}$ it is the end point $x = 4$.
- Quartiles solve $F(q) = 0.25$ and $F(q) = 0.75$: here $q_1 = 2$ and $q_3 = 2\sqrt{3} = 3.46$.
For $F(x) = \tfrac{x^3}{27}$ on $0 \le x \le 3$, find the median to 3 s.f.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
$m^3 = 13.5$, so $m = 2.38$.
The continuous uniform distribution
- $X \sim \mathrm{U}[a, b]$ has constant density $\dfrac{1}{b - a}$, mean $\dfrac{a + b}{2}$ and variance $\dfrac{(b - a)^2}{12}$.
- A length rounded to the nearest cm has error $\mathrm{U}[-0.5, 0.5]$: mean 0, variance $\tfrac{1}{12}$, and $\mathrm{P}(|\text{error}| < 0.2) = 0.4$.
$X \sim \mathrm{U}[2, 8]$. Find $\mathrm{Var}(X)$.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
$\tfrac{(8 - 2)^2}{12} = 3$.
Reading $f(x)$ as a probability. A density value is not a probability and can be larger than 1: $\mathrm{U}[0, 0.5]$ has $f(x) = 2$. Probabilities come from areas, $\int f(x)\,dx$, or from differences of $F$.
A probability density function can take values greater than 1.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Only the area must be 1: $\mathrm{U}[0, 0.25]$ has $f(x) = 4$.
A pdf is never negative and has total area 1; probabilities are areas. $F(x) = \mathrm{P}(X \le x)$ and $f = F'$. $\mathrm{E}(X) = \int xf(x)\,dx$, $\mathrm{Var}(X) = \int x^2f(x)\,dx - \mu^2$. Medians and quartiles solve $F(x) = 0.5$, 0.25, 0.75; the mode is where $f$ is greatest. $\mathrm{U}[a, b]$ has mean $\tfrac{a + b}{2}$ and variance $\tfrac{(b - a)^2}{12}$.
$f(x) = \tfrac{3}{32}x(4 - x)$ for $0 \le x \le 4$. Show it is a pdf, then find $\mathrm{E}(X)$ and the mode, explaining why they are equal.
Area, then mode and mean.