Tutorials › Statistical Theory I - Probability and Distribution Theory › Conditional CDFs and Interval Probabilities

Conditional Distribution Theory · Tutorial 252 of 994

Conditional CDFs and Interval Probabilities

Learn to turn a joint density into a conditional CDF, use it for interval probabilities, and recover the conditional density where differentiation applies.

Intermediate 11 min read

What You'll Learn

  • Construct a conditional CDF by integrating a joint density over a slice.
  • Identify the marginal density needed to normalize the slice.
  • Compute conditional probabilities for intervals from CDF differences.
  • Recover a conditional density by differentiating the conditional CDF almost everywhere.
  • Recognize why slice formulas are defined only up to exceptional conditioning values.
  • Check conditional distribution calculations for normalization and endpoint errors.

From a Joint Density to a Conditional CDF

A joint density describes the probability of ranges of values for two random variables together. To find the conditional distribution of \(X\) at a given value \(y\) of \(Y\), focus on the horizontal slice of that joint density at \(Y=y\). Integrating along this slice up to \(x\) accumulates the conditional probability that \(X\) is no greater than \(x\). The slice must be normalized by the marginal density of \(Y\) at \(y\).

This construction is the CDF counterpart of the conditional-density formula: integrate the conditional density from the lower end of the real line to \(x\). The resulting function is useful both for describing the full conditional distribution and for calculating probabilities over intervals.

Definition: Let \((X,Y)\) have a joint density \(f_{X,Y}(x,y)\), and define the marginal density of \(Y\) by \(f_Y(y)=\int_{-\infty}^{\infty} f_{X,Y}(u,y)\,du\), using this integral as the chosen version of the marginal density. For almost every \(y\) with \(0<f_Y(y)<\infty\), the conditional CDF of \(X\) given \(Y=y\) is
$$ F_{X\mid Y}(x\mid y) = \frac{\displaystyle\int_{-\infty}^{x} f_{X,Y}(u,y)\,du} {f_Y(y)}, \qquad x\in\mathbb{R}. $$

The qualifier “almost every” matters. A density is defined only up to changes on sets of Lebesgue measure zero, and conditioning on a particular value of a continuous random variable does not, in general, determine a unique conditional law at every single \(y\). The slice formula gives a version of the conditional distribution for almost every \(y\) where the marginal density is positive and finite. In examples with a natural, explicitly defined density, the formula will usually be used throughout the indicated range of \(y\).

For any fixed \(y\) where the formula applies, its numerator integrates the joint density only over points with second coordinate \(y\), from \(u=-\infty\) through \(u=x\). Dividing by \(f_Y(y)\) turns that accumulated slice into a conditional probability. In particular, integrating the whole slice gives \(f_Y(y)\), so the conditional CDF tends to 1 as \(x\) increases without bound.

Conditional Interval Probabilities

A CDF gives interval probabilities by taking differences. For real numbers \(a<b\),

$$ P(a<X\le b\mid Y=y) = F_{X\mid Y}(b\mid y)-F_{X\mid Y}(a\mid y) = \frac{\displaystyle\int_a^b f_{X,Y}(u,y)\,du}{f_Y(y)}. $$

The second equality follows by subtracting the two integrals defining the CDF; the part from \(-\infty\) to \(a\) cancels. Because the conditional law obtained from a density has no point masses for almost every such \(y\), changing either interval endpoint from open to closed does not change its probability for those \(y\). Stating the interval as \((a,b]\) is convenient because it matches the standard CDF difference exactly.

Theorem: For a joint density \(f_{X,Y}\), let \(f_Y(y)=\int_{\mathbb{R}}f_{X,Y}(u,y)\,du\). For almost every \(y\) with \(0<f_Y(y)<\infty\), the slice formula defines a conditional distribution of \(X\) given \(Y=y\). Its conditional interval probabilities are the normalized integrals of the joint density over the corresponding part of the slice.

Proof. Since the joint density is nonnegative and integrates to 1, Tonelli’s theorem gives \(\int_{\mathbb{R}} f_Y(y)\,dy=1\). Thus \(f_Y(y)\) is finite for almost every \(y\). For a \(y\) with \(0<f_Y(y)<\infty\), set \(q_y(C)=\int_C f_{X,Y}(u,y)\,du/f_Y(y)\) for each Borel set \(C\subseteq\mathbb{R}\), whenever the slice integral is defined. The integral over the entire real line is \(f_Y(y)\), so \(q_y(\mathbb{R})=1\); nonnegativity and countable additivity follow from those properties of the integral. Hence \(q_y\) is a probability distribution.

To check that this distribution is conditional, let \(A\) be a Borel set of possible values for \(Y\), and let \(C\) be a Borel set of possible values for \(X\). Fubini’s theorem applies to the nonnegative joint density and gives

$$ \int_A q_y(C)f_Y(y)\,dy = \int_A\int_C f_{X,Y}(u,y)\,du\,dy = P(X\in C,\;Y\in A). $$

This identity is the defining conditional-distribution identity. It holds for all Borel \(C\) and \(A\) after choosing the conditional distribution version outside a single null set of \(y\)'s; this follows first for a countable generating class of intervals and then for Borel sets by the standard uniqueness and extension argument for probability measures. Taking \(C=(-\infty,x]\) gives the stated CDF formula. Taking \(C=(a,b]\) gives the interval formula. \(\square\)

Worked Calculations

Worked Example: A Uniform Density on a Triangle

Suppose \((X,Y)\) has joint density \(f_{X,Y}(x,y)=2\) when \(0<y<x<1\), and 0 otherwise. Find the conditional CDF of \(X\) given \(Y=y\), and calculate \(P(1/2<X\le 3/4\mid Y=1/4)\).

First integrate across the slice to find the marginal density of \(Y\). For \(0<y<1\), the possible \(x\)-values run from \(y\) to 1, so

$$ f_Y(y)=\int_y^1 2\,dx=2(1-y). $$

For this range of \(y\), the CDF is zero when \(x\le y\), since the slice has no density to the left of \(y\). When \(y<x<1\), the accumulated slice integral is \(\int_y^x 2\,du=2(x-y)\). When \(x\ge 1\), the entire slice has been integrated. Therefore

$$ F_{X\mid Y}(x\mid y)= \begin{cases} 0, & x\le y,\\ \dfrac{x-y}{1-y}, & y<x<1,\\ 1, & x\ge 1, \end{cases} \qquad 0<y<1. $$

At \(y=1/4\), the interval endpoints lie in the middle case. The requested probability is

$$ F_{X\mid Y}(3/4\mid 1/4)-F_{X\mid Y}(1/2\mid 1/4) = \frac{3/4-1/4}{1-1/4} - \frac{1/2-1/4}{1-1/4} = \frac{2}{3}-\frac{1}{3} = \frac{1}{3}. $$

As a check, the conditional density on \(y<x<1\) is \(2/[2(1-y)]=1/(1-y)\), whose integral from \(y\) to 1 is 1.

Worked Example: Conditional Intervals in an Exponential Model

Let \(Y\) be uniform on \([1,2]\), and, given \(Y=y\), let \(X\) have an exponential distribution with rate \(y\). Equivalently, the joint density is \(f_{X,Y}(x,y)=y e^{-yx}\) for \(x\ge 0\) and \(1\le y\le 2\), and 0 elsewhere. Find the conditional CDF and calculate \(P(1<X\le 2\mid Y=3/2)\).

The marginal density is

$$ f_Y(y)=\int_0^\infty y e^{-yx}\,dx = \left[-e^{-yx}\right]_{0}^{\infty} =1, \qquad 1\le y\le 2, $$

since \(y>0\). Thus the conditional CDF for \(x\ge 0\) is

$$ F_{X\mid Y}(x\mid y) = \int_0^x y e^{-yu}\,du = 1-e^{-yx}. $$

For \(x<0\), it is 0. Substituting \(y=3/2\) into the interval difference gives

$$ P(1<X\le 2\mid Y=3/2) = \left(1-e^{-3}\right)-\left(1-e^{-3/2}\right) = e^{-3/2}-e^{-3}. $$

Numerically, this is approximately \(0.2231-0.0498=0.1733\). The density check is immediate: differentiating \(1-e^{-yx}\) with respect to \(x\) gives \(y e^{-yx}\), the conditional density on \(x\ge 0\).

Recovering the Conditional Density

The slice formula also explains how a conditional density can be recovered from its CDF. For a fixed admissible \(y\), the conditional CDF is an integral of the slice density divided by the marginal density. The fundamental theorem of calculus for Lebesgue integrals says that the derivative of an indefinite integral of an integrable function equals that function almost everywhere. Consequently, the conditional density is the normalized slice density almost everywhere in \(x\).

Theorem: Suppose \(0<f_Y(y)<\infty\) and \(u\mapsto f_{X,Y}(u,y)\) is integrable. Then \(x\mapsto F_{X\mid Y}(x\mid y)\) is absolutely continuous, and
$$ f_{X\mid Y}(x\mid y) = \frac{f_{X,Y}(x,y)}{f_Y(y)} \quad\text{for almost every }x. $$

Proof. For any \(r<s\), the CDF formula gives

$$ F_{X\mid Y}(s\mid y)-F_{X\mid Y}(r\mid y) = \int_r^s \frac{f_{X,Y}(u,y)}{f_Y(y)}\,du. $$

The integrand is nonnegative and integrable over \(\mathbb{R}\), with integral 1. An indefinite integral of an integrable function is absolutely continuous, and its derivative equals its integrand at almost every point. Applying this fundamental theorem of calculus yields the asserted conditional density. \(\square\)

Worked Example: Differentiating a Conditional CDF

Consider the joint density \(f_{X,Y}(x,y)=\frac{4}{5}(1+xy)\) on \(0<x<1,\ 0<y<1\), and 0 elsewhere. Find the conditional CDF, recover the conditional density, and calculate \(P(1/4<X\le 3/4\mid Y=1/2)\).

For \(0<y<1\), the marginal density is

$$ f_Y(y) = \int_0^1 \frac{4}{5}(1+uy)\,du = \frac{4}{5}\left(1+\frac{y}{2}\right). $$

For \(0<x<1\), divide the accumulated slice by this marginal:

$$ F_{X\mid Y}(x\mid y) = \frac{\int_0^x \frac{4}{5}(1+uy)\,du} {\frac{4}{5}(1+y/2)} = \frac{x+yx^2/2}{1+y/2}. $$

The CDF is 0 for \(x\le 0\) and 1 for \(x\ge 1\). Differentiating the middle expression with respect to \(x\) gives the conditional density

$$ f_{X\mid Y}(x\mid y) = \frac{1+xy}{1+y/2}, \qquad 0<x<1. $$

At \(y=1/2\), the numerator of the CDF at \(x=3/4\) is \(3/4+(1/2)(9/16)/2=57/64\), and at \(x=1/4\) it is \(1/4+(1/2)(1/16)/2=17/64\). The common denominator is \(1+1/4=5/4\). Hence

$$ P(1/4<X\le 3/4\mid Y=1/2) = \frac{57/64-17/64}{5/4} = \frac{40}{64}\cdot\frac{4}{5} = \frac{1}{2}. $$

As a normalization check, integrating the conditional density over \((0,1)\) gives \(\bigl(1+y/2\bigr)/\bigl(1+y/2\bigr)=1\).

Common Mistake: Forgetting to Normalize the Slice

A frequent error is to integrate the joint density along a slice and call the result a conditional CDF without dividing by the marginal density. In the triangular example, the unnormalized accumulation for \(y<x<1\) is \(2(x-y)\). At \(x=1\), this equals \(2(1-y)\), not 1; it is the marginal density \(f_Y(y)\), not a conditional probability. Dividing by \(2(1-y)\) produces \((x-y)/(1-y)\), which reaches 1 at the right endpoint, as a CDF must.

A second check is to distinguish an interval probability from a density value. The CDF difference \(F_{X\mid Y}(b\mid y)-F_{X\mid Y}(a\mid y)\) is a probability. A conditional density is instead the derivative of the CDF where that derivative exists; it is not itself the probability of an interval.

Key takeaway: For almost every conditioning value with a positive finite marginal density, integrate the joint density over the relevant slice and divide by that marginal. CDF differences give conditional interval probabilities, and differentiation recovers the conditional density almost everywhere.

Check Your Understanding

Use the slice formula and check both the marginal normalization and the conditional probability calculation.

  1. In the triangular-density example, what is \(P(X>1/2\mid Y=1/4)\)?
  2. Why must the slice integral be divided by \(f_Y(y)\) before it can be a conditional CDF?
  3. For the exponential model, write \(P(a<X\le b\mid Y=y)\) for \(0\le a<b\).
  4. In the square-support example, differentiate the conditional CDF with respect to \(x\) and verify that the result integrates to 1.
  5. Why is the slice formula asserted only for almost every conditioning value in general?