Unit 7, lesson 45

Marginal Probability Distributions

How to find the marginal distribution of each variable from a joint probability table by summing out the other variable, why the margins are ordinary PMFs, and what they lose about how values pair up.

  • Video 45
  • Joint, Marginal and Conditional Distributions

A joint table for a parcel gives the probability of each combination of route and inspection. Often the question involves only one of them, such as how likely express routing is, whatever happens with inspection. Answering it means keeping the condition you care about and letting the other variable take every value it can. This lesson shows how to get the distribution of each variable from the joint table in this way, and why those separate distributions cannot in general be turned back into the joint table.

Key terms

Marginal distribution

Definition Let XX and YY be random variables on the same sample space. The marginal distribution of XX is the distribution of XX by itself, given by the probabilities P(X∈A)P(X \in A) for sets AA of real numbers, with no condition on YY. The marginal distribution of YY is defined in the same way. The word marginal records only that the distribution was obtained from a joint law. It is the ordinary distribution of that variable, so its CDF, and its mean and variance when they exist, are found exactly as for any single random variable.

In plain words A marginal distribution answers questions about one variable and places no restriction on the other.

Example In a constructed model, X=1X = 1 when a parcel takes the express route and X=0X = 0 for the standard route, and Y=1Y = 1 when it gets an extra inspection and Y=0Y = 0 when it does not. The joint table is

Y=0Y = 0Y=1Y = 1
X=0X = 00.30.30.20.2
X=1X = 10.10.10.40.4

Express routing, with or without inspection, is the event {X=1,Y=0}∪{X=1,Y=1}\{X = 1, Y = 0\} \cup \{X = 1, Y = 1\}, so P(X=1)=0.1+0.4=0.5P(X = 1) = 0.1 + 0.4 = 0.5. In the same way P(Y=1)=0.2+0.4=0.6P(Y = 1) = 0.2 + 0.4 = 0.6. Both variables are indicators, so E[X]=0.5E[X] = 0.5 and E[Y]=0.6E[Y] = 0.6. The CDF of YY is the step function

FY(t)={0,t<0,0.4,0≤t<1,1,t≥1.F_Y(t) = \begin{cases} 0, & t < 0, \\ 0.4, & 0 \le t < 1, \\ 1, & t \ge 1. \end{cases}

The mean 0.60.6 is the probability that a parcel is inspected. It does not describe any single parcel, which is either inspected or not.

Marginal probability mass function

Definition Let XX and YY be discrete random variables with joint PMF pX,Yp_{X,Y}. The marginal PMFs of XX and YY are

pX(x)=∑ypX,Y(x,y),pY(y)=∑xpX,Y(x,y)\begin{aligned} p_X(x) &= \sum_{y} p_{X,Y}(x, y), \\[0.4em] p_Y(y) &= \sum_{x} p_{X,Y}(x, y) \end{aligned}

for all real xx and yy, where each sum runs over the possible values of the other variable. The first formula holds because the event {X=x}\{X = x\} is, apart from an event of probability 00, the union of the disjoint events {X=x,Y=y}\{X = x, Y = y\} over the possible values yy of YY, and the second holds for the same reason. Each marginal PMF is nonnegative and adds to 11, because adding all of its masses adds every joint mass exactly once.

In plain words In a joint table, the marginal PMF of the row variable is the list of row totals, and the marginal PMF of the column variable is the list of column totals. They are written in the margins of the table, which gives them their name.

Example The parcel table with its margins is

Y=0Y = 0Y=1Y = 1pX(x)p_X(x)
X=0X = 00.30.30.20.20.50.5
X=1X = 10.10.10.40.40.50.5
pY(y)p_Y(y)0.40.40.60.611

The row totals give pX(0)=pX(1)=0.5p_X(0) = p_X(1) = 0.5, and the column totals give pY(0)=0.4p_Y(0) = 0.4 and pY(1)=0.6p_Y(1) = 0.6. Each margin adds to 11, and both agree with the total of the four cells, which is a quick check on the arithmetic.

Summing out a variable

Definition Summing out YY means adding the joint PMF over the values of YY, which removes YY and leaves the marginal PMF of XX. For a fixed xx, the sum must include every value yy that can occur together with xx, that is, every yy with pX,Y(x,y)>0p_{X,Y}(x, y) > 0. Values of YY that cannot occur with xx contribute 00, so the sum may also run over all possible values of YY, but no pair of positive mass may be left out. When the joint support is not a rectangle, the values of YY compatible with xx change with xx, and the limits of the sum change with them. Summing out XX works the same way.

In plain words Hold fixed the value you are asking about, and let the other variable run through everything it can be alongside it. The variable you sum over disappears from the answer.

Example A constructed joint PMF puts mass 13x\tfrac{1}{3x} on each pair of integers with 1≤y≤x≤31 \le y \le x \le 3, and mass 00 on every other pair.

Y=1Y = 1Y=2Y = 2Y=3Y = 3
X=1X = 113\tfrac130000
X=2X = 216\tfrac1616\tfrac1600
X=3X = 319\tfrac1919\tfrac1919\tfrac19

Row xx holds xx cells of mass 13x\tfrac{1}{3x}, so pX(x)=13p_X(x) = \tfrac13 for x=1,2,3x = 1, 2, 3. For YY, the compatible values of xx are those with x≥yx \ge y, so

pY(y)=∑x=y313x.p_Y(y) = \sum_{x = y}^{3} \frac{1}{3x}.

This gives pY(1)=13+16+19=1118p_Y(1) = \tfrac13 + \tfrac16 + \tfrac19 = \tfrac{11}{18}, pY(2)=16+19=518p_Y(2) = \tfrac16 + \tfrac19 = \tfrac{5}{18} and pY(3)=19=218p_Y(3) = \tfrac19 = \tfrac{2}{18}, which add to 11. Using the formula 13x\tfrac{1}{3x} for every xx from 11 to 33, without the restriction x≥yx \ge y, would add values of the formula at pairs that cannot occur and make each of the three values 1118\tfrac{11}{18}, with total 3318\tfrac{33}{18}.

Information lost by marginalizing

Definition The joint PMF determines both marginal PMFs, but the two marginal PMFs do not in general determine the joint PMF. Different joint PMFs can have the same marginals and still assign different probabilities to events that involve both variables. The product pX(x) pY(y)p_X(x)\,p_Y(y) equals pX,Y(x,y)p_{X,Y}(x, y) for every pair exactly when XX and YY are independent, the subject of a later lesson, so without independence the margins cannot simply be multiplied. In special cases the margins do fix the joint PMF, for example when one of the two variables is constant.

In plain words The margins tell how each variable behaves by itself. They can limit how the values pair up, but in general they do not fix it. That pairing information is in the joint table.

Example The tables with rows (0.3,0.2),(0.1,0.4)(0.3, 0.2), (0.1, 0.4) and with rows (0.2,0.3),(0.2,0.3)(0.2, 0.3), (0.2, 0.3) both have row totals 0.50.5 and 0.50.5 and column totals 0.40.4 and 0.60.6. They agree on the probability of express routing and on the probability of inspection, but the probability of both is 0.40.4 in the first and 0.30.3 in the second. In fact every number tt with 0.1≤t≤0.50.1 \le t \le 0.5 is possible for that cell. The table

(t−0.10.6−t0.5−tt),\begin{pmatrix} t - 0.1 & 0.6 - t \\ 0.5 - t & t \end{pmatrix},

with rows for X=0,1X = 0, 1 and columns for Y=0,1Y = 0, 1, has these margins for every tt, and its entries are nonnegative exactly when 0.1≤t≤0.50.1 \le t \le 0.5. Only t=0.3t = 0.3 makes every cell the product of its margins, since 0.5×0.6=0.30.5 \times 0.6 = 0.3.

Check yourself

  1. A joint table has the row (0.1,0.2,0.2)(0.1, 0.2, 0.2) for X=0X = 0 and the row (0.2,0.1,0.2)(0.2, 0.1, 0.2) for X=1X = 1, with columns for Y=0Y = 0, 11 and 22. Check that it is a joint PMF, find both marginal PMFs, and find P(Y≥1)P(Y \ge 1) and E[Y]E[Y].
Show the answer

All six entries are nonnegative and add to 11. The row totals give pX(0)=pX(1)=0.5p_X(0) = p_X(1) = 0.5. The column totals give pY(0)=0.1+0.2=0.3p_Y(0) = 0.1 + 0.2 = 0.3, pY(1)=0.2+0.1=0.3p_Y(1) = 0.2 + 0.1 = 0.3 and pY(2)=0.2+0.2=0.4p_Y(2) = 0.2 + 0.2 = 0.4, which add to 11. From the marginal of YY, the probability P(Y≥1)P(Y \ge 1) is 0.3+0.4=0.70.3 + 0.4 = 0.7, and

E[Y]=0⋅0.3+1⋅0.3+2⋅0.4=1.1.\begin{aligned} E[Y] &= 0 \cdot 0.3 + 1 \cdot 0.3 \\[0.4em] &\quad + 2 \cdot 0.4 = 1.1. \end{aligned}
  1. Two labels are drawn without replacement from a bag with one blue label and two gold labels, with each remaining label equally likely at each draw. Let X=1X = 1 if the first label is blue and X=0X = 0 otherwise, and let Y=1Y = 1 if the second label is blue and Y=0Y = 0 otherwise. Build the joint table, find both marginal PMFs, and compare P(X=1,Y=1)P(X = 1, Y = 1) with pX(1) pY(1)p_X(1)\,p_Y(1).
Show the answer

The first label is blue with probability 13\tfrac13, and then the second is gold, so pX,Y(1,0)=13p_{X,Y}(1, 0) = \tfrac13 and pX,Y(1,1)=0p_{X,Y}(1, 1) = 0. The first label is gold with probability 23\tfrac23, and then the second is blue with probability 12\tfrac12, so pX,Y(0,1)=13p_{X,Y}(0, 1) = \tfrac13 and pX,Y(0,0)=13p_{X,Y}(0, 0) = \tfrac13.

Y=0Y = 0Y=1Y = 1pX(x)p_X(x)
X=0X = 013\tfrac1313\tfrac1323\tfrac23
X=1X = 113\tfrac130013\tfrac13
pY(y)p_Y(y)23\tfrac2313\tfrac1311

Both draws have the same marginal PMF, with pX(1)=pY(1)=13p_X(1) = p_Y(1) = \tfrac13. The product pX(1) pY(1)=19p_X(1)\,p_Y(1) = \tfrac19, but the joint mass is 00, because the bag holds only one blue label. The margins do not show this, and multiplying them assumes an independence that the two draws do not have.

  1. Two codes XX and YY, each 00 or 11, have P(X=1)=0.3P(X = 1) = 0.3 and P(Y=1)=0.6P(Y = 1) = 0.6. Which values can P(X=1,Y=1)P(X = 1, Y = 1) take? Give the joint table at the smallest and at the largest possible value, and the table in which every joint mass is the product of its margins.
Show the answer

Write t=P(X=1,Y=1)t = P(X = 1, Y = 1). The margins then force the other three cells,

pX,Y(1,0)=0.3−t,pX,Y(0,1)=0.6−t,pX,Y(0,0)=0.1+t.\begin{aligned} p_{X,Y}(1, 0) &= 0.3 - t, \\[0.4em] p_{X,Y}(0, 1) &= 0.6 - t, \\[0.4em] p_{X,Y}(0, 0) &= 0.1 + t. \end{aligned}

All four cells are nonnegative exactly when 0≤t≤0.30 \le t \le 0.3, so the joint probability can be any number from 00 to 0.30.3. At t=0t = 0 the rows for X=0X = 0 and X=1X = 1 are (0.1,0.6)(0.1, 0.6) and (0.3,0)(0.3, 0). At t=0.3t = 0.3 they are (0.4,0.3)(0.4, 0.3) and (0,0.3)(0, 0.3). The product table has t=0.3×0.6=0.18t = 0.3 \times 0.6 = 0.18, with rows (0.28,0.42)(0.28, 0.42) and (0.12,0.18)(0.12, 0.18). The same margins fit infinitely many joint tables, so by themselves they restrict P(X=1,Y=1)P(X = 1, Y = 1) to this interval but do not determine its value.

How this lesson connects