Skip to content
Glacius
ProbabilityConcept reference

Discrete marginals

A marginal mass function sums the joint probabilities over every value of the variable being removed.

On this page 8 sections
  1. Overview
  2. A marginal distribution keeps one variable
  3. For joint rows (0.1,0.2);(0.3,0.4) and columns Y=0,1, keeping Y means adding down columns
  4. Marginalization adds probability mass
  5. Key takeaway
  6. Further questions
  7. Sources & further reading
  8. Concept connections

01A marginal distribution keeps one variable#

A marginal distribution keeps one variable. To keep XX, add the joint masses across all YY values.

The joint table rows X=0,1 and columns Y=0,1 are (0.1,0.2) and (0.3,0.4). The right-hand P(X) cells are 0.3 and 0.7: the sums of the corresponding joint rows. Summing removes the Y coordinate while retaining every X value.The joint table rows X=0,1 and columns Y=0,1 are (0.1,0.2) and (0.3,0.4). The right-hand P(X) cells are 0.3 and 0.7: the sums of the corresponding joint rows. Summing removes the Y coordinate while retaining every X value.
Figure 1The joint table rows X=0,1 and columns Y=0,1 are (0.1,0.2) and (0.3,0.4). The right-hand P(X) cells are 0.3 and 0.7: the sums of the corresponding joint rows. Summing removes the Y coordinate while retaining every X value.
Link to this figure ↗Download SVGDownload PNG

Joint rows (0.1,0.2);(0.3,0.4)(0.1,0.2);(0.3,0.4) have rows X=0,1X=0,1. The X probabilities are 0.1+0.2=0.30.1+0.2=0.3 and 0.3+0.4=0.70.3+0.4=0.7.

PX(x)=yp(x,y)P_X(x)=\sum_y p(x,y)
Check your reasoning

X rows; Y columns; order 0,1. Joint rows: (0.2,0.3);(0.1,0.4)(0.2,0.3);(0.1,0.4). Find PYP_Y.

  1. A(0.3,0.7)(0.3,0.7)
  2. B(0.5,0.5)(0.5,0.5)
  3. C(0.2,0.3)(0.2,0.3)
Show answer and explanation
(0.3,0.7)(0.3,0.7)

Column sums: (0.3,0.7)(0.3,0.7).

02For joint rows (0.1,0.2);(0.3,0.4) and columns Y=0,1, keeping Y means adding down columns#

For joint rows (0.1,0.2);(0.3,0.4)(0.1,0.2);(0.3,0.4) and columns Y=0,1Y=0,1, keeping YY means adding down columns. The marginal is (0.4,0.6)(0.4,0.6).

Check your reasoning

X rows; Y columns; order 0,1. Joint rows: (0.1,0.1);(0.3,0.5)(0.1,0.1);(0.3,0.5). Fix row division: find PXP_X.

  1. A(0.4,0.6)(0.4,0.6)
  2. B(0.2,0.8)(0.2,0.8)
  3. C(0.1,0.3)(0.1,0.3)
Show answer and explanation
(0.2,0.8)(0.2,0.8)

Row sums: (0.2,0.8)(0.2,0.8).

03Marginalization adds probability mass#

Marginalization adds probability mass. No division is needed: the complete marginal already sums to 1. Use the table headings to choose which coordinate to keep.

Check your reasoning

Y: cache flag. X rows; Y columns; order 0,1. Joint rows: (0.3,0.2);(0.1,0.4)(0.3,0.2);(0.1,0.4). Give the cache flag PMF.

  1. A(0.5,0.5)(0.5,0.5)
  2. B(0.3,0.2)(0.3,0.2)
  3. C(0.4,0.6)(0.4,0.6)
Show answer and explanation
(0.4,0.6)(0.4,0.6)

Columns: (0.4,0.6)(0.4,0.6).

Key takeaway

Keep one variable; sum over the other.

  • Marginalize a joint mass table over one variable.

Further questions

Does a marginal depend on which row is observed?
No. It sums over the other variable without observing or fixing it.

Sources & further reading

  1. [1]
  2. [2]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Discrete marginals.” Math behind ML. /learn/p-discrete-marginal