Tutorials › Statistical Theory I - Probability and Distribution Theory › Marginal Densities by Integration

Joint Distribution Representations · Tutorial 207 of 994

Marginal Densities by Integration

Use the support of a joint density to set integration limits correctly and derive marginal densities, even when those limits depend on the coordinate being retained.

Intermediate 10 min read

What You'll Learn

  • Define marginal densities from a joint density for an absolutely continuous pair.
  • Set integration limits by finding the feasible cross-section of the support.
  • Derive marginals when support bounds depend on the retained coordinate.
  • Verify marginal calculations by checking that each density integrates to one.
  • Recognize why density formulas are determined only up to sets of measure zero.

Why Marginal Densities Require Careful Limits

A joint density describes how probability is distributed across pairs of values. A marginal density answers a simpler question: how is probability distributed across the values of just one coordinate, without regard to the other? The calculation is an integration, but its limits are determined by the joint support. If the support has sloping boundaries, the feasible values of the variable being integrated out may depend on the value being retained.

The central task is therefore geometric as well as analytic: fix one coordinate, identify the resulting cross-section of the support, and integrate the joint density across that cross-section. Integrating over an incorrect range can produce a function that looks plausible but does not describe the marginal law.

Definition and General Formula

Definition: Suppose \((X,Y)\) has a joint density \(f_{X,Y}(x,y)\) with respect to two-dimensional Lebesgue measure. Its marginal densities are $$ f_X(x)=\int_{-\infty}^{\infty} f_{X,Y}(x,y)\,dy \quad\text{and}\quad f_Y(y)=\int_{-\infty}^{\infty} f_{X,Y}(x,y)\,dx, $$ where each equality specifies a density version valid almost everywhere. The integral for \(f_X\) sums over all feasible values of \(y\) at the fixed value \(x\); the integral for \(f_Y\) sums over all feasible values of \(x\) at the fixed value \(y\).

A joint density is nonnegative and integrates to one. It is often specified only on a support \(D\), with density zero outside \(D\). In that case, the integrals over the whole real line can be shortened to the feasible section of \(D\). For example, if \(D=\{(x,y):a<x<b,\ l(x)<y<u(x)\}\), then \(f_X(x)=\int_{l(x)}^{u(x)}f_{X,Y}(x,y)\,dy\) for \(a<x<b\), and \(f_X(x)=0\) outside that range, up to the choice of values on boundary points. The functions \(l\) and \(u\) need not be constant: that is precisely why the limits can depend on \(x\).

Why the Integration Formula Works

The marginal density formula follows by computing the probability that \(X\) lies in a set, while allowing \(Y\) to take any value. Nonnegativity is important: it permits the order of integration to be changed even when an integral might initially be infinite.

Theorem: Let \((X,Y)\) have a nonnegative, measurable joint density \(f_{X,Y}\) on \(\mathbb{R}^2\), with integral one. Then $$ g_X(x)=\int_{\mathbb{R}}f_{X,Y}(x,y)\,dy $$ is measurable, integrates to one, and is a density of \(X\). Likewise, \(g_Y(y)=\int_{\mathbb{R}}f_{X,Y}(x,y)\,dx\) is a density of \(Y\). These formulas are understood up to sets of one-dimensional Lebesgue measure zero.

Proof. For each \(x\), define \(g_X(x)\) by the nonnegative integral, allowing the value \(+\infty\) initially. Tonelli’s theorem implies that \(g_X\) is measurable and that for every Borel set \(A\subseteq\mathbb{R}\),

$$ \begin{aligned} P(X\in A) &=\int_{\mathbb{R}^2}\mathbf{1}_{A}(x)f_{X,Y}(x,y)\,dx\,dy\\ &=\int_A\left(\int_{\mathbb{R}}f_{X,Y}(x,y)\,dy\right)dx\\ &=\int_A g_X(x)\,dx. \end{aligned} $$

Thus \(g_X\) is a density of \(X\). Taking \(A=\mathbb{R}\) gives \(\int_{\mathbb{R}}g_X(x)\,dx=P(X\in\mathbb{R})=1\). In particular, \(g_X\) can be infinite only on a set of measure zero, so it has a finite version almost everywhere. Interchanging the roles of \(x\) and \(y\) proves the claims for \(g_Y\). Since a density is defined by its integrals over measurable sets, changing its values on a measure-zero set does not change the distribution. \(\square\)

Corollary: For every real \(t\), the marginal distribution function of \(X\) is $$ F_X(t)=P(X\le t)=\int_{-\infty}^{t}f_X(x)\,dx. $$ Indeed, apply the theorem with \(A=(-\infty,t]\); the same argument gives \(F_Y(t)=\int_{-\infty}^{t}f_Y(y)\,dy\).

A Reliable Way to Find the Limits

For \(f_X\), hold \(x\) fixed and ask which \(y\)-values put \((x,y)\) inside the support. For \(f_Y\), hold \(y\) fixed and ask which \(x\)-values are feasible. The two answers need not have the same form. A useful calculation sequence is:

1
Write down the support.
Record the inequalities defining where the joint density is nonzero.
2
Fix the coordinate to retain.
For \(f_X\), treat \(x\) as fixed; for \(f_Y\), treat \(y\) as fixed.
3
Solve for the feasible range of the other coordinate.
Use all support inequalities, including any that make the limits depend on the fixed coordinate.
4
Integrate and check.
Integrate the joint density over that range, then verify that the marginal is nonnegative and integrates to one.

Worked Examples

Worked Example: A Uniform Density on a Triangle

Suppose the joint density is \(f_{X,Y}(x,y)=2\) on \(0<x<y<1\), and zero elsewhere. First check normalization: for each \(x\in(0,1)\), the feasible values of \(y\) range from \(x\) to \(1\), so

$$ \int_0^1\int_x^1 2\,dy\,dx =\int_0^1 2(1-x)\,dx =2\left(1-\frac12\right)=1. $$

To find \(f_X\), fix \(x\). The support requires \(x<y<1\), so

$$ f_X(x)=\int_x^1 2\,dy=2(1-x),\qquad 0<x<1. $$

It is zero outside \((0,1)\). As a check, \(\int_0^1 2(1-x)\,dx=1\). To find \(f_Y\), instead fix \(y\). The same support now gives \(0<x<y\), hence \(f_Y(y)=\int_0^y 2\,dx=2y\) for \(0<y<1\), and zero otherwise. This also integrates to one: \(\int_0^1 2y\,dy=1\). The lower limit for the first marginal and the upper limit for the second both come from the same sloping boundary \(x<y\).

Worked Example: An Unbounded Support with a Moving Limit

Let \(f_{X,Y}(x,y)=e^{-x}\) when \(x>0\) and \(0<y<x\), and let it be zero elsewhere. The support is unbounded, but each fixed \(x\) has a finite interval of feasible \(y\)-values. Check that the proposed joint density is normalized:

$$ \int_0^\infty\int_0^x e^{-x}\,dy\,dx =\int_0^\infty x e^{-x}\,dx =1. $$

For the last equality, integration by parts gives \(\int_0^\infty xe^{-x}dx=[-xe^{-x}]_0^\infty+\int_0^\infty e^{-x}dx=0+1=1\). Fixing \(x>0\), integrate over \(0<y<x\):

$$ f_X(x)=\int_0^x e^{-x}\,dy=xe^{-x},\qquad x>0. $$

This integrates to one by the calculation above. For \(f_Y\), fix \(y>0\). The inequality \(0<y<x\) means \(x>y\), so

$$ f_Y(y)=\int_y^\infty e^{-x}\,dx=e^{-y},\qquad y>0. $$

It is zero for \(y\le 0\), and \(\int_0^\infty e^{-y}dy=1\). Notice the change in the integration range: a fixed \(x\) gives a bounded interval for \(y\), while a fixed \(y\) gives an unbounded interval for \(x\).

Worked Example: A Slanted Boundary in Both Marginals

Let \(f_{X,Y}(x,y)=1\) on the region \(0<x<2\), \(x/2<y<1\), and zero elsewhere. For each \(x\), the height of the region is \(1-x/2\), so its area is

$$ \int_0^2\left(1-\frac{x}{2}\right)dx =\left[x-\frac{x^2}{4}\right]_0^2=1. $$

Thus the joint density is normalized. At fixed \(x\), integrate from \(y=x/2\) to \(y=1\):

$$ f_X(x)=\int_{x/2}^1 1\,dy=1-\frac{x}{2},\qquad 0<x<2. $$

At fixed \(y\), the inequalities \(0<x<2\) and \(x/2<y<1\) imply \(0<y<1\) and \(0<x<2y\). Therefore

$$ f_Y(y)=\int_0^{2y}1\,dx=2y,\qquad 0<y<1. $$

Both marginals are zero outside their stated intervals. Their integrals are \(\int_0^2(1-x/2)dx=1\) and \(\int_0^1 2y\,dy=1\). The upper limit \(2y\) in the second calculation is obtained by solving the support inequality \(x/2<y\) for \(x\); it is not the upper limit \(2\) of the original \(x\)-range for every \(y\).

Common Mistakes and Checks

  • Using the same bounds for both marginals. The support must be re-examined after fixing the coordinate to retain. In the last example, the \(y\)-range at fixed \(x\) is \(x/2<y<1\), but the \(x\)-range at fixed \(y\) is \(0<x<2y\).
  • Integrating over the whole real line without respecting zero density. An integral over all real values is correct only if the density is treated as zero outside the support. Writing just the feasible limits usually makes the calculation clearer.
  • Assuming a correct-looking formula is a density. Check nonnegativity and total integral. A marginal obtained from a valid joint density must integrate to one; failure usually signals an incorrect limit or an integration error.
  • Expecting a unique value at every point. Marginal densities are determined only almost everywhere. Changing a density at an endpoint, or at any other measure-zero set, does not change probabilities.

These calculations apply to an absolutely continuous joint law with a density over area. The defining formula does not account for probability concentrated on points or curves, since such probability is not represented by an ordinary two-dimensional density.

Key takeaway: A marginal density is obtained by integrating the joint density across the feasible cross-section of its support. Fix the coordinate being retained, solve the support inequalities for the coordinate being removed, and then verify the resulting marginal integrates to one.

Check Your Understanding

For each question, identify the feasible range before doing any integration.

  1. If a joint density is supported on \(0<x<y<3\), what are the integration limits for \(f_X(x)\) and for \(f_Y(y)\)?
  2. A density is supported on \(x>0\) and \(0<y<2x\). For a fixed \(y>0\), what range of \(x\) is feasible?
  3. Why does integrating a marginal density to one provide a useful check, but not by itself guarantee that the integration limits were correct?
  4. Explain why two marginal density formulas that differ only at a single endpoint can describe the same distribution.
  5. For the joint density in the first worked example, verify the marginal CDF at \(0<t<1\) by integrating the displayed \(f_X(x)\) from \(0\) to \(t\).