Cumulative distribution function

From HandWiki
Short description: Probability that random variable X is less than or equal to x

Cumulative distribution function for the exponential distribution
Cumulative distribution function for the normal distribution

In probability theory and statistics, the cumulative distribution function (CDF) of a real-valued random variable [math]\displaystyle{ X }[/math], or just distribution function of [math]\displaystyle{ X }[/math], evaluated at [math]\displaystyle{ x }[/math], is the probability that [math]\displaystyle{ X }[/math] will take a value less than or equal to [math]\displaystyle{ x }[/math].[1]

Every probability distribution supported on the real numbers, discrete or "mixed" as well as continuous, is uniquely identified by an upwards continuous[2] monotonic increasing cumulative distribution function [math]\displaystyle{ F : \mathbb R \rightarrow [0,1] }[/math] satisfying [math]\displaystyle{ \lim_{x\rightarrow-\infty}F(x)=0 }[/math] and [math]\displaystyle{ \lim_{x\rightarrow\infty}F(x)=1 }[/math].

In the case of a scalar continuous distribution, it gives the area under the probability density function from minus infinity to [math]\displaystyle{ x }[/math]. Cumulative distribution functions are also used to specify the distribution of multivariate random variables.


The cumulative distribution function of a real-valued random variable [math]\displaystyle{ X }[/math] is the function given by[3]:p. 77

[math]\displaystyle{ F_X(x) = \operatorname{P}(X\leq x) }[/math]






where the right-hand side represents the probability that the random variable [math]\displaystyle{ X }[/math] takes on a value less than or equal to [math]\displaystyle{ x }[/math].

The probability that [math]\displaystyle{ X }[/math] lies in the semi-closed interval [math]\displaystyle{ (a,b] }[/math], where [math]\displaystyle{ a \lt b }[/math], is therefore[3]:p. 84

[math]\displaystyle{ \operatorname{P}(a \lt X \le b)= F_X(b) - F_X(a) }[/math]






In the definition above, the "less than or equal to" sign, "≤", is a convention, not a universally used one (e.g. Hungarian literature uses "<"), but the distinction is important for discrete distributions. The proper use of tables of the binomial and Poisson distributions depends upon this convention. Moreover, important formulas like Paul Lévy's inversion formula for the characteristic function also rely on the "less than or equal" formulation.

If treating several random variables [math]\displaystyle{ X, Y, \ldots }[/math] etc. the corresponding letters are used as subscripts while, if treating only one, the subscript is usually omitted. It is conventional to use a capital [math]\displaystyle{ F }[/math] for a cumulative distribution function, in contrast to the lower-case [math]\displaystyle{ f }[/math] used for probability density functions and probability mass functions. This applies when discussing general distributions: some specific distributions have their own conventional notation, for example the normal distribution uses [math]\displaystyle{ \Phi }[/math] and [math]\displaystyle{ \phi }[/math] instead of [math]\displaystyle{ F }[/math] and [math]\displaystyle{ f }[/math], respectively.

The probability density function of a continuous random variable can be determined from the cumulative distribution function by differentiating[4] using the Fundamental Theorem of Calculus; i.e. given [math]\displaystyle{ F(x) }[/math], [math]\displaystyle{ f(x) = \frac{dF(x)}{dx} }[/math] as long as the derivative exists.

The CDF of a continuous random variable [math]\displaystyle{ X }[/math] can be expressed as the integral of its probability density function [math]\displaystyle{ f_X }[/math] as follows:[3]:p. 86 [math]\displaystyle{ F_X(x) = \int_{-\infty}^x f_X(t) \, dt. }[/math]

In the case of a random variable [math]\displaystyle{ X }[/math] which has distribution having a discrete component at a value [math]\displaystyle{ b }[/math], [math]\displaystyle{ \operatorname{P}(X=b) = F_X(b) - \lim_{x \to b^-} F_X(x). }[/math]

If [math]\displaystyle{ F_X }[/math] is continuous at [math]\displaystyle{ b }[/math], this equals zero and there is no discrete component at [math]\displaystyle{ b }[/math].


From top to bottom, the cumulative distribution function of a discrete probability distribution, continuous probability distribution, and a distribution which has both a continuous part and a discrete part.

Every cumulative distribution function [math]\displaystyle{ F_X }[/math] is non-decreasing[3]:p. 78 and right-continuous,[3]:p. 79 which makes it a càdlàg function. Furthermore, [math]\displaystyle{ \lim_{x \to -\infty} F_X(x) = 0, \quad \lim_{x \to +\infty} F_X(x) = 1. }[/math]

Every function with these four properties is a CDF, i.e., for every such function, a random variable can be defined such that the function is the cumulative distribution function of that random variable.

If [math]\displaystyle{ X }[/math] is a purely discrete random variable, then it attains values [math]\displaystyle{ x_1,x_2,\ldots }[/math] with probability [math]\displaystyle{ p_i = p(x_i) }[/math], and the CDF of [math]\displaystyle{ X }[/math] will be discontinuous at the points [math]\displaystyle{ x_i }[/math]: [math]\displaystyle{ F_X(x) = \operatorname{P}(X\leq x) = \sum_{x_i \leq x} \operatorname{P}(X = x_i) = \sum_{x_i \leq x} p(x_i). }[/math]

If the CDF [math]\displaystyle{ F_X }[/math] of a real valued random variable [math]\displaystyle{ X }[/math] is continuous, then [math]\displaystyle{ X }[/math] is a continuous random variable; if furthermore [math]\displaystyle{ F_X }[/math] is absolutely continuous, then there exists a Lebesgue-integrable function [math]\displaystyle{ f_X(x) }[/math] such that [math]\displaystyle{ F_X(b)-F_X(a) = \operatorname{P}(a\lt X\leq b) = \int_a^b f_X(x)\,dx }[/math] for all real numbers [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math]. The function [math]\displaystyle{ f_X }[/math] is equal to the derivative of [math]\displaystyle{ F_X }[/math] almost everywhere, and it is called the probability density function of the distribution of [math]\displaystyle{ X }[/math].


As an example, suppose [math]\displaystyle{ X }[/math] is uniformly distributed on the unit interval [math]\displaystyle{ [0,1] }[/math].

Then the CDF of [math]\displaystyle{ X }[/math] is given by [math]\displaystyle{ F_X(x) = \begin{cases} 0 &:\ x \lt 0\\ x &:\ 0 \le x \le 1\\ 1 &:\ x \gt 1 \end{cases} }[/math]

Suppose instead that [math]\displaystyle{ X }[/math] takes only the discrete values 0 and 1, with equal probability.

Then the CDF of [math]\displaystyle{ X }[/math] is given by [math]\displaystyle{ F_X(x) = \begin{cases} 0 &:\ x \lt 0\\ 1/2 &:\ 0 \le x \lt 1\\ 1 &:\ x \ge 1 \end{cases} }[/math]

Suppose [math]\displaystyle{ X }[/math] is exponential distributed. Then the CDF of [math]\displaystyle{ X }[/math] is given by [math]\displaystyle{ F_X(x;\lambda) = \begin{cases} 1-e^{-\lambda x} & x \ge 0, \\ 0 & x \lt 0. \end{cases} }[/math]

Here λ > 0 is the parameter of the distribution, often called the rate parameter.

Suppose [math]\displaystyle{ X }[/math] is normal distributed. Then the CDF of [math]\displaystyle{ X }[/math] is given by [math]\displaystyle{ F(x;\mu,\sigma) = \frac{1}{\sigma\sqrt{2\pi}} \int_{-\infty}^x \exp \left( -\frac{(t - \mu)^2}{2\sigma^2} \right)\, dt. }[/math]

Here the parameter [math]\displaystyle{ \mu }[/math] is the mean or expectation of the distribution; and [math]\displaystyle{ \sigma }[/math] is its standard deviation.

Suppose [math]\displaystyle{ X }[/math] is binomial distributed. Then the CDF of [math]\displaystyle{ X }[/math] is given by [math]\displaystyle{ F(k;n,p) = \Pr(X\leq k) = \sum _{i=0}^{\lfloor k\rfloor }{n \choose i} p^{i} (1-p)^{n-i} }[/math]

Here [math]\displaystyle{ p }[/math] is the probability of success and the function denotes the discrete probability distribution of the number of successes in a sequence of [math]\displaystyle{ n }[/math] independent experiments, and [math]\displaystyle{ \lfloor k\rfloor }[/math] is the "floor" under [math]\displaystyle{ k }[/math], i.e. the greatest integer less than or equal to [math]\displaystyle{ k }[/math].

Derived functions

Complementary cumulative distribution function (tail distribution)

Sometimes, it is useful to study the opposite question and ask how often the random variable is above a particular level. This is called the complementary cumulative distribution function (ccdf) or simply the tail distribution or exceedance, and is defined as [math]\displaystyle{ \bar F_X(x) = \operatorname{P}(X \gt x) = 1 - F_X(x). }[/math]

This has applications in statistical hypothesis testing, for example, because the one-sided p-value is the probability of observing a test statistic at least as extreme as the one observed. Thus, provided that the test statistic, T, has a continuous distribution, the one-sided p-value is simply given by the ccdf: for an observed value [math]\displaystyle{ t }[/math] of the test statistic [math]\displaystyle{ p= \operatorname{P}(T \ge t) = \operatorname{P}(T \gt t) = 1 - F_T(t). }[/math]

In survival analysis, [math]\displaystyle{ \bar F_X(x) }[/math] is called the survival function and denoted [math]\displaystyle{ S(x) }[/math], while the term reliability function is common in engineering.


One of the most popular application of cumulative distribution function is standard normal table, also called the unit normal table or Z table,[5] is the value of cumulative distribution function of the normal distribution. It is very useful to use Z-table not only for probabilities below a value which is the original application of cumulative distribution function, but also above and/or between values on standard normal distribution, and it was further extended to any normal distribution.

  • For a non-negative continuous random variable having an expectation, Markov's inequality states that[6] [math]\displaystyle{ \bar F_X(x) \leq \frac{\operatorname{E}(X)}{x} . }[/math]
  • As [math]\displaystyle{ x \to \infty, \bar F_X(x) \to 0 }[/math], and in fact [math]\displaystyle{ \bar F_X(x) = o(1/x) }[/math] provided that [math]\displaystyle{ \operatorname{E}(X) }[/math] is finite.
    Assuming [math]\displaystyle{ X }[/math] has a density function [math]\displaystyle{ f_X }[/math], for any [math]\displaystyle{ c \gt 0 }[/math] [math]\displaystyle{ \operatorname{E}(X) = \int_0^\infty x f_X(x) \, dx \geq \int_0^c x f_X(x) \, dx + c\int_c^\infty f_X(x) \, dx }[/math] Then, on recognizing [math]\displaystyle{ \bar F_X(c) = \int_c^\infty f_X(x) \, dx }[/math] and rearranging terms, [math]\displaystyle{ 0 \leq c\bar F_X(c) \leq \operatorname{E}(X) - \int_0^c x f_X(x) \, dx \to 0 \text{ as } c \to \infty }[/math] as claimed.
  • For a random variable having an expectation, [math]\displaystyle{ \operatorname{E}(X) = \int_0^\infty \bar F_X(x) \, dx - \int_{-\infty}^0 F_X(x) \, dx }[/math] and for a non-negative random variable the second term is 0.
    If the random variable can only take non-negative integer values, this is equivalent to [math]\displaystyle{ \operatorname{E}(X) = \sum_{n=0}^\infty \bar F_X(n). }[/math]

Folded cumulative distribution

Example of the folded cumulative distribution for a normal distribution function with an expected value of 0 and a standard deviation of 1.

While the plot of a cumulative distribution often has an S-like shape, an alternative illustration is the folded cumulative distribution or mountain plot, which folds the top half of the graph over,[7][8] thus using two scales, one for the upslope and another for the downslope. This form of illustration emphasises the median, dispersion (specifically, the mean absolute deviation from the median[9]) and skewness of the distribution or of the empirical results.

Inverse distribution function (quantile function)

Main page: Quantile function

If the CDF F is strictly increasing and continuous then [math]\displaystyle{ F^{-1}( p ), p \in [0,1], }[/math] is the unique real number [math]\displaystyle{ x }[/math] such that [math]\displaystyle{ F(x) = p }[/math]. In such a case, this defines the inverse distribution function or quantile function.

Some distributions do not have a unique inverse (for example in the case where [math]\displaystyle{ f_X(x)=0 }[/math] for all [math]\displaystyle{ a\lt x\lt b }[/math], causing [math]\displaystyle{ F_X }[/math] to be constant). This problem can be solved by defining, for [math]\displaystyle{ p \in [0,1] }[/math], the generalized inverse distribution function:

[math]\displaystyle{ F^{-1}(p) = \inf \{x \in \mathbb{R}: F(x) \geq p \}. }[/math]
  • Example 1: The median is [math]\displaystyle{ F^{-1}( 0.5 ) }[/math].
  • Example 2: Put [math]\displaystyle{ \tau = F^{-1}( 0.95 ) }[/math]. Then we call [math]\displaystyle{ \tau }[/math] the 95th percentile.

Some useful properties of the inverse cdf (which are also preserved in the definition of the generalized inverse distribution function) are:

  1. [math]\displaystyle{ F^{-1} }[/math] is nondecreasing
  2. [math]\displaystyle{ F^{-1}(F(x)) \leq x }[/math]
  3. [math]\displaystyle{ F(F^{-1}(p)) \geq p }[/math]
  4. [math]\displaystyle{ F^{-1}(p) \leq x }[/math] if and only if [math]\displaystyle{ p \leq F(x) }[/math]
  5. If [math]\displaystyle{ Y }[/math] has a [math]\displaystyle{ U[0, 1] }[/math] distribution then [math]\displaystyle{ F^{-1}(Y) }[/math] is distributed as [math]\displaystyle{ F }[/math]. This is used in random number generation using the inverse transform sampling-method.
  6. If [math]\displaystyle{ \{X_\alpha\} }[/math] is a collection of independent [math]\displaystyle{ F }[/math]-distributed random variables defined on the same sample space, then there exist random variables [math]\displaystyle{ Y_\alpha }[/math] such that [math]\displaystyle{ Y_\alpha }[/math] is distributed as [math]\displaystyle{ U[0,1] }[/math] and [math]\displaystyle{ F^{-1}(Y_\alpha) = X_\alpha }[/math] with probability 1 for all [math]\displaystyle{ \alpha }[/math].

The inverse of the cdf can be used to translate results obtained for the uniform distribution to other distributions.

Empirical distribution function

The empirical distribution function is an estimate of the cumulative distribution function that generated the points in the sample. It converges with probability 1 to that underlying distribution. A number of results exist to quantify the rate of convergence of the empirical distribution function to the underlying cumulative distribution function.

Multivariate case

Definition for two random variables

When dealing simultaneously with more than one random variable the joint cumulative distribution function can also be defined. For example, for a pair of random variables [math]\displaystyle{ X,Y }[/math], the joint CDF [math]\displaystyle{ F_{XY} }[/math] is given by[3]:p. 89

[math]\displaystyle{ F_{X,Y}(x,y) = \operatorname{P}(X\leq x,Y\leq y) }[/math]






where the right-hand side represents the probability that the random variable [math]\displaystyle{ X }[/math] takes on a value less than or equal to [math]\displaystyle{ x }[/math] and that [math]\displaystyle{ Y }[/math] takes on a value less than or equal to [math]\displaystyle{ y }[/math].

Example of joint cumulative distribution function:

For two continuous variables X and Y: [math]\displaystyle{ \Pr(a \lt X \lt b \text{ and } c \lt Y \lt d) = \int_a^b \int_c^d f(x,y) \, dy \, dx; }[/math]

For two discrete random variables, it is beneficial to generate a table of probabilities and address the cumulative probability for each potential range of X and Y, and here is the example:[10]

given the joint probability mass function in tabular form, determine the joint cumulative distribution function.

Y = 2 Y = 4 Y = 6 Y = 8
X = 1 0 0.1 0 0.1
X = 3 0 0 0.2 0
X = 5 0.3 0 0 0.15
X = 7 0 0 0.15 0

Solution: using the given table of probabilities for each potential range of X and Y, the joint cumulative distribution function may be constructed in tabular form:

Y < 2 2 ≤ Y < 4 4 ≤ Y < 6 6 ≤ Y < 8 Y ≥ 8
X < 1 0 0 0 0 0
1 ≤ X < 3 0 0 0.1 0.1 0.2
3 ≤ X < 5 0 0 0.1 0.3 0.4
5 ≤ X < 7 0 0.3 0.4 0.6 0.85
X ≥ 7 0 0.3 0.4 0.75 1

Definition for more than two random variables

For [math]\displaystyle{ N }[/math] random variables [math]\displaystyle{ X_1,\ldots,X_N }[/math], the joint CDF [math]\displaystyle{ F_{X_1,\ldots,X_N} }[/math] is given by

[math]\displaystyle{ F_{X_1,\ldots,X_N}(x_1,\ldots,x_N) = \operatorname{P}(X_1 \leq x_1,\ldots,X_N \leq x_N) }[/math]






Interpreting the [math]\displaystyle{ N }[/math] random variables as a random vector [math]\displaystyle{ \mathbf{X} = (X_1, \ldots, X_N)^T }[/math] yields a shorter notation: [math]\displaystyle{ F_{\mathbf{X}}(\mathbf{x}) = \operatorname{P}(X_1 \leq x_1,\ldots,X_N \leq x_N) }[/math]


Every multivariate CDF is:

  1. Monotonically non-decreasing for each of its variables,
  2. Right-continuous in each of its variables,
  3. [math]\displaystyle{ 0\leq F_{X_1 \ldots X_n}(x_1,\ldots,x_n)\leq 1, }[/math]
  4. [math]\displaystyle{ \lim_{x_1,\ldots,x_n \rightarrow+\infty}F_{X_1 \ldots X_n}(x_1,\ldots,x_n)=1 \text{ and } \lim_{x_i\rightarrow-\infty}F_{X_1 \ldots X_n}(x_1,\ldots,x_n)=0, \text{for all } i. }[/math]

Any function satisfying the above four properties is not a multivariate CDF, unlike in the single dimension case. For example, let [math]\displaystyle{ F(x,y)=0 }[/math] for [math]\displaystyle{ x\lt 0 }[/math] or [math]\displaystyle{ x+y\lt 1 }[/math] or [math]\displaystyle{ y\lt 0 }[/math] and let [math]\displaystyle{ F(x,y)=1 }[/math] otherwise. It is easy to see that the above conditions are met, and yet [math]\displaystyle{ F }[/math] is not a CDF since if it was, then [math]\displaystyle{ \operatorname{P}\left(\frac{1}{3} \lt X \leq 1, \frac{1}{3} \lt Y \leq 1\right)=-1 }[/math] as explained below.

The probability that a point belongs to a hyperrectangle is analogous to the 1-dimensional case:[11] [math]\displaystyle{ F_{X_1,X_2}(a, c) + F_{X_1,X_2}(b, d) - F_{X_1,X_2}(a, d) - F_{X_1,X_2}(b, c) = \operatorname{P}(a \lt X_1 \leq b, c \lt X_2 \leq d) = \int ... }[/math]

Complex case

Complex random variable

The generalization of the cumulative distribution function from real to complex random variables is not obvious because expressions of the form [math]\displaystyle{ P(Z \leq 1+2i) }[/math] make no sense. However expressions of the form [math]\displaystyle{ P(\Re{(Z)} \leq 1, \Im{(Z)} \leq 3) }[/math] make sense. Therefore, we define the cumulative distribution of a complex random variables via the joint distribution of their real and imaginary parts: [math]\displaystyle{ F_Z(z) = F_{\Re{(Z)},\Im{(Z)}}(\Re{(z)},\Im{(z)}) = P(\Re{(Z)} \leq \Re{(z)} , \Im{(Z)} \leq \Im{(z)}). }[/math]

Complex random vector

Generalization of Eq.4 yields [math]\displaystyle{ F_{\mathbf{Z}}(\mathbf{z}) = F_{\Re{(Z_1)},\Im{(Z_1)}, \ldots, \Re{(Z_n)},\Im{(Z_n)}}(\Re{(z_1)}, \Im{(z_1)},\ldots,\Re{(z_n)}, \Im{(z_n)}) = \operatorname{P}(\Re{(Z_1)} \leq \Re{(z_1)},\Im{(Z_1)} \leq \Im{(z_1)},\ldots,\Re{(Z_n)} \leq \Re{(z_n)},\Im{(Z_n)} \leq \Im{(z_n)}) }[/math] as definition for the CDS of a complex random vector [math]\displaystyle{ \mathbf{Z} = (Z_1,\ldots,Z_N)^T }[/math].

Use in statistical analysis

The concept of the cumulative distribution function makes an explicit appearance in statistical analysis in two (similar) ways. Cumulative frequency analysis is the analysis of the frequency of occurrence of values of a phenomenon less than a reference value. The empirical distribution function is a formal direct estimate of the cumulative distribution function for which simple statistical properties can be derived and which can form the basis of various statistical hypothesis tests. Such tests can assess whether there is evidence against a sample of data having arisen from a given distribution, or evidence against two samples of data having arisen from the same (unknown) population distribution.

Kolmogorov–Smirnov and Kuiper's tests

The Kolmogorov–Smirnov test is based on cumulative distribution functions and can be used to test to see whether two empirical distributions are different or whether an empirical distribution is different from an ideal distribution. The closely related Kuiper's test is useful if the domain of the distribution is cyclic as in day of the week. For instance Kuiper's test might be used to see if the number of tornadoes varies during the year or if sales of a product vary by day of the week or day of the month.

See also


  1. Deisenroth, Marc Peter; Faisal, A. Aldo; Ong, Cheng Soon (2020). Mathematics for Machine Learning. Cambridge University Press. pp. 181. ISBN 9781108455145. 
  2. Hüseyin Çakallı (2015). "Upward and Downward Statistical Continuities". Filomat 29 (10): 2265–2273. doi:10.2298/FIL1510265C. 
  3. 3.0 3.1 3.2 3.3 3.4 3.5 Park, Kun Il (2018). Fundamentals of Probability and Stochastic Processes with Applications to Communications. Springer. ISBN 978-3-319-68074-3. 
  4. Montgomery, Douglas C.; Runger, George C. (2003). Applied Statistics and Probability for Engineers. John Wiley & Sons, Inc.. p. 104. ISBN 0-471-20454-4. 
  5. "Z Table" (in en-US). 
  6. Zwillinger, Daniel; Kokoska, Stephen (2010). CRC Standard Probability and Statistics Tables and Formulae. CRC Press. p. 49. ISBN 978-1-58488-059-2. 
  7. Gentle, J.E. (2009). Computational Statistics. Springer. ISBN 978-0-387-98145-1. Retrieved 2010-08-06. 
  8. Monti, K. L. (1995). "Folded Empirical Distribution Function Curves (Mountain Plots)". The American Statistician 49 (4): 342–345. doi:10.2307/2684570. 
  9. Xue, J. H.; Titterington, D. M. (2011). "The p-folded cumulative distribution function and the mean absolute deviation from the p-quantile". Statistics & Probability Letters 81 (8): 1179–1182. doi:10.1016/j.spl.2011.03.014. 
  10. "Joint Cumulative Distribution Function (CDF)". 
  11. "Archived copy". 

External links