Probability
Multivariate Probability
Joint Distributions

Joint Distributions: The Multivariate World

👯

In the real world, variables rarely exist in isolation. To model complex systems—like the relationship between a person's height and weight, or the speed and fuel consumption of a car—we need Joint Distributions.

A Joint Distribution allows us to calculate the probability of multiple events occurring simultaneously.


1. Discrete Joint Distributions (PMFs)

For discrete random variables XX and YY, the Joint Probability Mass Function (PMF) is defined as: p(x,y)=P(X=x,Y=y)p(x, y) = P(X = x, Y = y)

The Joint PMF Table

The most intuitive way to visualize discrete joint distributions is through a table. Each cell represents the probability of a specific (x,y)(x, y) pair.

Example: Let XX be the number of heads in 2 coin flips and YY be whether the first flip was a head (11 for Head, 00 for Tail).

XYX \downarrow \setminus Y \to00 (Tail)11 (Head)Marginal P(X)P(X)
01/41/4001/41/4
11/41/41/41/41/21/2
2001/41/41/41/4
Marginal P(Y)P(Y)1/21/21/21/2Sum = 1.01.0

Key Rules for Joint PMFs:

  1. Normalization: The sum of all cells in the table must equal 11: xyp(x,y)=1\sum_x \sum_y p(x, y) = 1.
  2. Positivity: p(x,y)0p(x, y) \ge 0 for all x,yx, y.

2. Marginal Distributions: "Summing Out"

If you have the joint distribution but only care about one variable, you calculate its Marginal Distribution. You do this by summing across the rows or columns of the table.

  • Marginal PMF of XX: Sum over all possible yy values. pX(x)=yp(x,y)p_X(x) = \sum_y p(x, y)
  • Marginal PMF of YY: Sum over all possible xx values. pY(y)=xp(x,y)p_Y(y) = \sum_x p(x, y)
💡

Intuition: Marginalization is like looking at a 3D bar chart from the side. You "squash" all the probability mass onto one axis.


3. Expectations of Joint Variables

What is the average value of some function g(X,Y)g(X, Y)? For example, the product XYXY or the sum X+YX+Y.

E[g(X,Y)]=xyg(x,y)p(x,y)E[g(X, Y)] = \sum_x \sum_y g(x, y) \cdot p(x, y)

Special Case: E[XY]E[XY]

The expected value of the product XYXY is a critical component for calculating Covariance. E[XY]=xy(xy)p(x,y)E[XY] = \sum_x \sum_y (x \cdot y) \cdot p(x, y)


4. Continuous Joint Distributions (PDFs)

For continuous variables, we use the Joint Probability Density Function (PDF), f(x,y)f(x, y).

  • Normalization: The total volume under the 3D surface must be 11: f(x,y)dxdy=1\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} f(x, y) \, dx \, dy = 1
  • Marginal PDF: Instead of summing, we integrate out the variable we don't want: fX(x)=f(x,y)dyf_X(x) = \int_{-\infty}^{\infty} f(x, y) \, dy

5. Statistical Independence

Two random variables XX and YY are independent if knowing the value of one provides no information about the other. Mathematically, the joint distribution must be the product of the marginals:

p(x,y)=pX(x)pY(y)(Discrete)p(x, y) = p_X(x) \cdot p_Y(y) \quad \text{(Discrete)} f(x,y)=fX(x)fY(y)(Continuous)f(x, y) = f_X(x) \cdot f_Y(y) \quad \text{(Continuous)}

Table Visual for Independence

In an independence table, every row must be proportional to every other row. If you see a zero in a cell where both marginals are non-zero, the variables cannot be independent.

Test Your Knowledge

Example: Calculating Marginals and Expectation

A joint PMF is given by: p(1,1)=0.1,p(1,2)=0.2,p(2,1)=0.3,p(2,2)=0.4p(1,1)=0.1, p(1,2)=0.2, p(2,1)=0.3, p(2,2)=0.4.

  1. Find the marginals P(X=1)P(X=1) and P(Y=1)P(Y=1).
  2. Calculate E[XY]E[XY].
View Step-by-Step Solution

1. Marginals:

  • P(X=1)=p(1,1)+p(1,2)=0.1+0.2=0.3P(X=1) = p(1,1) + p(1,2) = 0.1 + 0.2 = 0.3
  • P(Y=1)=p(1,1)+p(2,1)=0.1+0.3=0.4P(Y=1) = p(1,1) + p(2,1) = 0.1 + 0.3 = 0.4

2. Joint Expectation E[XY]E[XY]: E[XY]=(11)(0.1)+(12)(0.2)+(21)(0.3)+(22)(0.4)E[XY] = (1\cdot1)(0.1) + (1\cdot2)(0.2) + (2\cdot1)(0.3) + (2\cdot2)(0.4) E[XY]=0.1+0.4+0.6+1.6=2.7E[XY] = 0.1 + 0.4 + 0.6 + 1.6 = 2.7