Skip to content

Joint Distributions and Independence

Attempt these from memory before reading.

  • Define the joint CDF of (X,Y)(X, Y).
  • Does knowing the marginal distributions of XX and YY determine the joint distribution of (X,Y)(X, Y)?
  • Define covariance. What does Cov⁡(X,Y)=0\operatorname{Cov}(X, Y) = 0 tell you?
  • Define independence of two random variables.
  • Is the sum of two independent normal random variables always normal?

Motivation: marginals do not determine the joint

Section titled “Motivation: marginals do not determine the joint”

The single most important fact on this page is that the marginal distributions of XX and YY do not determine the joint distribution. Knowing everything about XX and everything about YY tells you nothing about how they move together.

That is not a technicality; it is the entire subject of dependence. The joint distribution is extra information, and covariance and correlation are attempts to summarise one aspect of it.

Worked example (the canonical counterexample). Let XX be standard normal and let Y=XY = X with probability 12\frac12 and Y=−XY = -X with probability 12\frac12, independently of XX‘s value. Then YY is also standard normal, so XX and YY have identical marginals. But (X,Y)(X, Y) and (X,−X)(X, -X) are completely different joint distributions: one is concentrated on the diagonal, the other on the anti-diagonal.

The marginals are the same. The dependence is opposite. Anything you want to know about how XX and YY relate requires the joint distribution, and no marginal summary can substitute.

That is the reason correlation is not causation, and it is the reason two portfolios with identical marginal return distributions can have completely different risk.

Definition. The joint CDF of (X,Y)(X, Y) is FX,Y(x,y)=P(X≤x,Y≤y)F_{X,Y}(x, y) = P(X \leq x, Y \leq y).

Definition. The joint PDF (for continuous random variables) is fX,Y(x,y)≥0f_{X,Y}(x, y) \geq 0 such that

FX,Y(x,y)=∫−∞x∫−∞yfX,Y(u,v) du dvF_{X,Y}(x, y) = \int_{-\infty}^{x}\int_{-\infty}^{y} f_{X,Y}(u, v)\, du\, dv

Definition. The marginal PDF of XX is fX(x)=∫−∞∞fX,Y(x,y) dyf_X(x) = \int_{-\infty}^{\infty} f_{X,Y}(x, y)\, dy.

Definition. The covariance of XX and YY is

Cov(X,Y)=E[(X−E[X])(Y−E[Y])]=E[XY]−E[X]E[Y]\mathrm{Cov}(X, Y) = E[(X - E[X])(Y - E[Y])] = E[XY] - E[X]E[Y]

Proposition 2.6. Cov(X,Y)=Cov(Y,X)\mathrm{Cov}(X, Y) = \mathrm{Cov}(Y, X) and Cov(aX+b,cY+d)=ac Cov(X,Y)\mathrm{Cov}(aX + b, cY + d) = ac\,\mathrm{Cov}(X, Y).

Definition. The correlation coefficient is

ρ(X,Y)=Cov(X,Y)Var(X) Var(Y)\rho(X, Y) = \frac{\mathrm{Cov}(X, Y)}{\sqrt{\mathrm{Var}(X)\,\mathrm{Var}(Y)}}

Theorem 2.7 (Cauchy—Schwarz for Random Variables). ∣ρ(X,Y)∣≤1|\rho(X, Y)| \leq 1, with equality if and only if Y=aX+bY = aX + b almost surely for some a,ba, b.

Definition. XX and YY are independent if FX,Y(x,y)=FX(x) FY(y)F_{X,Y}(x, y) = F_X(x)\, F_Y(y) for all x,yx, y.

For continuous random variables, this is equivalent to fX,Y(x,y)=fX(x) fY(y)f_{X,Y}(x, y) = f_X(x)\, f_Y(y).

Proposition 2.8. If XX and YY are independent, then Cov(X,Y)=0\mathrm{Cov}(X, Y) = 0. The converse is false.

Worked Example: Uncorrelated but Dependent

Solution. Let X∼N(0,1)X \sim N(0, 1) and Y=X2Y = X^2. Then Cov(X,Y)=E[X3]−E[X]E[X2]=0−0⋅1=0\mathrm{Cov}(X, Y) = E[X^3] - E[X]E[X^2] = 0 - 0 \cdot 1 = 0 (since the third moment of a standard normal is 0).

But YY is completely determined by XX, so they are not independent. ■\blacksquare

Definition. The conditional PDF of YY given X=xX = x is:

fY∣X(y∣x)=fX,Y(x,y)fX(x)f_{Y|X}(y|x) = \frac{f_{X,Y}(x, y)}{f_X(x)}

provided fX(x)>0f_X(x) > 0.

Definition. The conditional expectation of YY given X=xX = x is:

E[Y∣X=x]=∫−∞∞y fY∣X(y∣x) dyE[Y | X = x] = \int_{-\infty}^{\infty} y\, f_{Y|X}(y|x)\, dy

The random variable E[Y∣X]E[Y | X] has the property that E[E[Y∣X]]=E[Y]E[E[Y|X]] = E[Y] (law of total expectation).

The bivariate normal distribution has joint PDF:

fX,Y(x,y)=12πσXσY1−ρ2exp⁡(−12(1−ρ2)[(x−μX)2σX2−2ρ(x−μX)(y−μY)σXσY+(y−μY)2σY2])f_{X,Y}(x, y) = \frac{1}{2\pi\sigma_X\sigma_Y\sqrt{1 - \rho^2}} \exp\left(-\frac{1}{2(1 - \rho^2)}\left[\frac{(x - \mu_X)^2}{\sigma_X^2} - 2\rho\frac{(x - \mu_X)(y - \mu_Y)}{\sigma_X\sigma_Y} + \frac{(y - \mu_Y)^2}{\sigma_Y^2}\right]\right)

where ρ=Corr(X,Y)\rho = \mathrm{Corr}(X, Y).

Properties of the bivariate normal:

  • Marginal distributions are normal: X∼N(μX,σX2)X \sim N(\mu_X, \sigma_X^2), Y∼N(μY,σY2)Y \sim N(\mu_Y, \sigma_Y^2).
  • Conditional distribution is normal: Y∣X=x∼N(μY+ρσYσX(x−μX), σY2(1−ρ2))Y | X = x \sim N\left(\mu_Y + \rho \frac{\sigma_Y}{\sigma_X}(x - \mu_X),\ \sigma_Y^2(1 - \rho^2)\right).
  • XX and YY are independent if and only if ρ=0\rho = 0.

3.6 Transformations of Joint Distributions

Section titled “3.6 Transformations of Joint Distributions”

For a transformation (U,V)=g(X,Y)(U, V) = g(X, Y) where gg is a diffeomorphism, the joint PDF is:

fU,V(u,v)=fX,Y(g−1(u,v))⋅∣det⁡Jg−1∣f_{U,V}(u, v) = f_{X,Y}(g^{-1}(u, v)) \cdot |\det J_{g^{-1}}|

where JJ is the Jacobian matrix of the inverse transformation.

Example. Let X,YX, Y be independent exponential(λ\lambda) random variables. The joint PDF of U=X+YU = X + Y and V=X/(X+Y)V = X/(X + Y) factors as fU,V(u,v)=λ2ue−λu⋅χ(0,1)(v)f_{U,V}(u, v) = \lambda^2 u e^{-\lambda u} \cdot \chi_{(0,1)}(v), showing UU and VV are independent with U∼Gamma(2,λ)U \sim \mathrm{Gamma}(2, \lambda) and V∼Uniform(0,1)V \sim \mathrm{Uniform}(0, 1).

If XX and YY are independent, the PDF of Z=X+YZ = X + Y is the convolution:

fZ(z)=∫−∞∞fX(z−y) fY(y) dy=∫−∞∞fX(x) fY(z−x) dxf_Z(z) = \int_{-\infty}^{\infty} f_X(z - y)\, f_Y(y)\, dy = \int_{-\infty}^{\infty} f_X(x)\, f_Y(z - x)\, dx

For moment generating functions: MZ(t)=MX(t) MY(t)M_Z(t) = M_X(t)\, M_Y(t).

ClaimTrue?Counterexample
Marginals determine the jointnoY=XY = X versus Y=−XY = -X with XX standard normal
Cov⁡(X,Y)=0\operatorname{Cov}(X,Y) = 0 implies independencenoXX uniform on [−1,1][-1,1], Y=X2Y = X^2: covariance is exactly 0, but YY is a function of XX
Correlation measures dependence strengthnoAnscombe’s quartet: four datasets with identical correlation 0.816 and completely different shapes
The sum of two normals is normalnounless they are jointly normal (bivariate normal)
Independence is symmetric in marginalsyesit is, but only because it is defined on the product measure

Uncorrelated does not mean independent. The Y=X2Y = X^2 example is the one to remember: YY is completely determined by XX, yet the covariance is zero by symmetry. Correlation measures linear dependence only, and it is blind to every other kind.

Anscombe’s quartet makes the same point visually. Four datasets with the same means, the same variances, the same correlation and the same fitted line — one linear, one curved, one with an outlier driving everything, one with a vertical line. Summary statistics are not a substitute for looking at the data.

The normal is the one family where the counterexamples stop. For a bivariate normal:

  • uncorrelated implies independent
  • the marginals are normal
  • the sum of the two is normal
  • the conditional expectation E[Y∣X]E[Y \mid X] is linear in XX

Every one of those is false in general, and every one is true for the bivariate normal. That is why the normal is the distribution statistical methods are built around — not because data is normal, but because theorems are provable.

Mix these with material from Random Variables, Limit Theorems and Measure Theory.

  1. (Probability.) Show that if XX and YY are independent then Cov⁡(X,Y)=0\operatorname{Cov}(X, Y) = 0, and give the counterexample showing the converse fails.
  2. (Probability.) Show Var⁡(X+Y)=Var⁡(X)+Var⁡(Y)+2Cov⁡(X,Y)\operatorname{Var}(X + Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X, Y), and deduce the variance of a sum of independent variables.
  3. (Probability.) Show that the bivariate normal with correlation hoho has conditional mean \mu_Y + ho rac{\sigma_Y}{\sigma_X}(x - \mu_X), and explain why this is the regression line.
  4. (Limit theorems.) Use the CLT and the delta method to find the asymptotic distribution of the sample correlation coefficient.
  5. (Measure theory.) Show that if XX and YY are independent then the joint measure is the product measure, and that Fubini’s theorem is what lets you compute E[X+Y]E[X + Y] by iterated integrals.

Problem 1. Let XX and YY have joint PDF fX,Y(x,y)=c(1−x2−y2)f_{X,Y}(x, y) = c(1 - x^2 - y^2) for x2+y2≤1x^2 + y^2 \leq 1. Find cc, the marginal PDFs, and P(X>0,Y>0)P(X > 0, Y > 0).

Problem 2. Show that if Cov(X,Y)=0\mathrm{Cov}(X, Y) = 0 for a bivariate normal pair, then XX and YY are independent.

Problem 3. Let XX and YY be independent standard normal variables. Find the distribution of R=X2+Y2R = \sqrt{X^2 + Y^2} and Θ=arctan⁡(Y/X)\Theta = \arctan(Y/X).

Solution. RR has Rayleigh distribution with PDF fR(r)=re−r2/2f_R(r) = r e^{-r^2/2} for r≥0r \geq 0, and Θ∼Uniform(0,2π)\Theta \sim \mathrm{Uniform}(0, 2\pi), and RR and Θ\Theta are independent. ■\blacksquare

Problem 4. Suppose X∼N(0,1)X \sim N(0, 1) and Y=X+ZY = X + Z where Z∼N(0,1)Z \sim N(0, 1) is independent of XX. Find the joint distribution of (X,Y)(X, Y) and compute Cov(X,Y)\mathrm{Cov}(X, Y).

3.9 Law of Total Probability and Bayes’ Theorem for Distributions

Section titled “3.9 Law of Total Probability and Bayes’ Theorem for Distributions”

Law of total probability: fY(y)=∫−∞∞fY∣X(y∣x) fX(x) dxf_Y(y) = \int_{-\infty}^{\infty} f_{Y|X}(y|x)\, f_X(x)\, dx.

Bayes’ theorem: fX∣Y(x∣y)=fY∣X(y∣x) fX(x)fY(y)=fY∣X(y∣x) fX(x)∫fY∣X(y∣t) fX(t) dtf_{X|Y}(x|y) = \frac{f_{Y|X}(y|x)\, f_X(x)}{f_Y(y)} = \frac{f_{Y|X}(y|x)\, f_X(x)}{\int f_{Y|X}(y|t)\, f_X(t)\, dt}.

3.10 Moment Generating Functions for Joint Distributions

Section titled “3.10 Moment Generating Functions for Joint Distributions”

The joint moment generating function of (X,Y)(X, Y) is:

MX,Y(s,t)=E[esX+tY]M_{X,Y}(s, t) = E[e^{sX + tY}]

If XX and YY are independent, then MX,Y(s,t)=MX(s) MY(t)M_{X,Y}(s, t) = M_X(s)\, M_Y(t). Joint moments can be recovered by differentiation:

E[XmYn]=∂m+n∂sm∂tnMX,Y(s,t)∣s=t=0E[X^m Y^n] = \frac{\partial^{m+n}}{\partial s^m \partial t^n} M_{X,Y}(s, t)\big|_{s=t=0}

Problem 5. Let (X,Y)(X, Y) have joint PDF fX,Y(x,y)=6xf_{X,Y}(x, y) = 6x for 0<x<10 < x < 1, 0<y<1−x0 < y < 1 - x. Find the marginal PDFs and determine if XX and YY are independent.

Problem 6. Suppose XX and YY are independent exponential random variables with rate λ\lambda. Find the distribution of X+YX + Y and X/(X+Y)X/(X + Y). Are they independent?

Problem 7. Show that Var(X)=E[Var(X∣Y)]+Var(E[X∣Y])\mathrm{Var}(X) = E[\mathrm{Var}(X|Y)] + \mathrm{Var}(E[X|Y]) (the variance decomposition formula).

Mistake 1: Confusing independence with pairwise independence. Two random variables XX and YY are independent if their joint distribution factors as FX,Y(x,y)=FX(x)FY(y)F_{X,Y}(x, y) = F_X(x)F_Y(y). For three or more variables, pairwise independence (each pair is independent) does not imply mutual independence. There exist random variables X,Y,ZX, Y, Z that are pairwise independent but not mutually independent.

Mistake 2: Assuming that zero covariance implies independence. If XX and YY are independent, then Cov(X,Y)=0\mathrm{Cov}(X, Y) = 0, but the converse is false. Uncorrelated variables can be dependent. For example, let XX be uniform on {−1,0,1}\{-1, 0, 1\} and Y=X2Y = X^2. Then Cov(X,Y)=0\mathrm{Cov}(X, Y) = 0, but XX and YY are not independent.

Mistake 3: Forgetting that the marginal distribution does not determine the joint distribution. Knowing the marginal distributions fX(x)f_X(x) and fY(y)f_Y(y) does not determine the joint distribution fX,Y(x,y)f_{X,Y}(x, y). The joint distribution also depends on the dependence structure between XX and YY. Two different joint distributions can have the same marginals.

Mistake 4: Confusing the correlation coefficient with the slope of a regression line. The correlation coefficient ρ(X,Y)\rho(X, Y) measures the strength of the linear relationship between XX and YY, but it is not the same as the slope of the regression line of YY on XX. The slope is ρ(X,Y)⋅σY/σX\rho(X, Y) \cdot \sigma_Y / \sigma_X, which depends on the standard deviations.

Mistake 5: Assuming that linear regression is appropriate for nonlinear relationships. Linear regression fits a straight line to the data, but if the relationship between XX and YY is nonlinear, the regression line may be misleading. Always check the scatterplot and consider nonlinear models if the relationship appears curved.

Joint distributions describe how two or more random variables vary together. Independence means knowing one variable tells you nothing about the other, which mathematically factorizes the joint distribution into a product. Dependence creates structure: positive correlation means variables tend to move together, negative correlation means they move oppositely. The marginal distribution is what you see when you ignore one variable, like looking at a 3D landscape from above. Conditional distributions slice the joint distribution along one variable, revealing how the other behaves given specific information. These concepts form the backbone of statistical modeling.