22 Probability Density Functions of Continuous Random Variables
- The continuous analog of a probability mass function (pmf) is a probability density function (pdf).
- However, while pmfs and pdfs play analogous roles, they are different in one fundamental way; namely, a pmf outputs probabilities directly, while a pdf does not.
- For a continuous random variable \(X\) with pdf \(f_X\), the probability that \(X\) takes a value in the interval \([a, b]\) is the area under the pdf over the region \([a,b]\).
- The probability density function (pdf) (a.k.a. density) of a continuous RV \(X\) is the function \(f_X\) which satisfies \[\begin{align} \text{P}(a \le X \le b) & =\int_a^b f_X(x) dx, \qquad \text{for any } -\infty \le a \le b \le \infty \end{align}\]
- The axioms of probability imply that a valid pdf must satisfy \[\begin{align} f_X(x) & \ge 0 \qquad \text{for all } x,\\ \int_{-\infty}^\infty f_X(x) dx & = 1 \end{align}\]
- A pdf is 0 outside the range of possible values. Given a specific pdf, the generic bounds like \((-\infty, \infty)\) in integrals should be replaced by the range of possible values.
Example 22.1 Recall Example 21.3. Based on earlier examples, it seems reasonable to assume that the pdf \(f_X\) is linear as a function of possible \(x\) values, with an intercept of 0 and positive slope; that is, \[ f_X(x) = \begin{cases} cx, & 0<x<60,\\ 0 & \text{otherwise.} \end{cases} \]
- Compute the value of \(c\). Note: this involves more than just reading off a value from a plot. What is the key principle that will determine the value of \(c\)?
- Use the pdf (and geometry) to compute \(\text{P}(X < 15)\).
- Use the pdf (and geometry) to compute \(\text{P}(X > 45)\).
- Use the pdf (and geometry) to find an expression for the cdf of \(X\). (Compare to the cdf from Example 21.3.)
- If \(X\) is a continuous random variable with pdf \(f_X\), its cdf \(F_X\) satisfies \[ F_X(x) = \int_{-\infty}^x f_X(u) du \]
- Roughly, the cdf is the integral of the cdf
Example 22.2 Continuing Example 22.1. Han’s arrival time \(X\) (minutes after noon) has pdf \[ f_X(x) = \begin{cases} (2/3600)x, & 0<x<60,\\ 0 & \text{otherwise.} \end{cases} \] The corresponding cdf satisfies \(F_X(x) = (x/60)^2, 0<x<60\).
Compute and interpret \(\text{P}(X = 15)\) and \(\text{P}(X = 45)\).
Compute the probability that \(X\), truncated to the nearest minute, is 15 minutes after noon; that is, compute \(\text{P}(15 \le X<16)\). How does this probability compare to \(f(15)\)?
Compute the probability that \(X\), truncated to the nearest minute, is 45 minutes after noon; that is, compute \(\text{P}(45 \le X<46)\). How does this probability compare to \(f(45)\)?
Compute and interpret the ratio of the probabilities from the two previous parts. How does this ratio compare to \(f(45)/f(15)\)?
- The probability that a continuous random variable \(X\) equals any particular value is 0. That is, if \(X\) is continuous then \(\text{P}(X=x)=0\) for all \(x\).
- In practical applications involving continuous random variables, “equal to” really means “close to”, and “close to” probabilities correspond to intervals which can have positive probability.
- The density \(f_X(x)\) at value \(x\) is not a probability. Rather the height of the pdf \(f_X(x)\) is related to \(\text{P}(X \text{ is close to } x)\) in the following sense.
- Let \(\epsilon\) be a small number in the measurement units of \(X\). Then \[ \text{P}(x - 0.5\epsilon < X< x + 0.5\epsilon) \approx f_X(x)\epsilon \] For example, \(\epsilon=0.01\) represents “close to” as rounding to two decimal places.
- In other words, \[ f_x(x) \approx \frac{\text{P}(x - 0.5\epsilon < X< x + 0.5\epsilon)}{\epsilon} = \frac{F_X(x + 0.5\epsilon) - F_X(x - 0.5\epsilon)}{\epsilon} \]
- Taking the limit as \(\epsilon\to0\), we see that the pdf is the derivative of the cdf \[ f_X(x) = \frac{d}{dx} F_X(x) \]
- For any two possible values \(x_1\) and \(x_2\) \[ \frac{\text{P}(X \text{ is close to } x_1)}{\text{P}(X \text{ is close to } x_2)} \approx \frac{f_X(x_1)}{f_X(x_2)} \] regardless of how “close to” is defined (as long as it’s reasonably “small”)
Example 22.3 Continuing Example 21.2. Let \(X\) be the times (minutes) until the next earthquake occurs (of any magnitude in a certain region). Assume that the pdf of \(X\) is \[ f_X(x) = (1/120) e^{-x/120}, \qquad x \ge0 \]
- Sketch the pdf of \(X\). What does this tell you about waiting times?
- Without doing any integration, approximate the probability that \(X\) rounded to the nearest second is 30 minutes.
- Without doing any integration determine how much more likely that \(X\) rounded to the nearest second is to be 30 than 60 minutes.
- Compute and interpret \(\text{P}(X < 30)\).
- Compute and interpret \(\text{P}(X > 360)\).
- Find the cdf of \(X\).
- Find the 25th percentile of \(X\).
- Find the quantile function of \(X\).
- Sketch a spinner for simulating values of \(X\).