A cumulative density function (”CDF”) expresses the probability that the [[Random Variable]] $X$ is less or equal than some value $x$. Both discrete and continuous distributions have a CDF.
Below we show that it contains all probabilistic information that is needed to derive a PMF or PDF from it.
$ F_X(x)= \mathbf P(X \le x) $
![[cumulative-density-function.png|center|400]]
## Discrete Distribution
We obtain the CDF by summing up the [[Probability Mass Function|PMF]] over all $x$ that are $\le k$.
$ F_X(x)= \mathbf P(X \le x) = \sum_{k \le x}p_X(k) $
To get the value of a PMF at $k$ from a CDF, a subtraction by the CDF from the previous $(k-1)$ term is needed.
$ p_X(k) = F_X(k)-F_X(k-1) $
## Continuous Distribution
The CDF is the integral of the PDF from the left (i.e. $-\infty$) up to some value $x$.
$ F_X(x) = \mathbf P (X \le x) = \int_{-\infty}^x f_X(x) \,dx $
The derivative of an integral where the upper limit is the variable itself, results in the integrant $f_X(x)$. Therefore the derivative of the CDF is the PDF.
$ \frac{dF_X(x)}{dx}(x)=f_X(x) $
## Properties of a Cumulative Density Function
- Non decreasing: If some value $b \ge a$ then also $F_X(b) \ge F_X(a)$
- $F_X(x) \to 1$ when $x \to \infty$
- $F_X(x) \to 0$ when $x \to (-\infty)$