MPE StudioMath of Planet Earth
Statistical Toolkit · 02

Marginal and Conditional Distributions

Breaking the joint distribution into simpler pieces

When two random variables are described together, we can either focus on one variable alone or ask what happens when information about the other variable is known.

p(x,y)
Marginalize →Condition →
Ignore YpX(x)
Know X = xp(y | x)

Marginalization removes information about another variable. Conditioning uses information about it.

Watch the concept

One Concept · One Example

Marginal and Conditional Distributions video thumbnail▶

Marginal and Conditional Distributions: From the Joint

Presented by Charlotte Moser

Watch on YouTube ↗

What to notice

The idea in 30 seconds

Two operations, two different questions

Marginal distribution

To find the distribution of X alone, integrate over all possible values of Y. For discrete variables, replace the integral with a sum.

pX(x)=∫−∞∞p(x,y)dy

Sum over what you do not want to keep.

multiple values of Y↓ collapse together ↓distribution of X

Conditional distribution

If we know X = x, keep the compatible slice of the joint distribution and normalize it.

p(y|x)=p(x,y)pX(x)

Keep the slice consistent with what you know, then renormalize it.

joint distribution↓ select slice · normalize ↓p(y | x)
Explore 01

From joint to marginal

A joint distribution tells us how X and Y vary together. What if we only care about one of them?

Joint density p(x,y). Collapse vertically across all Y values.

pX(x)

pX(x)=∫−∞∞p(x,y)dy

Press Marginalize to collapse the joint distribution.

Marginalization asks: what does one variable look like when we do not specify the other?

Ignoring information is not the same as using information

A marginal distribution averages over the other variable. A conditional distribution asks a different question: what changes once something is known?

Explore 02

What changes when we know the weather?

Imagine observations collected over 100 days. Let X be Weather, Sunny (S) or Rainy (R), and Y be Mood, Happy (H) or Sad (D).

Each central cell describes the probability of a pair of outcomes.

Joint distribution P(X,Y)
HappySadTotal
Sunny0.400.10—
Rainy0.200.30—
Total———

P(Y | X = S)

Happy80%
Sad20%
P(H|S)=0.400.50=0.80P(D|S)=0.100.50=0.20

A conditional distribution is a slice of the joint distribution, renormalized to sum to one.

joint distribution→select a row→divide by the row total→conditional distribution

Two different questions

Marginal P(Y)

What is the distribution of mood overall?

Happy 60% · Sad 40%

Conditional P(Y | X = S)

What is the distribution of mood among sunny days?

Happy 80% · Sad 20%

The marginal distribution averages over weather. The conditional distribution uses information about weather.

KEY TAKEAWAY

A joint distribution contains multiple views of the same probabilistic system. Marginalization isolates one variable by summing or integrating over the others. Conditioning updates the distribution using information that is known.

p(x,y)
Ignore →Use →
MarginalizepX(x) = ∫p(x,y)dy
Conditionp(y|x) = p(x,y)/pX(x)