class: middle, center .large[Cumulative distribution functions]
 --- # [Cumulative Distribution Function (CDF)](https://en.wikipedia.org/wiki/Cumulative_distribution_function) The .red[cumulative distribution function] of a RV $X$ is defined by $$F_X(x)=\text{P}(X \leq x), \;\;\;\;\;\text{for all $x$.}$$ -- It is the probability that the value of $X$ is .red[at most] $x$. -- Loosely speaking, the CDF .red[accumulates] the probability .red[up to] the value $x$. -- If RV $X$ is discrete, $$F_X(x)=\text{P}(X \leq x)=\sum_{k \leq x} p_X(k)$$ --- # Finding CDF $X$: Roll a die 🎲 and record the number What is the CDF of $X$? -- $$\text{CDF def:} \;\;\;\; F_X(x)=\text{P}(X \leq x), \;\;\;\;\;\text{for all $x$.}$$ -- .left[] --- .center[] -- $$ \small{ F_X(x) = \begin{cases} 0, & \text{if $ x < 1$,} \\\ 1/6, & \text{if } 1 \leq x < 2, \\\ 2/6, & \text{if } 2 \leq x < 3, \\\ 3/6, & \text{if } 3 \leq x < 4, \\\ 4/6, & \text{if } 4 \leq x < 5, \\\ 5/6, & \text{if } 5 \leq x < 6, \\\ 1, & \text{if } x \geq 6. \\\ \end{cases} } $$ -- For discrete RVs the CDF $F_X(x)$ is a .green[step function] of $x$. --- $X$: Toss a coin twice and record the number of heads. What is the CDF of $X$? -- $$ \small{ p_X(x) = \begin{cases} 0.25, & \text{if $x = 0$ or 2}, \\\ 0.5, & \text{if $x = 1$,} \\\ 0, & \text{otherwise.} \end{cases} } $$ -- .center[] -- $$ \small{ F_X(x) = \begin{cases} 0, & \text{if $x < 0$,} \\\ 0.25, & \text{if } 0 \leq x < 1, \\\ 0.75, & \text{if } 1 \leq x < 2, \\\ 1, & \text{if } x \geq 2. \\\ \end{cases} } $$ --- If $X$ only takes integer values, its PMF can be obtained from CDF by .red[differencing]. $$ \small{ \begin{aligned} p_X(k)&=\text{P}(X \leq k) - \text{P}(X \leq k-1) \\\ &= F_X(k) - F_X(k-1) \\\ \end{aligned} } $$ -- .center[] -- $$ \small{ \begin{aligned} p_X(0)&=F_X(0)-F_X(-1)=0.25-0=0.25 \\\ \\\ p_X(1)&=F_X(1)-F_X(0)=0.75-0.25=0.5 \\\ \\\ p_X(2)&=F_X(2)-F_X(1)=1-0.75=0.25 \\\ \end{aligned} } $$ --- # Properties of CDF $F_X(x)$ $F_X(x)$ is .red[nondecreasing]. $$ \begin{aligned} \text{If } a &\leq b, \\\ \\\ \text{then } F_X(a) &\leq F_X(b). \end{aligned} $$ -- $F_X(x)$ tends to $0$ as $x\rightarrow -\infty$, and to $1$ as $x \rightarrow +\infty$. .center[]