Probability
Multivariate Probability
Conditional Distributions

Conditional Distributions

🍰

If a Joint distribution is a 3D landscape, a Conditional Distribution is a "slice" of that landscape. It tells us how one variable behaves when we fix the value of another.

The "Slicing" Intuition

Imagine you have a joint PDF f(X,Y)f(X, Y) representing the height and weight of people. If I tell you, "This person is exactly 180cm tall," we are no longer looking at the whole 3D surface. We are looking at a 2D curve at X=180X = 180.

However, because we "cut" the surface, the area under our slice might not equal 1. To make it a valid probability distribution, we must re-normalize it by dividing by the marginal probability.


The Definition

For a fixed value of Y=yY=y, the conditional PDF of XX is:

fXY(xy)=f(x,y)fY(y)f_{X|Y}(x \mid y) = \frac{f(x, y)}{f_Y(y)}

This is essentially the multivariate version of the Conditional Probability Definition.


Law of Total Probability (Continuous)

We can find the overall marginal probability of XX by summing up all the "slices" of its conditional distribution, weighted by the probability of each slice:

fX(x)=fXY(xy)fY(y)dyf_X(x) = \int_{-\infty}^{\infty} f_{X|Y}(x \mid y) f_Y(y) \, dy


The Law of Iterated Expectations (Adam's Law)

This is a "God-tier" shortcut for finding the mean of a variable. It states:

E[X]=E[E[XY]]E[X] = E[E[X|Y]]

The "Average of Averages" Intuition

If you want to find the average height of a city, you can:

  1. Calculate the average height of each neighborhood (E[XY]E[X|Y]).
  2. Then, take the average of those neighborhood averages (E[]E[\dots]).

This is extremely useful when the overall mean is hard to calculate, but the means within specific groups are easy to find.

Test Your Knowledge

Example: Calculating a Conditional Mean

Suppose E[XY]=2Y+3E[X|Y] = 2Y + 3. If the mean of YY is E[Y]=5E[Y] = 5, find the overall mean E[X]E[X].

View Step-by-Step Solution

Using the Law of Iterated Expectations: E[X]=E[E[XY]]E[X] = E[E[X|Y]] E[X]=E[2Y+3]E[X] = E[2Y + 3]

Using the linearity of expectation: E[X]=2E[Y]+3E[X] = 2E[Y] + 3 E[X]=2(5)+3=13E[X] = 2(5) + 3 = 13

The mean of XX is 13. Notice we didn't even need to know the full distribution of XX or YY!