Joint distributions: same margins, different dependence
The question
A joint table of X and Y has row totals 0.6 and 0.4, column totals 0.7 and 0.3. Which cells make X and Y independent?
And what can a third variable do to independence?
- 1 SeeFill in tables with fixed totals. 3 rounds.
- 2 TryAdd a third variable and predict.
- 3 ProveBuild a proof about mixing two groups.
- 4 ApplyTables, bounds, loans and screening checks.
Before you start · 3 quick checks on conditional probability, mass functions and independent events, about 3 min
Two ideas before you start
2 ideasA table and its totals
Figure: a two by two joint table of X and Y with its row and column totals; in each of the three tables every total is 0.5. It needs JavaScript.
P(X = 1) = 0.5 + 0 = 0.5
Each cell is the probability of one pair of values. A row adds up to the probability of that value of X, and a column to the probability of that value of Y. The three tables have the same totals but different cells.
Exact definition
Joint and marginal distributions. Let \(X\) and \(Y\) be random variables on the same experiment, each with finitely many values. Their joint distribution is the table of probabilities \(P(X = x, Y = y)\), one for each pair of values. The marginal distributions are the distributions of \(X\) and of \(Y\) alone, the row and column totals:
\[\begin{aligned} P(X = x) &= \sum_{y} P(X = x, Y = y), \\ P(Y = y) &= \sum_{x} P(X = x, Y = y). \end{aligned}\]The joint distribution determines both marginals, but the marginals do not determine the joint distribution.
Independent: every cell is a product of its totals
Figure: the picked table as a mosaic, one column for each value of X, split into a lower band for Y = 0 and an upper band for Y = 1, with a dashed line at half the height. It needs JavaScript.
P(X = 1, Y = 1) = 0 vs P(X = 1) P(Y = 1) = 0.25
Tap a table to test it.
In the mosaic each column is one value of X, and its bands show how Y splits given that value. X and Y are independent when every column splits the same way, at the dashed line.
Exact definition
Independent random variables. \(X\) and \(Y\), each with finitely many values, are independent when
\[P(X = x, Y = y) = P(X = x)\,P(Y = y)\]for every value \(x\) of \(X\) and every value \(y\) of \(Y\). Equivalently, for every \(x\) with \(P(X = x) \gt 0\), the conditional distribution of \(Y\) given \(X = x\) is the marginal distribution of \(Y\): \(P(Y = y \mid X = x) = P(Y = y)\) for every \(y\).
Fine print: what this page assumes
Every random variable on this page takes finitely many values, and every event the page conditions on has positive probability. All the probabilities are model numbers chosen for the examples, not data.
For continuous random variables the table becomes a joint density \(f(x, y)\), the totals become integrals, \(f_{X}(x) = \int f(x, y)\,dy\), and independence means \(f(x, y) = f_{X}(x)\,f_{Y}(y)\); the lesson on PMF, PDF and CDF covers one variable. The point of this page carries over: two stock prices can each have a lognormal distribution, and those two marginals still do not determine the joint distribution of the two prices.
Make the table independent
- Type a probability into each white box. Decimals and fractions both work. The page fills in the other cells so that every row and column total stays fixed.
- Watch the mosaic: one column for each value of X, split into bands for the values of Y.
- Press Check my table. A cell that equals its row total times its column total gets a thick border; a cell that does not gets a dashed border. Check as often as you like.
A third variable
Let \(Z\) be a third random variable with finitely many values. \(X\) and \(Y\) are independent given \(Z\) when, for every value \(z\) with \(P(Z = z) \gt 0\) and all values \(x\) and \(y\),
\[\begin{aligned} &P(X = x, Y = y \mid Z = z) \\ &= P(X = x \mid Z = z) \\ &\quad \times P(Y = y \mid Z = z). \end{aligned}\]Each value of \(Z\) gives its own joint table, and each of those tables is independent in the sense of stage 1.
Two questions come first. The explorer below them opens once both are answered.
The explorer opens when you have answered the two questions above.
Explorer: two bonds and the economy
The bonds of the first question, with every probability open to change. \(\pi = P(Z = 1)\) is the probability of a recession. In state \(z\), the first bond defaults with probability \(a_{z}\) and the second with probability \(b_{z}\), and given the state the defaults are independent. Write \[\begin{aligned} \Delta &= P(X = 1, Y = 1) \\ &\quad - P(X = 1)\,P(Y = 1). \end{aligned}\] It is 0 exactly when the cell \((X = 1, Y = 1)\) equals the product of its totals. Every slider moves in steps of 0.05.
Goals
What mixing two groups does to independence
Assumptions. \(Z\), \(X\) and \(Y\) each take the values 0 and 1, and \(\pi = P(Z = 1)\) with \(0 \lt \pi \lt 1\). Given each value of \(Z\), \(X\) and \(Y\) are independent, with \(a_{z} = P(X = 1 \mid Z = z)\) and \(b_{z} = P(Y = 1 \mid Z = z)\) for \(z = 0, 1\). Every \(a_{z}\) and \(b_{z}\) is strictly between 0 and 1, and \(a_{0} \ne a_{1}\), \(b_{0} \ne b_{1}\): the value of \(Z\) changes the probabilities of both.
Conclusion. Let \(\Delta\) be the gap between the cell \((X = 1, Y = 1)\) and the product of its totals. Then
\[\begin{aligned} \Delta &= P(X = 1, Y = 1) \\ &\quad - P(X = 1)\,P(Y = 1) \\ &= \pi(1 - \pi)(a_{1} - a_{0})(b_{1} - b_{0}), \end{aligned}\]which is not 0. So \(X\) and \(Y\) are not independent, although they are independent given \(Z\). \(\Delta \gt 0\) when \(a\) and \(b\) move in the same direction from \(z = 0\) to \(z = 1\), and \(\Delta \lt 0\) when they move in opposite directions.
Facts the proof uses.
- the law of total probability, from the lesson on conditional probability: for every event \(A\), \[\begin{aligned} P(A) &= P(Z = 0)\,P(A \mid Z = 0) \\ &\quad + P(Z = 1)\,P(A \mid Z = 1); \end{aligned}\]
- independence given \(Z\), from the definition in stage 2.
Each option is one sentence about the \(X\), \(Y\) and \(Z\) of the theorem. Pick the one that is true for every \(\pi\), \(a_{0}\), \(a_{1}\), \(b_{0}\) and \(b_{1}\) the assumptions allow.
Problems
Each problem states its model and has hints and a full solution. Answers can be typed as decimals or as fractions.
Further reading
- J. K. Blitzstein and J. Hwang, Introduction to Probability, 2nd ed. (CRC Press, 2019), ch. 2, section 2.5 on independence and conditional independence, and ch. 7, "Joint distributions."
- S. Ross, A First Course in Probability, 10th ed. (Pearson, 2019), ch. 6, "Jointly Distributed Random Variables."
- A. J. McNeil, R. Frey and P. Embrechts, Quantitative Risk Management, revised ed. (Princeton University Press, 2015), the chapters on portfolio credit risk, on defaults that are independent given common economic factors.