Neural Sync Active
Week 1.2: Marginal Distributions
Registry Synced
Week 1.2: Marginal Distributions
1674 words
8 min read
Reading compass
Now · 1. Intuition: "Summing Away" the Other Variable
Week 1.2: Marginal Distributions
Prerequisites: Joint PMF (Week 1.1: Joint Probability Mass Function (Joint PMF)) Cross-links: BSMA3012 (Linear Stat Models) — marginalisation in multivariate regression Core question: Given the full joint distribution, how do we recover the distribution of just one variable?
1. Intuition: "Summing Away" the Other Variable
The joint PMF fXY(x,y) tells us everything about the pair (X,Y). But sometimes we only care about X alone. How do we get fX(x) from fXY?
Intuition: The event (X=x) can be partitioned into the disjoint union of events (X=x,Y=y) for all possible y. Since these events are mutually exclusive:
We are summing over (or marginalising out) Y. The resulting PMF is called the marginal PMF because it appears in the margins of a contingency table.
2. Formal Definition
>fX(t)=P(X=t)=t′∈TY∑fXY(t,t′),t∈TX.>Definition (Marginal PMF) Let X and Y be jointly distributed discrete random variables with joint PMF fXY. The marginal PMF of X is
>fY(t)=P(Y=t)=t′∈TX∑fXY(t′,t),t∈TY.>Similarly, the marginal PMF of Y is
Proof sketch:
Let TY={y1,y2,…,yK}. Then:
The union is disjoint because Y can only take one value at a time.
3. Visualised: The Margins of a Table
The name "marginal" comes from where these values appear in a contingency table — they are written in the margins (the extra row and column).
Example: Toss a Fair Coin Twice
| X2\X1 | 0 | 1 | ** fX2 ** |
|---|---|---|---|
| 0 | 1/4 | 1/4 | 1/2 |
| 1 | 1/4 | 1/4 | 1/2 |
| ** fX1 ** | 1/2 | 1/2 |
- fX1(0)=1/4+1/4=1/2 (column sum)
- fX1(1)=1/4+1/4=1/2 (column sum)
- fX2(0)=1/4+1/4=1/2 (row sum)
- fX2(1)=1/4+1/4=1/2 (row sum)
4. Key Insight: Same Marginals, Different Joints
It is entirely possible for different joint PMFs to produce the same marginal PMFs. This is a critical observation — the marginals alone do not capture the dependence structure.
Example
Consider:
Case 1 (Independent):
| Y\X | 0 | 1 | fY |
|---|---|---|---|
| 0 | 1/4 | 1/4 | 1/2 |
| 1 | 1/4 | 1/4 | 1/2 |
| ** fX ** | 1/2 | 1/2 |
Case 2 (Dependent, parameter x):
| Y\X | 0 | 1 | fY |
|---|---|---|---|
| 0 | x | 1/2−x | 1/2 |
| 1 | 1/2−x | x | 1/2 |
| ** fX ** | 1/2 | 1/2 |
For any x∈[0,1/2], both marginals are fX(0)=fX(1)=1/2, fY(0)=fY(1)=1/2. But the joint distributions differ!
- x=1/4 → independent case
- x=0 → perfect negative dependence (X and Y always differ)
- x=1/2 → perfect positive dependence (X and Y always equal)
Takeaway: The joint PMF contains strictly more information than the two marginals. Marginalisation loses information about dependence.
5. Marginalisation for Multiple RVs
For n random variables X1,…,Xn with joint PMF fX1…Xn:
- Individual marginal: Sum over all other variables.
- Joint marginal of a subset: Sum over the variables not in the subset.
Mnemonic: Sum over everything you do NOT want.
6. Worked Examples
Example 1: Random 2-Digit Number
From the joint PMF table in Week 1.1: Joint Probability Mass Function (Joint PMF):
| Y\X | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | fY |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 0 | 1/4 |
| 1 | 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 1/4 |
| 2 | 1/20 | 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 0 | 1/4 |
| 3 | 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 0 | 1/20 | 1/4 |
| ** fX ** | 1/10 | 1/10 | 1/10 | 1/10 | 1/10 | 1/10 | 1/10 | 1/10 | 1/10 | 1/10 |
- fX(x)=1/10 for x=0,1,…,9 → X∼Uniform{0,…,9}
- fY(y)=1/4 for y=0,1,2,3 → Y∼Uniform{0,1,2,3} Despite both being uniform, X and Y are not independent (the joint is not the product of marginals).
Example 2: Triple Coin Toss
| X1 | X2 | X3 | fX1X2X3 |
|---|---|---|---|
| 0 | 0 | 0 | 1/8 |
| 0 | 0 | 1 | 1/8 |
| 0 | 1 | 0 | 1/8 |
| 0 | 1 | 1 | 1/8 |
| 1 | 0 | 0 | 1/8 |
| 1 | 0 | 1 | 1/8 |
| 1 | 1 | 0 | 1/8 |
| 1 | 1 | 1 | 1/8 |
Marginal of X1:
So X1∼Bernoulli(1/2).
Joint marginal of (X1,X2):
Note (X1,X2) are independent and uniform — same as the 2-coin toss.
Example 3: IPL Over
From the IPL example, marginal of X (runs) can be obtained by summing over Y:
For x=6: fX(6)=1613⋅71+81⋅71+161⋅71=71.
7. Formula Summary
| Operation | Formula | Mnemonic |
|---|---|---|
| Marginal of X from (X,Y) | fX(x)=∑yfXY(x,y) | Sum over y |
| Marginal of Y from (X,Y) | fY(y)=∑xfXY(x,y) | Sum over x |
| Joint marginal (Xi,Xj) from n RVs | fXiXj(u,v)=∑othersfX1…Xn | Sum out the rest |
| Individual marginal from n RVs | fXi(t)=∑all othersfX1…Xn | Sum out everything else |
8. Practice Questions
Q1 (Easy)
For the joint PMF below, find the marginal PMFs of X and Y.
| Y\X | 0 | 1 | 2 |
|---|---|---|---|
| 0 | 0.1 | 0.2 | 0.1 |
| 1 | 0.15 | 0.05 | 0.1 |
| 2 | 0.05 | 0.15 | 0.1 |
Full SolutionMarginal of X (column sums):
- fX(0)=0.1+0.15+0.05=0.30
- fX(1)=0.2+0.05+0.15=0.40
- fX(2)=0.1+0.1+0.1=0.30
Marginal of Y (row sums):
- fY(0)=0.1+0.2+0.1=0.40
- fY(1)=0.15+0.05+0.1=0.30
- fY(2)=0.05+0.15+0.1=0.30
Check: ∑fX=0.3+0.4+0.3=1, ∑fY=0.4+0.3+0.3=1. ✓
Q2 (Medium)
For the same joint PMF, compute P(X+Y≤1) using the marginal distributions. Can you compute it using only marginals?
Strategy HintThe event X+Y≤1 involves both variables together; you need the joint PMF, not just the marginals. Full SolutionWe need the joint probabilities for pairs where x+y≤1:
- (0,0): 0.1
- (0,1): 0.15
- (1,0): 0.2
- (0,0) already counted
P(X+Y≤1)=0.1+0.15+0.2=0.45.Cannot be computed from marginals alone — we need the joint.
Q3 (Hard)
Three fair dice are rolled. Let X1,X2,X3 be the outcomes. Find fX1X2(i,j) and fX1(i).
>fX1X2(i,j)=k=1∑6fX1X2X3(i,j,k)=k=1∑62161=2166=361.>Full SolutionSince rolls are independent and uniform {1,…,6}:fX1X2(i,j)=fX1(i)⋅fX2(j)=61⋅61=361 for all i,j∈{1,…,6}.fX1(i)=61 for i=1,…,6.Alternatively, marginalise from the triple:
Q4 (Exam-style)
The joint PMF of (X,Y) is given by fXY(x,y)=c⋅(x+y) for x=1,2, y=1,2,3. Find c and the marginal PMFs.
>1⇒c=x=1∑2y=1∑3c(x+y)=cx=1∑2y=1∑3(x+y)=c[x=1∑2y=1∑3x+x=1∑2y=1∑3y]=c[(1+2)⋅3+2⋅(1+2+3)]=c[3⋅3+2⋅6]=c(9+12)=21c=211.>Strategy HintFirst find c by requiring total probability = 1, then compute marginals. Full SolutionFind c:
>fX(1)fX(2)=y=1∑3211(1+y)=211[(2)+(3)+(4)]=219=73=y=1∑3211(2+y)=211[(3)+(4)+(5)]=2112=74>Marginal of X:
>fY(1)fY(2)fY(3)=211[(1+1)+(2+1)]=211(2+3)=215=211[(1+2)+(2+2)]=211(3+4)=217=31=211[(1+3)+(2+3)]=211(4+5)=219=73>Marginal of Y:
Check: ∑fX=3/7+4/7=1, ∑fY=5/21+7/21+9/21=1. ✓
Next topic: Week 1.3: Conditional Distributions — The distribution of one variable given the value of another. Join Discord PreviousWeek 1.1: Joint Probability Mass Function (Joint PMF)NextWeek 1.3: Conditional Distributions