What is a Cumulative Distribution Function (CDF)?
The cumulative distribution function, or cdf, of a random variable tells us the probability that it is less than or equal to any chosen value.
For a random variable $X$, we write
$$F_X(t)=\mathbb{P}(X\leq t).$$
The word cumulative is helpful here: the cdf collects up (or “accumulates”) all the probability up to and including $t$.
For example, suppose $Y$ is the result of rolling a fair die. Then
$$F_Y(3)=\mathbb{P}(Y\leq 3)=\frac{3}{6}=\frac{1}{2}.$$
We get this by adding the probabilities of rolling 1, 2 or 3.
More generally, for a discrete random variable,
$$F_X(t)=\mathbb{P}(X\leq t)=\sum_{x\leq t}\mathbb{P}(X=x).$$
Importantly, the cdf is defined for every real value of $t$, not just values that $X$ itself can take. For the fair die, for instance,
$$F_Y(3.7)=\frac{1}{2},$$
since the possible values less than or equal to 3.7 are still just 1, 2 and 3. The cdf of a discrete random variable typically looks like a step function.
Now suppose that $X$ is continuous, with probability density function $f_X(x)$. Recall that probabilities are then given by areas under the pdf.
So $F_X(t)=\mathbb{P}(X\leq t)$ is simply the total area under the pdf to the left of $t$:
$$F_X(t)=\int_{-\infty}^{t}f_X(x),dx.$$
This is the same idea as in the discrete case. We are still accumulating probability up to a chosen value; we are just using an integral rather than a sum.
For continuous random variables, the cdf and pdf are therefore closely related. At points where the cdf is differentiable, we can recover the pdf by differentiating:
$$f_X(x)=\frac{dF_X(x)}{dx}.$$
So, whether $X$ is discrete or continuous, the definition of the cdf is always the same:
$$F_X(t)=\mathbb{P}(X\leq t).$$
Only the way we calculate this probability changes.
Since a cdf gives probabilities, it must always satisfy
$$0\leq F_X(t)\leq 1.$$
As $t$ moves further to the right, more probability is accumulated, so the cdf can only stay the same or increase.
Background:
Understanding Econometrics is completely free to use, and always will be.
If you found the site useful and would like to help me keep adding new material, please consider buying me a coffee! Buy me a coffee ☕