Skip to content
  • Overview
  • Curriculum
    • FLUMental maths and numerical fluency
    • COMBCounting and combinatorics
    • PROBProbability
    • STATStatistics and inference
    • REGRegression and econometrics
    • TSTime series
    • LALinear algebra
      • 1Vectors and matrices

        • Rank, trace and determinant: what each one measures
      • 2Linear systems and spaces

        • The four fundamental subspaces, and when Ax = b has a solution
      • 3Orthogonality and projection

        • Orthogonality, QR and OLS as a projection
      • 4Eigenvalues and eigenvectors

        • Eigenvalues, diagonalisation and the spectral theorem
      • 5Definiteness and covariance

        • Definiteness, Cholesky and generating correlated normals
      • 6SVD and dimensionality reduction

        • PCA, covariance matrices and what an eigenvalue is telling you
      • 7Matrix calculus

        • Matrix calculus: the identities behind OLS, ridge and portfolios
    • SCStochastic calculus
    • MLMachine learning
    • SIGAlpha and signal research
    • CASEResearch case studies

Practise

  • Question bank
  • Mental arithmetic
  • Market simulator
  • Arbitrage trees
  • Horse racing
  • Bid book
  • Screening tests
  • Mock papers

Reference

  • Formula reference
  • Search

Your record

  • Review queue
  • Progress
  • Leaderboard
  • Profile
  • Invite friends
AccountSend feedback
  1. Curriculum
  2. /Quantitative research
  3. /Linear algebra
  4. /Definiteness and covariance

Definiteness, Cholesky and generating correlated normals

LA · Chapter 5·12 min read·Asked at Two Sigma, Citadel, Optiver, Akuna

Assumes Eigenvalues, diagonalisation and the spectral theorem.

After this lesson you should be able to

  • Test a matrix for positive semi-definiteness three ways.
  • Use a Cholesky factor to simulate correlated normals.
  • Repair a correlation matrix that is not positive semi-definite.

Positive semi-definiteness is the condition that makes a matrix a legitimate covariance matrix, and the Cholesky factorisation is the practical consequence: it is how you turn independent random numbers into correlated ones, and how you solve a linear system in half the time.

TestStatementCost
Quadratic formx⊤Ax≥0x^\top A x \ge 0x⊤Ax≥0 for all xxxA definition, not a procedure
EigenvaluesAll λi≥0\lambda_i \ge 0λi​≥0O(n3)O(n^3)O(n3), and gives the most information
CholeskyA factorisation A=LL⊤A = LL^\topA=LL⊤ existsO(n3/3)O(n^3/3)O(n3/3), the fastest test in practice
Table 5.1 · Three equivalent tests. Attempting a Cholesky is the standard check: if the factorisation fails partway through, the matrix is not positive definite, and you learn it quickly.

Equation 5.2

The Cholesky factorisation

A "square root" of a symmetric positive-definite matrix. Unique, cheap, and the workhorse of simulation and of solving normal equations.

Σ=LL⊤,L lower triangular with positive diagonal\Sigma = LL^\top, \qquad L \text{ lower triangular with positive diagonal}Σ=LL⊤,L lower triangular with positive diagonal
LLL
Lower triangular, so systems involving it solve by substitution in O(n2)O(n^2)O(n2).
Cov(Lz)\mathrm{Cov}(Lz)Cov(Lz)
Equals LL⊤=ΣLL^\top = \SigmaLL⊤=Σ when zzz has identity covariance.

Derivation 5.3

Generating correlated normals

The one-line application, and it is asked constantly.

  1. z∼N(0,In)z \sim N(0, I_n)z∼N(0,In​)

    Draw independent standard normals.

  2. x=μ+Lzx = \mu + Lzx=μ+Lz

    Apply the Cholesky factor.

  3. Cov(x)=L Cov(z) L⊤=LL⊤=Σ\mathrm{Cov}(x) = L\,\mathrm{Cov}(z)\,L^\top = LL^\top = \SigmaCov(x)=LCov(z)L⊤=LL⊤=Σ
x∼N(μ,Σ)x \sim N(\mu, \Sigma)x∼N(μ,Σ)
Weight on z₁0.6Weight on z₂0.8
Figure 5.4 · What Cholesky actually gives you. For a correlation of 0.60.60.6, the second variable is 0.6z1+0.8z20.6 z_1 + 0.8 z_20.6z1​+0.8z2​. The weights are a right angle — 0.62+0.82=10.6^2 + 0.8^2 = 10.62+0.82=1 — which is what keeps the variance at one while the correlation comes out exactly as asked.

Example 5.5

Give the Cholesky factor of the 2×22\times 22×2 correlation matrix with ρ=0.6\rho = 0.6ρ=0.6, and the recipe for two correlated standard normals.

Show the worked solutionHide the worked solution

Worked solution

  1. Formula
    L=(10ρ1−ρ2)L = \begin{pmatrix}1 & 0 \\ \rho & \sqrt{1-\rho^2}\end{pmatrix}L=(1ρ​01−ρ2​​)
  2. Substitute
    ρ=0.6⇒1−0.36=0.8\rho = 0.6 \Rightarrow \sqrt{1 - 0.36} = 0.8ρ=0.6⇒1−0.36​=0.8
  3. Solve
    x1=z1x_1 = z_1x1​=z1​
  4. x2=0.6z1+0.8z2x_2 = 0.6z_1 + 0.8z_2x2​=0.6z1​+0.8z2​
  5. Answer
    x2=ρz1+1−ρ2 z2x_2 = \rho z_1 + \sqrt{1-\rho^2}\,z_2x2​=ρz1​+1−ρ2​z2​

Sanity check. Check the variance: 0.62+0.82=10.6^2 + 0.8^2 = 10.62+0.82=1, so x2x_2x2​ is standard. And Cov(x1,x2)=0.6\mathrm{Cov}(x_1,x_2) = 0.6Cov(x1​,x2​)=0.6 as required. The two-variable case is worth memorising because it comes up constantly and needs no matrix algebra.

The rest of this lesson is in Premium

You have read the opening. 9 more sections follow, including 3 worked examples and 3 quick checks.

Start the free 7-day trialSign in

Nothing is charged for 7 days, and you can cancel before then. Or read The law of large numbers and the central limit theorem in full, free.

← Eigenvalues, diagonalisation and the spectral theoremPCA, covariance matrices and what an eigenvalue is telling you →
On this page
  • Three equivalent tests
  • The Cholesky factorisation
  • Generating correlated normals
  • What Cholesky actually gives you
  • Worked example

QuantMax · 141 lessons · 1342 questions · c5c0caa

  • Premium
  • Arbitrage trees
  • Horse racing
  • Invite friends
  • Account
  • About QuantMax
  • Terms
  • Privacy

Firm names identify publicly reported question patterns and nothing more. QuantMax is not affiliated with, endorsed by, or recruiting for any firm named in the curriculum. Everything you do in lessons and the question bank is kept to your account.