From a Density to a Cumulative Distribution
A probability density describes how probability is distributed across the possible values of a continuous loss. It is often easier to use the cumulative distribution function (CDF) to answer a probability question, however. Recovering the CDF from a density means accumulating the density from the lowest possible loss up to the value of interest. The lower boundary matters: integrating only the most recent piece of a density can omit probability accumulated earlier.
The formulas below assume that \(X\) is a continuous severity with a density on its support and has no point probabilities. In particular, probabilities over intervals are given by integrating the density. For a valid density, the function must be nonnegative and its integral over the entire support must equal one.
The variable \(t\) in the integral is a dummy integration variable; it distinguishes the value being integrated from the endpoint \(x\). If the density is given only up to a multiplicative constant, determine that constant from the total-integral condition before treating the function as a probability density.
Why the Integral Gives the CDF
A density assigns probability to intervals through area: for \(r<s\) in the support, \(P(r<X\leq s)=\int_r^s f_X(t)\,dt\). To find \(P(X\leq x)\), partition the event into all values from the lower support boundary \(a\) through \(x\). Applying the interval-probability rule to that range gives the CDF formula.
This also explains a useful check. Where \(f_X\) is continuous, the Fundamental Theorem of Calculus gives \(F_X'(x)=f_X(x)\). Conversely, differentiating a proposed CDF on an interval should recover the density there. The derivative check is local; it does not by itself verify that the CDF has the correct accumulated probability at the start of that interval.
At the lower support boundary, \(F_X(a)=0\), and at the upper boundary, \(F_X(b)=1\). A continuous density gives a continuous CDF. For a piecewise density, calculate each new CDF piece by adding the integral over that piece to the probability already accumulated at its left endpoint.
Worked Examples
Worked Example: Normalizing and Integrating a Linear Density
A hypothetical individual claim severity has density \(f_X(x)=cx\) for \(0\leq x\leq2\), and density zero elsewhere. Find \(c\), write the CDF, and calculate \(P(0.5<X\leq1.5)\).
Method and normalization. A density must integrate to one over its full support:
Therefore \(c=\frac12\), so the density on the support is \(f_X(x)=x/2\). It is nonnegative on \([0,2]\) and its total integral is one.
Recover the CDF. For \(0\leq x\leq2\), integrate from the support boundary 0:
Including values outside the support, \(F_X(x)=0\) for \(x<0\), \(F_X(x)=x^2/4\) for \(0\leq x\leq2\), and \(F_X(x)=1\) for \(x>2\). At \(x=2\), the middle formula gives \(4/4=1\), as required.
Interval probability. Subtract the CDF values at the endpoints:
The answer is \(0.5000\) to four decimal places. As a check, direct integration gives \(\int_{0.5}^{1.5}t/2\,dt=1/2\). The method avoids treating the normalizing constant as the CDF or forgetting to normalize the density first.
Worked Example: Recovering a CDF from a Piecewise Density
A hypothetical claim severity has density \(f_X(x)=x/3\) for \(0\leq x\leq2\), \(f_X(x)=(6-2x)/3\) for \(2<x\leq3\), and zero elsewhere. Verify that it is a density, find its CDF, and calculate \(F_X(2.5)\).
Verify the total integral. On the first interval, \(\int_0^2 x/3\,dx=[x^2/6]_0^2=4/6=2/3\). On the second interval,
The total is \(2/3+1/3=1\), and both density pieces are nonnegative on their stated intervals. At \(x=2\), the left-hand density is \(2/3\), matching the value approached by the second piece.
First CDF piece. For \(0\leq x\leq2\),
At the join, \(F_X(2)=4/6=2/3\). This is the probability already accumulated before the second interval begins.
Second CDF piece. For \(2<x\leq3\), start with that accumulated probability and add the integral from 2 to \(x\):
Thus the full CDF is zero for \(x<0\), \(x^2/6\) for \(0\leq x\leq2\), the expression above for \(2<x\leq3\), and one for \(x>3\). At \(x=2\), the second expression would give \(2/3\) as well, so the pieces agree. At \(x=3\), it gives \(2/3+(18-9-8)/3=1\).
Finally,
to four decimal places. The accumulated \(2/3\) is essential: integrating only the second density piece gives the probability between 2 and 2.5, not the CDF at 2.5.
Worked Example: A Density on a Shifted Support
For a hypothetical severity, suppose \(f_X(x)=c(x-2)\) for \(2\leq x\leq5\), and zero elsewhere. Find \(c\), derive \(F_X(x)\), and calculate \(P(3<X\leq4)\).
Normalize. The support begins at 2, not at 0:
Hence \(c=2/9\), and the density is nonnegative on \([2,5]\). The integral is exactly one.
Integrate from the actual lower boundary. For \(2\leq x\leq5\),
Therefore \(F_X(x)=0\) for \(x<2\), \(F_X(x)=(x-2)^2/9\) for \(2\leq x\leq5\), and \(F_X(x)=1\) for \(x>5\). The boundary values are \(F_X(2)=0\) and \(F_X(5)=9/9=1\).
Calculate the interval probability.
The answer is \(0.3333\) to four decimal places. Direct integration over \([3,4]\) also gives \(\int_3^4 2(x-2)/9\,dx=1/3\). Using 0 as the integration boundary would incorrectly assign probability below the stated support.
Practical Checks and Common Traps
A reliable calculation keeps three distinct tasks separate: establish the support, normalize the density if needed, and integrate to the requested endpoint. A quick endpoint check can catch many algebra errors. The CDF must begin at zero at the lower support boundary, end at one at the upper boundary, and never decrease. On each smooth part of the support, its derivative should equal the stated density.
Write the interval where the density is nonzero and use its lower boundary as the starting point of the CDF integral.
Integrate every density piece over its own interval and add the results. If a constant is unknown, solve for it using a total of one.
At each join, carry forward the CDF value already reached, then add the integral of the next density piece.
Test the support boundaries and joins, confirm the CDF reaches one, and differentiate each formula to recover its density piece.
Common exam trap: resetting the CDF to zero at an internal join. In the piecewise example, the incorrect calculation \(F_X(x)=\int_2^x(6-2t)/3\,dt\) for \(2<x\leq3\) gives \(F_X(2)=0\) and \(F_X(2.5)=1/4\). That integral is only the probability accumulated between 2 and \(x\). The correction is \(F_X(x)=F_X(2)+\int_2^x(6-2t)/3\,dt\), where \(F_X(2)=2/3\); consequently \(F_X(2.5)=2/3+1/4=11/12\). The CDF must include all probability from the lower support boundary, not just the latest interval.
Another common error is to integrate from zero when the support starts elsewhere. The lower integration limit is the support boundary, not a default value. Also, a formula derived on the support should not be extended beyond it without checking: outside the support, the CDF is zero below the support and one above it.
Check Your Understanding
For each problem, normalize when needed, integrate from the correct support boundary, and check the stated CDF or probability against the density.
- A hypothetical severity has constant density \(c\) on \([3,7]\) and zero elsewhere. Find \(c\), \(F_X(5)\), and \(P(4<X\leq6)\). (Answer: \(c=1/4\), \(F_X(5)=0.5000\), and \(P(4<X\leq6)=0.5000\).)
- A density is \(f_X(x)=cx\) on \([0,2]\) and zero elsewhere. Find \(c\) and \(F_X(1.2)\). (Answer: \(c=1/2\) and \(F_X(1.2)=0.3600\).)
- A density is \(c x\) on \([0,1]\), \(c(2-x)\) on \((1,2]\), and zero elsewhere. Find \(c\) and \(F_X(1.5)\). (Answer: \(c=1\) and \(F_X(1.5)=0.8750\).)
- A density is \(c(x-2)\) on \([2,5]\) and zero elsewhere. Find \(c\) and \(P(3<X\leq4)\). (Answer: \(c=2/9\) and \(P(3<X\leq4)=0.3333\).)
- A density is \(x/3\) on \([0,2]\), \((6-2x)/3\) on \((2,3]\), and zero elsewhere. Find the probability accumulated by \(x=2\), then calculate \(F_X(2.5)\). (Answer: \(F_X(2)=2/3\) and \(F_X(2.5)=11/12=0.9167\).)