Hexa Scholar

Positive semidefinite matrices: when correlations cannot coexist

A gold clay ellipsoid pierced by three brass rods at right angles is squeezed between two navy plates until it bulges out sideways.
A clay ball squeezed between two plates.

The question

X₂ and X₃ each have correlation 0.9 with X₁. Can the correlation between X₂ and X₃ be 0.1?

Move three correlations yourself; the page checks whether any random variables could have them.

  1. 1 SeePush three correlations to their limit.
  2. 2 TryPredict which combinations break the matrix.
  3. 3 ProveBuild the proof, line by line.
  4. 4 ApplyProblems to check yourself.
Before you start · 3 quick checks on the variance of a combination, a quadratic form and an eigenvector, about 3 min

Two ideas before you start

2 ideas

Two variables: a variance cannot go below 0

Figure: the variance of X₁ + tX₂ as a parabola in t, dashed, for the chosen correlation ρ. It needs JavaScript.

ρ:

Var(X₁ + tX₂) = 1 + 0.6t + t²

lowest value 1 − ρ² = 0.91 at t = −0.3

For two variables with variance 1 and correlation ρ, the variance of X₁ + tX₂ is a parabola in t. Its lowest value is 1 − ρ², so it stays at or above 0 exactly when ρ is between −1 and 1. At ρ = 1 it touches 0.

Exact definition

Three standardized variables. Throughout, \(X_1\), \(X_2\), \(X_3\) are random variables with variance 1 each. Their correlations are \(\rho_{ij} = \operatorname{Cov}(X_i, X_j)\) for \(i \ne j\), with \(\rho_{ij} = \rho_{ji}\), and their correlation matrix is

\[R = \begin{pmatrix} 1 & \rho_{12} & \rho_{13} \\ \rho_{12} & 1 & \rho_{23} \\ \rho_{13} & \rho_{23} & 1 \end{pmatrix}.\]

Two at a time. For every number \(t\),

\[\begin{aligned} &\operatorname{Var}(X_1 + tX_2) \\ &= 1 + 2\rho_{12}t + t^2 \\ &= (t + \rho_{12})^2 + 1 - \rho_{12}^2. \end{aligned}\]

A variance is never negative, so \(1 - \rho_{12}^2 \ge 0\): every single correlation lies between \(-1\) and \(1\), as in the lesson on covariance and correlation. Conversely, any one number from \(-1\) to \(1\) is the correlation of some pair of variables.

Three variables: one matrix gives every variance

Figure: a 3 by 3 grid of the products of the weights and the correlations, for the matrix with ρ₁₂ = 0.3, ρ₁₃ = −0.4 and ρ₂₃ = 0.2. It needs JavaScript.

w:

w = (1, 1, 0): wᵀRw = sum of the nine cells = 2.6

With weights w₁, w₂, w₃, the variance of w₁X₁ + w₂X₂ + w₃X₃ adds the nine cells of the grid, each a weight times a weight times their correlation: it is the quadratic form wᵀRw. Three numbers can be correlations only if this is never negative.

Exact definition

The variance of a combination. For weights \(w = (w_1, w_2, w_3)\), the rule for the variance of a sum gives

\[\begin{aligned} &\operatorname{Var}(w_1X_1 + w_2X_2 + w_3X_3) \\ &= \sum_i \sum_j w_iw_j\rho_{ij} = w^\mathsf{T}Rw, \end{aligned}\]

with \(\rho_{ii} = 1\). This is the quadratic form of \(R\), as in the lesson on quadratic forms.

Positive semidefinite. A symmetric matrix \(A\) is positive semidefinite when \(w^\mathsf{T}Aw \ge 0\) for every vector \(w\), and positive definite when \(w^\mathsf{T}Aw \gt 0\) for every \(w \ne 0\). Equivalently, every eigenvalue of \(A\) is at least 0 (positive, for definite), because over vectors of length 1 the form runs from the smallest eigenvalue \(\lambda_{\min}\) to the largest.

Valid correlation matrices. A symmetric matrix with 1s on the diagonal is the correlation matrix of some random variables exactly when it is positive semidefinite. Every correlation matrix is, because \(w^\mathsf{T}Rw\) is a variance; the fine print below shows that every such matrix occurs.

Fine print: covariances, square roots and names

Covariance matrices. If \(X_i\) has standard deviation \(\sigma_i \gt 0\), the covariance matrix is \(\Sigma = DRD\) with \(D\) the diagonal matrix of the \(\sigma_i\), and \(w^\mathsf{T}\Sigma w = (Dw)^\mathsf{T}R(Dw)\). So \(\Sigma\) is positive semidefinite exactly when \(R\) is, and \(\det\Sigma = \sigma_1^2\sigma_2^2\sigma_3^2\det R\) has the sign of \(\det R\).

Every valid matrix occurs. For a positive semidefinite \(R\) with 1s on the diagonal, write \(R = Q\Lambda Q^\mathsf{T}\) with \(Q\) orthogonal and \(\Lambda\) the diagonal matrix of eigenvalues (the spectral theorem of the lesson on symmetric matrices), and let \(B = Q\Lambda^{1/2}Q^\mathsf{T}\), the square root \(R^{1/2}\) of the lesson on the covariance ellipse. If \(Z\) has three independent standard normal entries, \(X = BZ\) has covariance matrix \(BB^\mathsf{T} = R\), a normal vector as in the lesson on the multivariate normal.

The ellipsoid. The ellipsoid of \(R\) in stage 1 is the set of points \(R^{1/2}s\) for vectors \(s\) of length at most 1. Its half-widths along the eigenvectors are \(\sqrt{\lambda_1}\), \(\sqrt{\lambda_2}\), \(\sqrt{\lambda_3}\), so it is flat when \(\lambda_{\min} = 0\) and does not exist when \(\lambda_{\min} \lt 0\).

Names. The set of all valid triples \((\rho_{12}, \rho_{13}, \rho_{23})\) is a convex solid inside the cube \([-1, 1]^3\), sometimes called the elliptope.

1 See

Push the correlations to the edge

How the game works

Each correlation moves in steps of 0.01 from \(-1\) to 1. The tiles show the smallest eigenvalue \(\lambda_{\min}\) of \(R\) and \(\det R\) for the current values; a value written with ≈ is rounded, one without is exact. Check my matrix judges by the exact determinant: with every correlation between \(-1\) and 1, \(R\) is valid exactly when \(\det R \ge 0\), and stage 3 shows why.

There are three rounds. You can check as often as you like, and a round ends when its target is reached. After round 3 a table lists your matrices. Start over clears everything.

2 Try

Combinations that would break

A prediction and a quick guess. The explorer below them opens once both are answered.

A matrix that cannot occur

The explorer opens once both questions above are answered.

3 Prove

Why a negative determinant rules a matrix out

Theorem

Assumptions. Numbers \(a\), \(b\), \(c\) with \(-1 \lt a \lt 1\), \(-1 \le b \le 1\) and \(-1 \le c \le 1\), and the matrix \(R\) with rows \((1, a, b)\), \((a, 1, c)\) and \((b, c, 1)\), whose determinant

\[\begin{aligned} \det R &= 1 + 2abc \\ &\quad {} - a^2 - b^2 - c^2 \end{aligned}\]

is negative. In the stages, \(a = \rho_{12}\), \(b = \rho_{13}\) and \(c = \rho_{23}\).

Conclusion. Some weights \(w \ne (0, 0, 0)\), written directly in terms of \(a\), \(b\) and \(c\), give \(w^\mathsf{T}Rw \lt 0\). So no random variables \(X_1\), \(X_2\), \(X_3\) with variance 1 have the correlations \(\rho_{12} = a\), \(\rho_{13} = b\), \(\rho_{23} = c\): the combination \(w_1X_1 + w_2X_2 + w_3X_3\) would have a negative variance.

Facts the proof uses.

  • ordinary algebra of real numbers;
  • for random variables with variance 1 and these correlations, the variance of \(w_1X_1 + w_2X_2 + w_3X_3\) is \(w^\mathsf{T}Rw\) (the second idea on the Start tab), and a variance is never negative;
  • \(w^\mathsf{T}Rw = w \cdot Rw\), and the \(k\)-th entry \((Rw)_k\) of \(Rw\) is row \(k\) of \(R\) times \(w\);
  • a positive number times a negative number is negative.

Each option is one step about the numbers \(a\), \(b\), \(c\) of the theorem. Pick the one that is true for every \(a\), \(b\), \(c\) the theorem allows.

4 Apply

Problems

Each problem has hints and a full solution.

Key point To test three correlations, check that each lies between \(-1\) and 1 and that \[\begin{aligned} \det R &= 1 + 2\rho_{12}\rho_{13}\rho_{23} \\ &\quad {} - \rho_{12}^2 - \rho_{13}^2 - \rho_{23}^2 \\ &\ge 0. \end{aligned}\] Given two of them, the third must lie in the interval \[\begin{aligned} &\rho_{12}\rho_{13} \\ &\pm \sqrt{(1 - \rho_{12}^2)(1 - \rho_{13}^2)}. \end{aligned}\] When the test fails, the weights of stage 3 give a combination with a negative variance.
Level Intro Prerequisites quadratic forms, covariance and correlation, eigenvalues of a symmetric matrix (refreshed in Before you start) Time ~35 min

Further reading