How to Find a Probability Density Function (PDF)
At a glance
- 1. Identify what is given
Use the distribution, cumulative distribution function, or transformation rule that describes the random variable.
- 2. Choose a method
Differentiate a CDF, use a known distribution, or apply the change-of-variables formula.
- 3. Determine the support
Find the values the random variable can take, and set the density to zero elsewhere.
- 4. Check the result
Verify the density is nonnegative and integrates to one over its support.
A probability density function (PDF) describes an absolutely continuous distribution of a random variable. The method for finding one depends on what information you have: a cumulative distribution function (CDF), a formula for the random variable, or a named distribution. Without some such information, there is no unique PDF to find.
What a probability density function tells you
For a random variable with a PDF , the density is nonnegative and gives probabilities by integration:
The total probability must be one:
A density value is not itself a probability. In particular, for a variable with a PDF, for any single value , even if is positive. Probabilities come from areas under the density curve.
Method 1: Differentiate the CDF
If you know the CDF and the distribution is absolutely continuous (so it has a PDF), then its PDF is the derivative of the CDF almost everywhere:
First identify the intervals on which the CDF changes, differentiate on those intervals, and set the density to zero outside the range of possible values. A CDF can have corners where its derivative is undefined; that does not prevent the random variable from having a density. For an absolutely continuous distribution, the derivative formula applies almost everywhere. But differentiating a CDF does not recover discrete or singular components of a distribution.
Worked example: the square of a uniform variable
Suppose is uniform on , and define . Since , the possible values of are also in .
For ,
Including the parts outside the support, the CDF is for , for , and for . Differentiate on the interior of the support:
The density becomes unbounded as approaches zero, but it is still valid: the singularity is integrable, and . The value assigned at a single endpoint does not change any probabilities.
Method 2: Transform a known density
If and is one-to-one and differentiable on the support of , use the change-of-variables formula. Write , then
for values of in the transformed support; set it to zero elsewhere. The absolute value accounts for whether the transformation increases or decreases.
If is not one-to-one, include every solution to that lies in the support of :
This formula assumes the relevant branches are differentiable and that the derivative is nonzero at the inverse points. When a transformation has endpoints or stationary points where this fails, derive the CDF directly or handle those points separately.
For the worked example, the inverse on is , and . Since on , the transformation formula gives the same density, for .
Method 3: Recognize a named distribution
Sometimes the PDF is already known once you identify the model and its parameters. For example, a normal random variable with mean and standard deviation has density
Check the parameter convention: some distributions are written using variance rather than standard deviation, or use a rate parameter where another source uses a scale parameter. If the random variable is a sum or another function of random variables, you may need a convolution, a transformation, or a CDF calculation rather than a standard named formula.
Common mistakes
- Treating a density value as a probability. To find an interval probability, integrate the density over that interval.
- Forgetting the support. A formula may only apply on a specific interval; the density is zero outside it unless the model says otherwise.
- Omitting the derivative factor. When transforming a variable, the inverse derivative (or its absolute value) is essential.
- Using only one inverse branch. For a many-to-one transformation such as when can be positive or negative, contributions from both roots must be included.
- Assuming every random variable has a PDF. Discrete variables have probability mass functions. Some distributions combine point masses with a continuous density, and singular continuous distributions also exist, so their entire probability cannot be represented by an ordinary PDF alone.
After finding a candidate PDF, check that it is nonnegative on its support and that its integral over the full support is one. If either check fails, revisit the differentiation, transformation, or support.
References
- A First Course in Probability — Sheldon Ross
- Statistical Inference — George Casella and Roger L. Berger
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.