Tutorials › Multivariate Statistics (Graduate) › Marginal Laws by Integration

Multivariate Laws and Transformations · Tutorial 50 of 975

Marginal Laws by Integration

Learn to obtain marginal densities from joint densities, handle support-dependent limits, and check the resulting densities integrate to one.

Beginner 9 min read

What You'll Learn

  • Write a marginal density by integrating a joint density over the coordinates being removed.
  • Choose integration limits from the support’s slice at each retained coordinate value.
  • Express irregular-support calculations using indicator functions or slice-specific limits.
  • Verify a marginal density is normalized using Tonelli’s theorem.
  • Calculate both marginals in triangular and unbounded examples.

From a Joint Density to a Marginal Density

A joint density describes the distribution of several random variables together. Often, however, a question concerns just one component: for example, the distribution of a patient’s measurement without regard to another recorded measurement. The relevant distribution is the marginal law. When a joint density exists, its marginal density is obtained by integrating out the coordinates that are not of interest.

The main practical difficulty is usually not the integration itself. It is choosing the correct limits. For a fixed value of the coordinate being retained, the other coordinate may only range over a slice of the joint support. If that slice changes with the retained value, the integration limits must change with it.

Definition: Let \(X\) take values in \(\mathbb{R}^p\) and \(Y\) in \(\mathbb{R}^q\). Suppose \((X,Y)\) has a joint density \(f_{X,Y}(x,y)\) with respect to Lebesgue measure on \(\mathbb{R}^{p+q}\). A marginal density of \(X\) is $$ f_X(x)=\int_{\mathbb{R}^q} f_{X,Y}(x,y)\,dy, $$ for almost every \(x\). The density of \(Y\) is obtained by integrating over \(x\): $$ f_Y(y)=\int_{\mathbb{R}^p} f_{X,Y}(x,y)\,dx. $$

The integral over all of \(\mathbb{R}^q\) is always a valid way to state the formula. In a calculation, it is more convenient to restrict the integral to the part of the support that remains possible when \(X=x\). Define the slice \(S_x=\{y:(x,y)\in S\}\), where \(S\) is a set outside which the joint density is zero. Then \(f_X(x)=\int_{S_x}f_{X,Y}(x,y)\,dy\). The slice may be empty, in which case the integral is zero. For two scalar variables, these slices often give ordinary one-dimensional limits.

Why the Integral Gives the Marginal Law

The defining property of a density is that probabilities are obtained by integrating it over sets. The marginal density formula follows by applying that property to events involving \(X\) alone.

Theorem: If \(f_{X,Y}\) is a nonnegative measurable joint density that integrates to one, then \(x\mapsto\int_{\mathbb{R}^q} f_{X,Y}(x,y)\,dy\) is a density of \(X\), up to changes on a set of Lebesgue measure zero.

Proof. Define \(h(x)=\int_{\mathbb{R}^q}f_{X,Y}(x,y)\,dy\). Tonelli’s theorem applies because the integrand is nonnegative and measurable; it ensures that \(h\) is measurable and permits the iterated integrals below. For any measurable set \(A\subseteq\mathbb{R}^p\),

$$ \begin{aligned} P(X\in A) &=\int_{\mathbb{R}^p}\int_{\mathbb{R}^q} \mathbf{1}_A(x)f_{X,Y}(x,y)\,dy\,dx\\ &=\int_A h(x)\,dx. \end{aligned} $$

Thus \(h\) gives the probabilities of all measurable events involving \(X\), as a density must. In particular, taking \(A=\mathbb{R}^p\) shows that \(\int h(x)\,dx=1\). The formula identifies a density only almost everywhere: changing its value on a set of Lebesgue measure zero does not change any probability. \(\square\)

Normalization check: Integrating out some coordinates and then integrating over the retained coordinates gives the total integral of the joint density: $$ \int_{\mathbb{R}^p} f_X(x)\,dx =\int_{\mathbb{R}^p}\int_{\mathbb{R}^q} f_{X,Y}(x,y)\,dy\,dx =1. $$ This follows from Tonelli’s theorem and the fact that the joint density integrates to one.

This normalization identity is both a theorem and a useful calculation check. If a proposed marginal integrates to something other than one, either the joint density was not normalized or an integration limit, algebraic step, or support restriction has been mishandled.

Worked Examples: Limits Determined by the Support

Worked Example: A Uniform Density on a Triangle

Suppose the joint density is \(f_{X,Y}(x,y)=2\) when \(0<x<y<1\), and is zero elsewhere. Find both marginal densities and check their integrals.

First, the support has area \(\int_0^1\int_0^y dx\,dy=1/2\), so the constant density \(2\) gives total probability \(2(1/2)=1\). For a fixed \(x\), the support condition requires \(x<y<1\), so

$$ f_X(x)= \begin{cases} \int_x^1 2\,dy=2(1-x), & 0<x<1,\\ 0, & \text{otherwise}. \end{cases} $$

For a fixed \(y\), the allowed values are \(0<x<y\), giving

$$ f_Y(y)= \begin{cases} \int_0^y 2\,dx=2y, & 0<y<1,\\ 0, & \text{otherwise}. \end{cases} $$

The normalization checks are \(\int_0^1 2(1-x)\,dx=2[x-x^2/2]_0^1=1\) and \(\int_0^1 2y\,dy=[y^2]_0^1=1\).

Worked Example: A Nonconstant Density on a Triangle

On \(0<x<1\), \(0<y<1-x\), let \(f_{X,Y}(x,y)=6x\), and let it be zero elsewhere. Find the two marginals. The triangular support narrows as \(x\) increases, so its slice limits depend on the coordinate held fixed.

Check the joint normalization first: \(\int_0^1\int_0^{1-x}6x\,dy\,dx =\int_0^1 6x(1-x)\,dx =6(1/2-1/3)=1\). For fixed \(x\), \(y\) ranges from \(0\) to \(1-x\), so

$$ f_X(x)= \begin{cases} \int_0^{1-x}6x\,dy=6x(1-x), & 0<x<1,\\ 0, & \text{otherwise}. \end{cases} $$

For fixed \(y\), the condition \(y<1-x\) implies \(0<x<1-y\), while \(0<y<1\). Therefore

$$ f_Y(y)= \begin{cases} \int_0^{1-y}6x\,dx=3(1-y)^2, & 0<y<1,\\ 0, & \text{otherwise}. \end{cases} $$

Check both: \(\int_0^1 6x(1-x)\,dx=6(1/2-1/3)=1\), and \(\int_0^1 3(1-y)^2\,dy=3(1/3)=1\).

Worked Example: An Unbounded Wedge

Let \(f_{X,Y}(x,y)=e^{-x}\) on \(0<y<x<\infty\), and zero elsewhere. Find each marginal. Although the support is unbounded, the relevant slice limits still follow directly from its inequalities.

For fixed \(x>0\), \(y\) ranges from \(0\) to \(x\). Hence \(f_X(x)=\int_0^x e^{-x}\,dy=xe^{-x}\) for \(x>0\), and \(f_X(x)=0\) otherwise. Its integral is \(\int_0^\infty xe^{-x}\,dx=1\): integration by parts gives \([-xe^{-x}]_0^\infty+\int_0^\infty e^{-x}\,dx=0+1\).

For fixed \(y>0\), the constraint \(y<x\) means \(x\) ranges from \(y\) to infinity. Thus \(f_Y(y)=\int_y^\infty e^{-x}\,dx=e^{-y}\) for \(y>0\), and \(f_Y(y)=0\) otherwise. Its integral is \(\int_0^\infty e^{-y}\,dy=[-e^{-y}]_0^\infty=1\). The two marginal densities differ, as expected: the support treats \(X\) and \(Y\) differently.

Using Support Slices Reliably

A reliable calculation starts with the joint support, not with guessed limits. To find \(f_X(x)\), hold \(x\) fixed and determine every \(y\) allowed by the support. To find \(f_Y(y)\), hold \(y\) fixed and solve the support inequalities for \(x\). If a slice has multiple disjoint pieces, integrate over each piece and add the results. For vector coordinates, the same rule applies, with integration over the full allowed slice.

Equivalently, one may extend the joint density by zero outside its support and integrate over the entire coordinate space. This avoids writing slice limits explicitly, but it does not remove the need to understand the support: the zero values outside it are what make the integral correct.

1
Identify the retained coordinate.
For a marginal of \(X\), treat \(x\) as fixed and integrate over all coordinates of \(Y\).
2
Find the slice of the support.
Apply the support inequalities with the retained coordinate fixed; use the resulting interval, region, or union of regions as the integration domain.
3
Integrate and check.
Evaluate the integral on the slice, state where the result is nonzero, and integrate the marginal over its full range to verify that it equals one.

Common Mistake: Using the Wrong Slice

A frequent error is to use the same limits for every value of the retained coordinate, as if the joint support were a rectangle. In the first example, integrating \(f_{X,Y}(x,y)=2\) over \(0<y<1\) for every \(x\) would give \(f_X(x)=2\) on \(0<x<1\). That is wrong: for a fixed \(x\), the support requires \(y>x\), so the correct limits are \(x<y<1\), giving \(2(1-x)\). The incorrect expression integrates to \(2\), not \(1\), exposing the mistake.

Another way to prevent this error is to sketch the support and draw a slice at a fixed coordinate. Endpoints of the slice often make the correct integral bounds immediately visible. Boundaries are usually immaterial for a density with respect to Lebesgue measure, but the interior of the support determines the integral.

Key takeaway: A marginal density is the joint density integrated over the coordinates being removed. Its limits must describe the support slice at the retained coordinate value, and its integral must equal one.

Check Your Understanding

For each question, use the support to justify the limits before evaluating any integral.

  1. If a joint density is supported on \(0<y<x<2\), what are the \(y\)-limits when finding \(f_X(x)\)? For which \(x\) can the marginal be nonzero?
  2. For the same support, what are the \(x\)-limits when finding \(f_Y(y)\)?
  3. Why is integrating over the full real line valid even when the support is bounded or irregular?
  4. State the role of Tonelli’s theorem in deriving and normalizing a marginal density.
  5. A proposed marginal density integrates to \(0.8\). Give two possible explanations for this result.
Clinical Biostats