19.3 Real-valued distributions
So far, we have talked about discrete random variables, that is, random variables with countably many values. However, not all experiments/observations/measurements are like this. For instance, the height of a person is a random variable that can assume a continuum of values.
To give a tractable example, let’s pick a number X from [0,1], with each one having an “equal chance.” In this context, equal chance means that
Can we describe X with a single real function? As in the discrete case, we can try
but this wouldn’t work. Why?
Because for each x ∈X, we have P(X = x) = 0. That is, picking a particular number x has zero probability. Instead, we can try FX(x) = P(X ≤x), which is
We can plot this for visualization:
from scipy.stats import uniform
X = np.linspace(-0.5, 1.5, 100)
y = uniform.cdf(X)
with plt.style.context(’seaborn-v0_8’):
plt.figure(figsize=(10, 5))
plt.title...