Tutorials › Exam P - Probability › Testing Independence by Density Factorization

Exam P · Conditional Distributions and Independence · Tutorial 745 of 915

Testing Independence by Density Factorization

Derive marginal densities, apply the density-factorization test across the joint support, and recognize when a mismatch rules out independence.

Intermediate 10 min read

What You'll Learn

  • Obtain marginal densities by integrating a joint density over the other variable.
  • Test independence by comparing the joint density with the product of the marginals.
  • Check the comparison throughout the relevant support, not just at a convenient point.
  • Distinguish a genuine density mismatch from a marginal-integration error.
  • Use factorization to calculate probabilities of joint events when independence holds.

Why Density Factorization Tests Independence

For continuous random variables, independence is not established by comparing a few probabilities or by observing that a joint density has a simple formula. The practical test is to derive both marginal densities and compare their product with the joint density throughout the joint support. If the two expressions disagree on a region of positive area, the variables are dependent.

The calculation depends on integrating over the correct ranges. A mistaken marginal bound can make a dependent model appear to factor, so support conditions must be carried into each integral. The test is aligned with the SOA Exam P (Probability) syllabus.

Definition: Suppose \(X\) and \(Y\) have a joint probability density function \(f_{X,Y}(x,y)\). Their marginal densities are $$ f_X(x)=\int_{-\infty}^{\infty} f_{X,Y}(x,y)\,dy, \qquad f_Y(y)=\int_{-\infty}^{\infty} f_{X,Y}(x,y)\,dx. $$ The variables \(X\) and \(Y\) are independent if and only if $$ f_{X,Y}(x,y)=f_X(x)f_Y(y) $$ for almost every \((x,y)\). In practice, derive the marginals and compare the two sides throughout the stated joint support. A mismatch on a region of positive area establishes dependence.

“Almost every” allows densities to differ at isolated points or on other sets of area zero without changing any probabilities. Therefore, an inequality at just one point is not enough in general. In the examples below, either the expressions agree throughout the interior of the support or their continuous formulas differ in a neighborhood, which gives a valid conclusion.

A Systematic Factorization Test

Write the joint density together with its support before integrating. For each marginal, integrate the joint density over the other variable using bounds that follow from that support. Then multiply the two marginal formulas and compare with the joint density over the support. The key question is not whether the joint formula looks separable at a glance; it is whether the actual joint density equals the product of the actual marginals.

1
Record the joint model.
State \(f_{X,Y}(x,y)\) and the region where it is positive. Confirm that the density integrates to 1.
2
Find both marginals.
Integrate with respect to the other variable, using the support to set the bounds.
3
Compare across the support.
Calculate \(f_X(x)f_Y(y)\) and test whether it equals \(f_{X,Y}(x,y)\) throughout the relevant region, apart from possible area-zero exceptions.
4
State the conclusion.
Equality almost everywhere gives independence; a mismatch on a region of positive area gives dependence.

Worked Examples

Worked Example: A Density That Factors into Independent Marginals

A hypothetical model has joint density \(f_{X,Y}(x,y)=\frac{4}{9}(1+x)(1+y)\) for \(0<x<1\) and \(0<y<1\), and density 0 elsewhere. Test whether \(X\) and \(Y\) are independent. No interest or mortality assumption is involved; the model is specified directly by its joint density.

Method: derive each marginal, then compare their product with the joint density. First check normalization. Since \(\int_0^1(1+x)\,dx=1+\frac12=\frac32\), the integral of the joint density is \(\frac49\cdot\frac32\cdot\frac32=1\).

For \(0<x<1\), integrate over the full allowed range \(0<y<1\):

$$ f_X(x)=\int_0^1 \frac49(1+x)(1+y)\,dy =\frac49(1+x)\left(\frac32\right) =\frac23(1+x). $$

For \(0<y<1\), integrating over \(0<x<1\) gives \(f_Y(y)=\frac23(1+y)\). Both marginals are zero outside their stated intervals. Their product on the joint support is

$$ f_X(x)f_Y(y) =\frac23(1+x)\cdot\frac23(1+y) =\frac49(1+x)(1+y) =f_{X,Y}(x,y). $$

The equality holds throughout the interior of the support, so \(X\) and \(Y\) are independent. The marginal densities also each integrate to \(\frac23\cdot\frac32=1\), as required. The common mistake avoided here is to assume independence merely because the joint formula is a product of an \(x\)-expression and a \(y\)-expression; independence is confirmed by checking that the factors agree with the derived marginals.

Worked Example: A Triangular Density That Does Not Factor

A second hypothetical model has joint density \(f_{X,Y}(x,y)=2\) when \(0<y<x<1\), and 0 elsewhere. Test independence. There are no interest or mortality assumptions; the distribution is the stated continuous joint model.

The triangular support has area \(\frac12\), so the density integrates to \(2\cdot\frac12=1\). For a fixed \(x\) between 0 and 1, \(y\) ranges from 0 to \(x\). Thus

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

For a fixed \(y\) between 0 and 1, the support condition \(y<x<1\) means \(x\) ranges from \(y\) to 1. Therefore

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

At the interior point \(x=\frac12,\ y=\frac14\), the joint density is 2, whereas the product of the marginals is

$$ f_X\left(\frac12\right)f_Y\left(\frac14\right) =\left(2\cdot\frac12\right)\left(2\left(1-\frac14\right)\right) =1\cdot\frac32 =\frac32. $$

The values differ by \(\frac12\). Both density formulas are continuous near this interior point, so the difference persists in a neighborhood, not merely at an isolated point. The factorization criterion therefore fails and \(X\) and \(Y\) are dependent. The mistake this calculation avoids is treating a constant joint density as evidence of independence; the marginal densities still vary with their arguments and must be checked.

Worked Example: Factorization and a Joint-Event Probability

Suppose a hypothetical model has joint density \(f_{X,Y}(x,y)=\frac16e^{-x/3-y/2}\) for \(x>0,\ y>0\), and 0 otherwise. Test independence, then find \(P(X>6,\ Y<1)\). There are no interest or mortality assumptions. The marginal distributions will be exponential, with rates specified by their densities.

Method: integrate to obtain the marginals, verify factorization, then use independence. The joint density is normalized because \(\int_0^\infty e^{-x/3}\,dx=3\) and \(\int_0^\infty e^{-y/2}\,dy=2\), giving \(\frac16\cdot3\cdot2=1\).

For \(x>0\) and \(y>0\), integration gives

$$ \begin{aligned} f_X(x)&=\int_0^\infty \frac16e^{-x/3-y/2}\,dy =\frac16e^{-x/3}\cdot2 =\frac13e^{-x/3},\\ f_Y(y)&=\int_0^\infty \frac16e^{-x/3-y/2}\,dx =\frac16e^{-y/2}\cdot3 =\frac12e^{-y/2}. \end{aligned} $$

Their product is \(\frac13e^{-x/3}\cdot\frac12e^{-y/2}=\frac16e^{-x/3-y/2}\), exactly the joint density. Hence \(X\) and \(Y\) are independent. The marginals are exponential with rates \(1/3\) and \(1/2\), respectively. Using the exponential tail and cumulative probabilities,

$$ \begin{aligned} P(X>6,\ Y<1) &=P(X>6)P(Y<1)\\ &=e^{-6/3}\left(1-e^{-1/2}\right)\\ &=e^{-2}\left(1-e^{-1/2}\right) \approx 0.0533. \end{aligned} $$

The probability is rounded to 4 decimals. As a check, the two factors are approximately \(0.1353\) and \(0.3935\); their product is approximately \(0.0533\). The common mistake avoided is multiplying the marginal event probabilities before verifying independence.

Why the Product Formula Works

The factorization criterion connects a density calculation to the definition of independence in terms of probabilities. If the joint density equals the product of the marginal densities, then for intervals \(A\) and \(B\), integrating over the rectangle \(A\times B\) separates into two one-dimensional integrals:

$$ \begin{aligned} P(X\in A,\ Y\in B) &=\int_A\int_B f_{X,Y}(x,y)\,dy\,dx\\ &=\int_A\int_B f_X(x)f_Y(y)\,dy\,dx\\ &=\left(\int_A f_X(x)\,dx\right) \left(\int_B f_Y(y)\,dy\right)\\ &=P(X\in A)P(Y\in B). \end{aligned} $$

The separation is valid because the integrand is a product of a function of \(x\) and a function of \(y\), and the region of integration is the rectangle \(A\times B\). Conversely, independence makes probabilities over such rectangles products of marginal probabilities; the corresponding joint density is then the product of the marginal densities almost everywhere. This justifies using density factorization as the test.

Common Mistakes and Exam Checks

  • Using incorrect marginal bounds. In a nonrectangular support, the permitted range for one variable may depend on the fixed value of the other. Derive each range from the stated inequalities before integrating.
  • Checking only a convenient point. Equality at one point does not prove factorization. Compare the formulas throughout the support. A difference that persists over a region of positive area is enough to disprove independence.
  • Confusing a separable-looking formula with independence. Even if a joint formula can be written as a product of an \(x\)-term and a \(y\)-term, the constants and integrals must yield the actual marginal densities.
  • Ignoring normalization. A proposed joint density must integrate to 1, and each marginal density must also integrate to 1. These checks often reveal a missing constant or an incorrect bound.

The density-factorization test is useful because it gives a direct analytic check for independence and, when it succeeds, supports multiplying probabilities of separate events. In exam problems, the decisive work is often not the final comparison but setting the marginal integration limits correctly and making the comparison over the whole relevant region.

Key takeaway: For continuous variables, derive \(f_X\) and \(f_Y\) from the joint model, then compare \(f_{X,Y}\) with \(f_Xf_Y\) throughout the joint support. Correct bounds and a full-support comparison are essential.

Check Your Understanding

For each model, derive the relevant marginals before deciding whether the variables are independent.

  1. A joint density is \(f_{X,Y}(x,y)=\frac23(1+x)\) for \(0<x<1,\ 0<y<1\), and 0 elsewhere. Is the model normalized, and are \(X\) and \(Y\) independent? (Answer: It is normalized; \(f_X(x)=\frac23(1+x)\), \(f_Y(y)=1\), and \(X,Y\) are independent.)
  2. A joint density is \(f_{X,Y}(x,y)=2\) for \(0<y<x<1\), and 0 elsewhere. Find both marginal densities and test independence. (Answer: \(f_X(x)=2x\), \(f_Y(y)=2(1-y)\) on \((0,1)\); dependent.)
  3. A joint density is \(c(2-x)(1+2y)\) for \(0<x<2,\ 0<y<1\), and 0 elsewhere. Find \(c\) and test independence. (Answer: \(c=\frac14\); \(f_X(x)=\frac{2-x}{2}\), \(f_Y(y)=\frac{1+2y}{2}\); independent.)
  4. A joint density is \(f_{X,Y}(x,y)=\frac16e^{-x/3-y/2}\) for \(x>0,\ y>0\), and 0 elsewhere. Find \(P(X>3,\ Y<2)\). (Answer: \(e^{-1}(1-e^{-1})\approx 0.2325\).)
  5. A density is constant at 2 on \(0<y<x<1\). At \(x=0.6,\ y=0.2\), compare the joint density with the product of its marginal densities. Does this point support independence? (Answer: \(f_{X,Y}=2\), while \(f_Xf_Y=(1.2)(1.6)=1.92\); the mismatch, which persists on a neighborhood, shows dependence.)
Clinical Biostats