The multivariate normal and its ellipses
The question
Two scores are jointly normal with equal spreads and correlation 0.6. Among people 1.5 SDs above average on the first, where does the second center?
Stage 1 asks you to mark it on the picture before the page computes it.
- 1 SeeMark the center of a slice, three rounds.
- 2 TryCompare slices, then move ρ and the slice.
- 3 ProveComplete the square, line by line.
- 4 ApplyExam scores, stock returns and a contour.
Before you start · 3 quick checks on normal areas, covariance and conditional probability, about 3 min
Two ideas before you start
2 ideasEqual height along ellipses
Figure: three nested contour ellipses of a bivariate normal density for the chosen correlation. It needs JavaScript.
ρ = 0.5: Q = (u² − uv + v²)/0.75 long axis along v = u
With u and v the values of X and Y in SD units, the density is a constant times e−Q/2, so it has the same height all along each ellipse Q = c². Drawn for c = 0.5, 1 and 1.5, with the long axis dashed.
Exact definition
Bivariate normal. Fix means \(\mu_X, \mu_Y\), standard deviations \(\sigma_X, \sigma_Y \gt 0\) and a number \(\rho\) with \(-1 \lt \rho \lt 1\). The pair \((X, Y)\) is bivariate normal when it has the joint density
\[\begin{aligned} f(x, y) &= \frac{1}{2\pi\sigma_X\sigma_Y\sqrt{1 - \rho^2}} \\ &\quad \cdot e^{-Q/2}, \end{aligned}\]where, with \(u = (x - \mu_X)/\sigma_X\) and \(v = (y - \mu_Y)/\sigma_Y\),
\[Q = \frac{u^2 - 2\rho uv + v^2}{1 - \rho^2}.\]Stage 3 shows that \(X \sim N(\mu_X, \sigma_X^2)\), \(Y \sim N(\mu_Y, \sigma_Y^2)\) and that \(\rho\) is their correlation. The level sets \(Q = c^2\) are ellipses centered at \((\mu_X, \mu_Y)\). When \(\sigma_X = \sigma_Y\) and \(\rho \ne 0\), their long axis lies along \(y - \mu_Y = x - \mu_X\) for \(\rho \gt 0\) and along \(y - \mu_Y = -(x - \mu_X)\) for \(\rho \lt 0\).
In \(n\) dimensions. A random vector \(X\) in \(\mathbb{R}^n\) is multivariate normal \(N(\mu, \Sigma)\), with \(\Sigma\) symmetric and positive definite, when it has the density
\[\begin{aligned} f(x) &= (2\pi)^{-n/2}(\det\Sigma)^{-1/2} \\ &\quad \cdot e^{-(x - \mu)^T\Sigma^{-1}(x - \mu)/2}. \end{aligned}\]For \(n = 2\), \(\Sigma\) has the entries \(\sigma_X^2\), \(\rho\sigma_X\sigma_Y\), \(\rho\sigma_X\sigma_Y\), \(\sigma_Y^2\), and \((x - \mu)^T\Sigma^{-1}(x - \mu)\) is the \(Q\) above. The lesson on covariance ellipses shows how \(\Sigma\) sets the shape of these ellipses.
Cut a slice, then rescale it
Figure: the slice of a joint density along X = 1, drawn against y, and the same slice rescaled to area 1. It needs JavaScript.
X = 1: slice f(1, y), area f_X(1) = φ(1) ≈ 0.242
Fixing X = 1 cuts a slice out of the joint density, drawn here with ρ = 0 and both SDs 1. Its area is fX(1); dividing by that area gives the density of Y given X = 1, with area 1.
Exact definition
Let \((X, Y)\) have a joint density \(f\). The density of \(X\) is \(f_X(x) = \int_{-\infty}^{\infty} f(x, y)\,dy\). For every \(x\) with \(f_X(x) \gt 0\), the conditional density of \(Y\) given \(X = x\) is
\[f_{Y \mid X}(y \mid x) = \frac{f(x, y)}{f_X(x)},\]and the conditional mean is
\[\begin{aligned} &E[Y \mid X = x] \\ &= \int_{-\infty}^{\infty} y\,f_{Y \mid X}(y \mid x)\,dy, \end{aligned}\]when the integral converges absolutely. It is the center of the rescaled slice. The lesson on conditional expectation explains why it is the best guess of \(Y\) once \(X\) is known.
In the figure \(\rho = 0\), so \(f(x, y) = \varphi(x)\varphi(y)\) with \(\varphi(t) = e^{-t^2/2}/\sqrt{2\pi}\): the solid slice is \(\varphi(1)\varphi(y)\), and the dashed rescaled slice is \(\varphi(y)\).
Fine print: more than two variables
If \(Z\) is a vector of \(n\) independent standard normal variables, \(A\) an \(n \times n\) matrix with \(AA^T = \Sigma\) invertible and \(\mu\) a fixed vector, then \(X = \mu + AZ\) is \(N(\mu, \Sigma)\). Every linear combination \(a^TX\) with \(a \ne 0\) of a multivariate normal vector is normal, and so is every marginal. If the coordinates of a multivariate normal vector are uncorrelated, they are independent.
Normal marginals alone do not make a pair jointly normal. If \(X\) is standard normal, \(S\) is \(\pm 1\) with probability \(\tfrac{1}{2}\) each and independent of \(X\), and \(Y = SX\), then \(Y\) is standard normal too, but \(X + Y = 0\) with probability \(\tfrac{1}{2}\), which no bivariate normal pair allows.
In \(n\) dimensions, \(Q = (X - \mu)^T\Sigma^{-1}(X - \mu)\) has the chi-square distribution with \(n\) degrees of freedom, described in the lesson on chi-square, t and F. For \(n = 2\) the ellipse \(Q = c^2\) holds probability \(1 - e^{-c^2/2}\).
Mark the center of a slice
- Move the slider to put the dashed line where you think \(Y\) centers among the outcomes on the dotted slice.
- The ellipses show where the joint density is high. Press Check my guess to see the slice's own density and its center.
How the game works
In every round \((X, Y)\) is bivariate normal, and the dotted vertical line is the slice \(X = x_0\): the outcomes where \(X\) takes the value \(x_0\). Your guess is the center of \(Y\) on that slice, \(E[Y \mid X = x_0]\). It moves in steps of 0.05 in rounds 1 and 2 and 0.1 in round 3. Both axes use the same scale, and each runs 4.25 SDs either side of its mean, so every ellipse and every slice density fits inside the figure. Check my guess locks the guess and draws the density of \(Y\) given \(X = x_0\) along the slice; a guess within 0.15 SD of \(Y\) of the center counts as close. After the third round a table compares your guesses with the centers. Start over clears everything.
| Round | Slice | Your guess | Center | Long axis |
|---|
In round 3, fathers 6 inches above their average have sons who are, on average, 3 inches above theirs. The model also runs the other way: sons 6 inches above their average have fathers who are, on average, 3 inches above theirs. Both statements follow from \(\rho = 0.5\) and the equal SDs. In the model the sons' heights spread exactly as much as the fathers' (SD 3 for both): regression toward the mean describes the average son of a given father, not a narrowing of the whole group.
Compare slices, then explore
Answer the two questions first; the explorer opens after both.
The explorer and its goals open after you answer both questions.
Explorer
- Here both means are 0 and the SD of \(X\) is 1. Set \(\rho\), the SD of \(Y\) and the slice \(x_0\) with the sliders.
- Reach the three goals below. Each goal starts again from round 1: \(\rho = 0.6\), SD of \(Y\) 1, slice at 1.5.
Goals
Why the line of centers is flatter than the long axis
Write \(a = \sigma_X^2\), \(b = \sigma_Y^2\) and \(c = \rho\sigma_X\sigma_Y\), with \(c \ne 0\). The line of centers has slope \(c/a\). The long axis points along an eigenvector \((c, \lambda_1 - a)\) of the covariance matrix, where \(\lambda_1\) is its larger eigenvalue, the larger root of
\[\begin{aligned} p(\lambda) &= (\lambda - a)(\lambda - b) \\ &\quad - c^2. \end{aligned}\]At \(\lambda^* = a + c^2/a\),
\[\begin{aligned} p(\lambda^*) &= \frac{c^2}{a}\left(a + \frac{c^2}{a} - b\right) \\ &\quad - c^2 \\ &= \frac{c^2}{a^2}(c^2 - ab), \end{aligned}\]which is negative because \(c^2 = \rho^2 ab \lt ab\). So \(\lambda^*\) lies strictly between the two roots, and \(\lambda_1 \gt a + c^2/a\). Then the long axis has slope \((\lambda_1 - a)/c\), and \(|\lambda_1 - a| \gt c^2/a\) gives \(|(\lambda_1 - a)/c| \gt |c/a|\): the long axis is strictly steeper. With \(\rho = 0\) the line of centers is horizontal, and it is the long axis only when \(\sigma_Y \lt \sigma_X\).
Every slice of a bivariate normal is normal
Let \(-1 \lt \rho \lt 1\) and let \((U, V)\) have the joint density
\[\begin{aligned} f(u, v) &= \frac{1}{2\pi\sqrt{1 - \rho^2}} \\ &\quad \cdot \exp\left(-\frac{u^2 - 2\rho uv + v^2}{2(1 - \rho^2)}\right). \end{aligned}\]Then \(U\) is standard normal, and for every real \(u\), given \(U = u\), \(V\) is normal with mean \(\rho u\) and variance \(1 - \rho^2\).
This is the bivariate normal of the definition in SD units: \(U = (X - \mu_X)/\sigma_X\) and \(V = (Y - \mu_Y)/\sigma_Y\). Write \(\varphi_{m,\, s^2}\) for the density of \(N(m, s^2)\),
\[\begin{aligned} \varphi_{m,\, s^2}(t) &= \frac{1}{\sqrt{2\pi s^2}} \\ &\quad \cdot e^{-(t - m)^2/(2s^2)}, \end{aligned}\]and \(\varphi = \varphi_{0,\, 1}\). Choose the true statement in each line.
Back in the original units. With \(X = \mu_X + \sigma_X U\) and \(Y = \mu_Y + \sigma_Y V\), the event \(X = x\) is the event \(U = (x - \mu_X)/\sigma_X\), and \(Y\) is \(V\) stretched by \(\sigma_Y\) and shifted by \(\mu_Y\). So given \(X = x\), \(Y\) is normal with
\[\begin{aligned} &E[Y \mid X = x] \\ &= \mu_Y + \rho\,\frac{\sigma_Y}{\sigma_X}(x - \mu_X), \\ &\operatorname{Var}(Y \mid X = x) \\ &= \sigma_Y^2(1 - \rho^2). \end{aligned}\]The marginals and the correlation. Line 3 shows that \(U\) is standard normal; \(f\) is symmetric in \(u\) and \(v\), so \(V\) is too. Averaging the slice centers over \(U\) gives \(E[UV] = E[U \cdot \rho U]\), which is \(\rho E[U^2] = \rho\), so \(\rho\) is the correlation of \(U\) and \(V\), and of \(X\) and \(Y\).
Where the line of centers meets the ellipses. On a vertical line \(x = x_1\), the joint density is \(f_X(x_1)\) times the slice density, so it is highest at the slice's center. The highest contour that the vertical line reaches therefore touches it at the center, where that contour's tangent is vertical. So the line of centers passes through the leftmost and rightmost points of every contour ellipse, while the long axis passes through the ends of the ellipses.
Problems
Each problem has hints and a full solution. Type each answer as a decimal, such as 0.25, or a fraction, such as 1/4.
Related: covariance ellipses treats the shape of the contours and the probability inside them, least squares fits a line of centers to data, and conditional expectation explains why the center of a slice is the best guess.
Further reading
- G. Casella and R. L. Berger, Statistical Inference, 2nd ed. (Duxbury, 2002), section 4.5, “Covariance and Correlation,” on the bivariate normal density and its conditional distributions.
- R. V. Hogg, J. W. McKean and A. T. Craig, Introduction to Mathematical Statistics, 8th ed. (Pearson, 2019), section 3.5, “The Multivariate Normal Distribution.”
- D. Freedman, R. Pisani and R. Purves, Statistics, 4th ed. (Norton, 2007), chapter 10, “Regression,” on the regression effect.