Cumulative distribution function


A cumulative distribution function (CDF) is a function associated with a Random variable that gives the Probability that the variable will take a value less than or equal to some value xx.

Formally, for a random variable XX, its cumulative density function FX(x)F_{X}(x) is

FX(x)=P(Xx)F_{X}(x)= P(X\leq x)

where PP is a measure of probability. The probability that XX lies within the semi-closed interval ]a,b]]a,b] is

P(axb)=FX(b)FX(a)P(a\leq x\leq b)=F_{X}(b)-F_{X}(a)

If XX's Probability distribution has a Probability density function fX(x)f_{X}(x), we can state

fX(x)=ddxFX(x),FX(x)=xfX(u)duf_{X}(x)=\frac{d}{dx}F_{X}(x),\quad F_{X}(x)=\int_{-\infty}^{x}f_{X}(u)du

In this case, the CDF is said to identify the distribution.

Properties

  • F()=0F(-\infty)=0
  • F(+)=1F(+\infty)=1
  • The inverse of the CDF is defined as F1(p)=min(xF(x)p)F^{-1}(p)=\min(x|F(x)\geq p) where 0p10\leq p\leq 1. If FF is continuous, this is equivalent to the usual definition of inverse. F1F^{-1} is the Quantile function.
  • If FF is continuous, then the random variable W=FX(X)W=F_{X}(X) follows a Uniform distribution. If it does, then the random variable X=FX1(W)X=F^{-1}_{X}(W) has FF as its CDF1.
  • The CDF can exist even if the PDF doesn't: for instance, discrete probability distributions have a CDF without a PDF. More generally, a probability distribution has a PDF if and only if its CDF is absolutely continuous.

Empirical CDF

The empirical cumulative distribution function (ECDF) is the CDF that is obtained from empirical measurements. Since measurements are discrete, the ECDF is always discrete. As the empirical data increases in number, the ECDF starts to approximate a continuous CDF.

Footnotes

  1. Basically, you can freely convert between XX and WW as long as you know FXF_{X} and its inverse FX1F^{-1}_{X}. This might seem like a forgettable property, but it's central to the inversion sampling method for generating data following a PDF fX(x)=FX(x)dxf_{X}(x)=\int_{-\infty}^{\infty}F_{X}(x)dx.