σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
Linear Algebra skill›Module 4 · Least squares and factorizations›Topic 4.3·~50 minIntermediate

Cholesky and positive-definite matrices

Skill positionModule 4 of 4 · Topic 3 of 4
4.3 Cholesky and positive-definite matrices
—Lab score— / 100Total XP—Streak—

Square roots for matrices

A symmetric matrix AAA is positive definite when xTAx>0\mathbf{x}^{T}A\mathbf{x}>0xTAx>0 for every x≠0\mathbf{x}\neq\mathbf{0}x=0; equivalently, all its eigenvalues are positive. Covariance matrices are always positive semidefinite, because wTΣw\mathbf{w}^{T}\Sigma\mathbf{w}wTΣw is the variance of a portfolio and variances cannot be negative. They are positive definite, with every portfolio having strictly positive variance, exactly when no asset is redundant.

A=LLT,Ljj=Ajj−∑k<jLjk2,Lij=Aij−∑k<jLikLjkLjj (i>j)A=LL^{T},\qquad L_{jj}=\sqrt{A_{jj}-\sum_{k<j}L_{jk}^{2}},\qquad L_{ij}=\frac{A_{ij}-\sum_{k<j}L_{ik}L_{jk}}{L_{jj}}\ (i>j)A=LLT,Ljj​=Ajj​−k<j∑​Ljk2​​,Lij​=Ljj​Aij​−∑k<j​Lik​Ljk​​ (i>j)(1)

Every positive definite matrix has a Cholesky factorisation A=LLTA=LL^{T}A=LLT with LLL lower triangular and a positive diagonal: the matrix analogue of a square root. It uses the symmetry, so it costs about 13n3\tfrac13n^331​n3, half of LU, and it needs no pivoting. If the algorithm meets a negative number under a square root, the matrix is not positive definite, which makes Cholesky a cheap test of that property.

A factor and a simulationFor A=(4225)A=\begin{pmatrix}4&2\\2&5\end{pmatrix}A=(42​25​): L11=4=2L_{11}=\sqrt4=2L11​=4​=2, L21=2/2=1L_{21}=2/2=1L21​=2/2=1, L22=5−12=2L_{22}=\sqrt{5-1^2}=2L22​=5−12​=2, so L=(2012)L=\begin{pmatrix}2&0\\1&2\end{pmatrix}L=(21​02​) and LLT=(4225)LL^{T}=\begin{pmatrix}4&2\\2&5\end{pmatrix}LLT=(42​25​). To simulate two returns with correlation 0.60.60.6 and unit variances, factor Σ=(10.60.61)\Sigma=\begin{pmatrix}1&0.6\\0.6&1\end{pmatrix}Σ=(10.6​0.61​) into L=(100.60.8)L=\begin{pmatrix}1&0\\0.6&0.8\end{pmatrix}L=(10.6​00.8​) and set x=Lz\mathbf{x}=L\mathbf{z}x=Lz with z\mathbf{z}z independent standard normals: then Cov⁡(x)=LLT=Σ\operatorname{Cov}(\mathbf{x})=LL^{T}=\SigmaCov(x)=LLT=Σ.
  • Positive definite: xTAx>0\mathbf{x}^{T}A\mathbf{x}>0xTAx>0 for all x≠0\mathbf{x}\neq\mathbf{0}x=0; all eigenvalues positive.
  • Cholesky: A=LLTA=LL^{T}A=LLT, half the cost of LU, no pivoting, and a cheap positive-definiteness test.
  • Correlated draws: x=Lz\mathbf{x}=L\mathbf{z}x=Lz turns independent normals z\mathbf{z}z into returns with covariance Σ\SigmaΣ.
A sample covariance can fail to factorIf you estimate a covariance matrix from fewer observations than assets, or two assets have identical returns, the sample matrix is only semidefinite and Cholesky stops on a zero or slightly negative pivot. Remedies are more data, dropping duplicates, shrinkage towards a well-behaved target, or adding a small multiple of the identity to the diagonal.

Lab · what's graded

  • Factor a matrix20 pts
  • Factor a correlation matrix20 pts
  • A correlated draw15 pts
  • Which matrix is positive definite15 pts
  • When Cholesky fails10 pts
  • Simulating correlated returns20 pts
0/ 6 answered
Tasks
1Matrix · vector20 ptsNot answered

Fill in the Cholesky factor LLL of A=(9335)A=\begin{pmatrix}9&3\\3&5\end{pmatrix}A=(93​35​) (lower triangular, positive diagonal).

L=L =L=
2Matrix · vector20 ptsNot answered

Fill in the Cholesky factor of the correlation matrix (10.50.51)\begin{pmatrix}1&0.5\\0.5&1\end{pmatrix}(10.5​0.51​) (decimals are fine, three digits).

L=L =L=
3Numeric answer15 ptsNot answered

With Σ=(10.60.61)\Sigma=\begin{pmatrix}1&0.6\\0.6&1\end{pmatrix}Σ=(10.6​0.61​) and L=(100.60.8)L=\begin{pmatrix}1&0\\0.6&0.8\end{pmatrix}L=(10.6​00.8​), the independent draw z=(1,2)\mathbf{z}=(1,2)z=(1,2) gives x=Lz\mathbf{x}=L\mathbf{z}x=Lz. What is x2x_2x2​?

x2=x_2 =x2​=accepted: ± 0.001
4Choice15 ptsNot answered

Which of these symmetric matrices is positive definite?

5Choice10 ptsNot answered

Cholesky fails on a sample covariance matrix. Select every likely cause.

6Explain in words20 ptsNot answered

In two sentences, say how the Cholesky factor of a covariance matrix is used to simulate correlated returns.

Math modeKeyboard or LaTeX inputTask 1 of 6 · Ctrl ⏎ to check

Log in to run your code.

Every lecture is free to read. Create an account or log in to run code, run tests and submit this lab.

  • In-browser IDE with a bash terminal — nothing to install
  • Instant grading, XP and your place on the skill
Create an accountLog in
OR
Continue with GitHub