Skip to content

Cumulative distribution function

Read cumulative probabilities, recover point masses from jumps, handle strict and inclusive endpoints, and distinguish model CDFs, empirical CDFs and quantiles.

A cumulative distribution function (CDF) gives the probability that a random variable is at or below a chosen threshold. For a random variable XX,
FX(x)=P(X≤x),x∈R.F_X(x)=\mathbb{P}(X\le x),\qquad x\in\mathbb{R}.

The capital XX is the uncertain quantity; the lowercase xx is the threshold you choose. If XX is tomorrow's P&L in dollars, FX(−100)F_X(-100) answers “What is the probability of finishing at or below a loss of USD 100?” The CDF works for discrete outcomes, continuous models and mixtures of both. It describes the whole distribution, rather than just an average or a volatility.

When break-even changes the answer

Suppose a small position has this synthetic one-period P&L model, after all costs included in the example:
P&L XX (USD)ProbabilityCumulative probability at that outcome
−30-300.10.10.10.1
000.60.60.70.7
+20+200.30.31.01.0
Its probability mass function lists the individual outcome probabilities. The CDF accumulates them:
FX(x)={0,x<−30,0.1,−30≤x<0,0.7,0≤x<20,1,x≥20.F_X(x)= \begin{cases} 0, & x<-30,\\ 0.1, & -30\le x<0,\\ 0.7, & 0\le x<20,\\ 1, & x\ge20. \end{cases}

The CDF is defined even at thresholds that are impossible P&L outcomes. At USD −15 it equals 0.10.1: the USD −30 loss is below that threshold, and no other outcome is.

Synthetic P&L CDF with jumps at minus 30, zero and plus 20 USD. At zero the filled point is 0.7 and the open left-limit point is 0.1; the jump of 0.6 is the break-even probability.
Synthetic P&L CDF with jumps at minus 30, zero and plus 20 USD. At zero the filled point is 0.7 and the open left-limit point is 0.1; the jump of 0.6 is the break-even probability.
Original synthetic one-period USD P&L model. Filled points include the mass at the threshold; open points show excluded endpoint values. Dashed vertical lines guide the eye across jumps.
This makes “loss” and “no profit” different events. The probability of a loss, P(X<0)\mathbb{P}(X<0), is 0.10.1. The probability of no profit, P(X≤0)\mathbb{P}(X\le0), is 0.70.7. Quoting FX(0)F_X(0) as the loss probability would count every break-even outcome as a loss.

Read endpoints before subtracting

For any real-valued random variable and a<ba<b,

P(a<X≤b)=FX(b)−FX(a).\mathbb{P}(a<X\le b)=F_X(b)-F_X(a).
Subtracting FX(a)F_X(a) removes everything at or below aa, including mass at the lower endpoint. In the example,
P(−30<X≤0)=0.7−0.1=0.6.\mathbb{P}(-30<X\le0)=0.7-0.1=0.6.

Including the lower endpoint instead gives P(−30≤X≤0)=0.7\mathbb{P}(-30\le X\le0)=0.7. That difference is the USD −30 outcome's probability.

To handle all endpoint choices, write the left limit as FX(x−)=P(X<x)F_X(x^-)=\mathbb{P}(X<x). Then

P(X=x)=FX(x)−FX(x−),P(X>x)=1−FX(x),P(X≥x)=1−FX(x−).\begin{aligned} \mathbb{P}(X=x)&=F_X(x)-F_X(x^-),\\ \mathbb{P}(X>x)&=1-F_X(x),\\ \mathbb{P}(X\ge x)&=1-F_X(x^-). \end{aligned}

At zero, the jump 0.7−0.1=0.60.7-0.1=0.6 recovers the break-even mass. The complementary events give a 0.30.3 chance of positive P&L and a 0.90.9 chance of nonnegative P&L. These distinctions matter whenever a distribution puts probability on a threshold, including a default indicator or an option payoff with a mass at zero.

What makes a valid CDF?

A CDF stays between zero and one, never decreases as the threshold increases, tends to zero at the far left and one at the far right, and is right-continuous. At a jump, its value is the upper filled point: approaching the threshold from larger values returns that same value. These are properties of every CDF, not a choice made when drawing a staircase.
A CDF need not be smooth. A finite discrete model produces steps. If XX has a probability density function, then
FX(x)=∫−∞xfX(t) dt.F_X(x)=\int_{-\infty}^{x} f_X(t)\,dt.
Its CDF has no jumps, so strict versus inclusive endpoints make no probability difference. For an absolutely continuous law, differentiating the CDF recovers a density almost everywhere. The slope represents density; the height remains a cumulative probability. For example, a uniform P&L model on USD −10 to USD +10 has FX(0)=0.5F_X(0)=0.5 and a 0.50.5 chance of landing between USD −5 and USD +5. Its CDF has corners at the support boundaries. More generally, a continuous CDF alone does not guarantee the existence of a density.

Reverse the question: probability to threshold

A CDF takes a threshold and returns a probability. A quantile reverses that direction. For 0<p<10<p<1, the lower generalized quantile is
QX(p)=inf⁡{x∈R:FX(x)≥p}.Q_X(p)=\inf\{x\in\mathbb{R}:F_X(x)\ge p\}.

In the P&L model, QX(0.5)=0Q_X(0.5)=0 and QX(0.7)=0Q_X(0.7)=0, while QX(0.8)=20Q_X(0.8)=20. There is no threshold with cumulative probability exactly 0.50.5 or 0.80.8: the staircase jumps over those levels. Thus FX(QX(p))F_X(Q_X(p)) need not equal pp. Searching for an ordinary inverse would fail here; searching for the first threshold that reaches the target works.

For value at risk, first specify whether the variable is loss or P&L and which quantile convention is being used. Reversing the sign changes the relevant tail, and atoms make endpoint conventions visible.

A model CDF and an empirical CDF answer different questions

For observations x1,…,xnx_1,\ldots,x_n, the empirical distribution has CDF

F^n(x)=1n∑i=1n1{xi≤x}.\widehat F_n(x)=\frac{1}{n}\sum_{i=1}^{n}\mathbf{1}_{\{x_i\le x\}}.

It is the fraction of observed values at or below the threshold. It always forms a staircase, even when observations come from a continuous population; repeated observations make larger jumps.

Consider a separate illustrative sample of ten periods: two P&Ls of USD −30, five of USD 0 and three of USD +20. Its empirical CDF at USD −15 is 2/10=0.22/10=0.2, versus 0.10.1 in the model above. Both CDFs equal 0.70.7 at zero, so agreement at one threshold does not establish agreement throughout the distribution.

The empirical CDF summarizes that sample. Using it to estimate future probabilities requires assumptions about whether those periods represent the future environment. Zero observed losses beyond the sample's worst outcome does not establish zero future tail risk. Also specify the software's sample-quantile method: interpolated sample quantiles can differ from the generalized inverse of the empirical CDF.

For a fuller treatment of masses, densities and the CDF method for transforming variables, continue with Random Variables and Distributions (public preview; full lesson requires membership).

Sources

Last updated
  • probability
  • cdf
  • quantiles
  • empirical distribution
  • tail probability
← Back to the glossaryBack to top ↑