Search for probability and statistics terms on Statlect

Conditional probability density function

by , PhD

The probability distribution of a continuous random variable can be characterized by its probability density function (pdf). When the probability distribution of the random variable is updated, by taking into account some information that gives rise to a conditional probability distribution, then such a distribution can be characterized by a conditional probability density function.

Table of Contents


The following is a formal definition.

Definition Let X and Y be two continuous random variables. The conditional probability density function of X given Y=y is a function [eq1] such that[eq2]for any interval [eq3].

In the definition above the quantity [eq4]is the conditional probability that X will belong to the interval $left[ a,b
ight] $, given that Y=y.

How to derive it

In order to derive the conditional pdf of a continuous random variable given the realization of another one, we need to know their joint probability density function (see this glossary entry to understand how joint pdfs work).

Suppose that we are told that two continuous random variables X and Y have joint probability density function [eq5].

Then, we are also told that the realization of Y has been observed and $Y=y $, where $y$ denotes the observed realization.

How do we compute the conditional probability density function of X so as to take the new information into account?

This is done in two steps:

  1. first, we compute the marginal density of Y by integrating the joint density:[eq6]

  2. then, we use the conditional density formula:[eq7]


Let's make an example.

Suppose that the joint probability density function of X and Y is[eq8]

The support of Y (i.e., the set of its possible realizations) is[eq9]

When [eq10], the marginal pdf of Y is[eq11]

When [eq12], the marginal pdf of Y is [eq13] because [eq14]and its integral is zero.

By putting the two pieces together, we obtain[eq15]

Thus, the conditional pdf of X given $Y=2$ is[eq16]

Note that we do not need to worry about division by zero (i.e., the case when [eq17]) because the realization of $y$ always belongs to the support of Y and, as a consequence, [eq18].

How it is used to build joint densities

We have just explained how to derive a conditional pdf from a joint pdf, but things can be done also the other way around: if we are given the marginal pdf [eq19] and the conditional [eq20], then the joint distribution can be derived by performing a simple multiplication:[eq21]

More details

More details about the conditional probability density function can be found in the lecture entitled Conditional probability distributions.

Keep reading the glossary

Previous entry: Binomial coefficient

Next entry: Conditional probability mass function

How to cite

Please cite as:

Taboga, Marco (2021). "Conditional probability density function", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix.

The books

Most of the learning materials found on this website are now available in a traditional textbook format.