Linear Algebra

Lesson 10 of 11

SVD, QR, Cholesky and Positive Definiteness

Positive definite matrices and why covariance matrices are PSD, Cholesky for simulating correlated normals, QR for stable least squares, and the SVD as rotate, stretch, rotate.

Positive definite matrices

A symmetric matrix AA turns a vector into a single number through its quadratic form xTAx\mathbf{x}^T A\mathbf{x}. Call AA positive definite (PD) if xTAx>0\mathbf{x}^T A\mathbf{x} > 0 for every nonzero x\mathbf{x}, and positive semidefinite (PSD) if xTAx≥0\mathbf{x}^T A\mathbf{x} \ge 0. Picture the surface z=xTAxz = \mathbf{x}^T A\mathbf{x}: a bowl for PD, a bowl with a flat valley for PSD but singular, and a saddle when AA has eigenvalues of both signs.

For a symmetric matrix there are two quick tests. It is PD exactly when every eigenvalue is positive, and exactly when every leading principal minor (the determinants of the top-left 1×11\times1, 2×22\times2, up to n×nn\times n blocks) is positive. For A=(4223)A = \begin{pmatrix} 4 & 2 \\ 2 & 3 \end{pmatrix} the minors are 44 and 12−4=812 - 4 = 8, so AA is PD. The leading-minor shortcut only certifies strict PD; for PSD you must check every principal minor.

Quants care because every covariance matrix is PSD. For any weight vector w\mathbf{w},

wTΣ w=Var(wTX)≥0\mathbf{w}^T \Sigma\, \mathbf{w} = \text{Var}(\mathbf{w}^T X) \ge 0

since no portfolio has negative variance. Σ\Sigma is strictly PD unless some nonzero portfolio has zero variance, which happens exactly when one asset's return is a fixed linear combination of the others plus a constant.

Interview version: can three assets have ρ12=0.9\rho_{12} = 0.9, ρ13=0.9\rho_{13} = 0.9, ρ23=−0.5\rho_{23} = -0.5? Each number is a legal correlation, but the determinant of the correlation matrix is

1(1−0.25)−0.9(0.9+0.45)+0.9(−0.45−0.9)=−1.68<01(1 - 0.25) - 0.9(0.9 + 0.45) + 0.9(-0.45 - 0.9) = -1.68 < 0

so some eigenvalue is negative and some portfolio would have negative variance. The angle picture from Vectors and Dot Products says the same thing: assets 2 and 3 both sit close to asset 1, so ρ23≥2(0.9)2−1=0.62\rho_{23} \ge 2(0.9)^2 - 1 = 0.62.