σμ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
  • 日本語
  • 中文
Matrix Decompositions skill›Module 4 · Estimating covariance›Topic 4.3·~55 minAdvanced

Ledoit-Wolf shrinkage

Skill positionModule 4 of 5 · Topic 3 of 3
4.3 Ledoit-Wolf shrinkage
—Lab score— / 100Total XP—Streak—

Pulling an estimate toward something simple

Clipping decides eigenvalue by eigenvalue whether it is signal. Shrinkage takes a smoother route: blend the noisy sample matrix SSS with a simple, well-conditioned target FFF, Σ∗=(1−δ)S+δF\Sigma^{*}=(1-\delta)S+\delta FΣ∗=(1−δ)S+δF, where the intensity δ∈[0,1]\delta\in[0,1]δ∈[0,1] says how much to trust the target. The classic target is a scaled identity F=μIF=\mu IF=μI with μ=tr⁡(S)/N\mu=\operatorname{tr}(S)/Nμ=tr(S)/N, the average variance: it says all assets have the same variance and are uncorrelated. That is surely wrong, but it is stable, and a little of it cancels a lot of noise.

Σ∗=(1−δ)S+δμI,μ=tr⁡SN,δ=min⁡ ⁣(1,b2d2),d2=∥S−μI∥F2N\Sigma^{*}=(1-\delta)S+\delta\mu I,\qquad \mu=\frac{\operatorname{tr}S}{N},\qquad \delta=\min\!\Big(1,\frac{b^{2}}{d^{2}}\Big),\qquad d^{2}=\frac{\lVert S-\mu I\rVert_F^{2}}{N}Σ∗=(1−δ)S+δμI,μ=NtrS​,δ=min(1,d2b2​),d2=N∥S−μI∥F2​​(1)

The intensity is not a free parameter. Ledoit and Wolf showed that the best δ\deltaδ for this target has a closed form: the numerator b2b^2b2 measures how noisy SSS is (the average squared distance of the single-day matrices xtxtT\mathbf x_t\mathbf x_t^{T}xt​xtT​ from SSS, divided by TTT, and capped at d2d^2d2) and the denominator d2d^2d2 measures how far SSS is from the target. A noisy SSS close to its target gets a large δ\deltaδ. Shrinkage has three tidy properties: it keeps the trace, it moves every eigenvalue toward the mean (λ↦(1−δ)λ+δμ\lambda\mapsto(1-\delta)\lambda+\delta\muλ↦(1−δ)λ+δμ) so large ones shrink and small ones grow, and it makes Σ∗\Sigma^{*}Σ∗ positive definite for any δ>0\delta>0δ>0, even when SSS is singular. As TTT grows the noise term falls and δ→0\delta\to0δ→0.

A 2 by 2 exampleTake S=(4112)S=\begin{pmatrix}4&1\\1&2\end{pmatrix}S=(41​12​), so μ=(4+2)/2=3\mu=(4+2)/2=3μ=(4+2)/2=3 and S−μI=(111−1)S-\mu I=\begin{pmatrix}1&1\\1&-1\end{pmatrix}S−μI=(11​1−1​) with squared Frobenius norm 4, hence d2=4/2=2d^2=4/2=2d2=4/2=2. If the noise term is b2=0.5b^2=0.5b2=0.5, the intensity is δ=0.5/2=0.25\delta=0.5/2=0.25δ=0.5/2=0.25. With δ=0.2\delta=0.2δ=0.2 instead, Σ∗=0.8S+0.2⋅3I=(3.80.80.82.2)\Sigma^{*}=0.8S+0.2\cdot3I=\begin{pmatrix}3.8&0.8\\0.8&2.2\end{pmatrix}Σ∗=0.8S+0.2⋅3I=(3.80.8​0.82.2​). The eigenvalues of SSS are 3±2=4.4143\pm\sqrt2=4.4143±2​=4.414 and 1.5861.5861.586; those of Σ∗\Sigma^{*}Σ∗ are 0.8(4.414)+0.6=4.1310.8(4.414)+0.6=4.1310.8(4.414)+0.6=4.131 and 0.8(1.586)+0.6=1.8690.8(1.586)+0.6=1.8690.8(1.586)+0.6=1.869. The condition number improves from 2.782.782.78 to 2.212.212.21.
  • Blend: Σ∗=(1−δ)S+δF\Sigma^{*}=(1-\delta)S+\delta FΣ∗=(1−δ)S+δF with the target F=μIF=\mu IF=μI, μ=tr⁡S/N\mu=\operatorname{tr}S/Nμ=trS/N.
  • Intensity: δ=min⁡(1,b2/d2)\delta=\min(1,b^2/d^2)δ=min(1,b2/d2); noisy matrices close to the target get more shrinkage.
  • Effects: trace kept, eigenvalues pulled to the mean, positive definite for any δ>0\delta>0δ>0; δ→0\delta\to0δ→0 as TTT grows.
Bias on purposeShrinkage deliberately adds bias, because the target is wrong, in return for a large cut in variance. The expected squared error of the estimate falls, and for covariance estimation with many assets the trade is usually very favourable. It is the same bias-variance bargain as ridge regression, and it is the reason Ledoit-Wolf is the default covariance estimator in many libraries.

Lab · what's graded

  • The target level10 pts
  • A shrunk matrix20 pts
  • The intensity15 pts
  • A shrunk eigenvalue15 pts
  • The new condition number15 pts
  • More data, less shrinkage15 pts
  • The bias-variance trade10 pts
0/ 7 answered
Tasks
1Numeric answer10 ptsNot answered

For S=(4112)S=\begin{pmatrix}4&1\\1&2\end{pmatrix}S=(41​12​) the target is μI\mu IμI with μ=tr⁡S/N\mu=\operatorname{tr}S/Nμ=trS/N. What is μ\muμ?

mu=mu =mu=accepted: ± 0.01
2Matrix · vector20 ptsNot answered

With δ=0.2\delta=0.2δ=0.2 and the target 3I3I3I, compute Σ∗=0.8S+0.2⋅3I\Sigma^{*}=0.8S+0.2\cdot3IΣ∗=0.8S+0.2⋅3I for S=(4112)S=\begin{pmatrix}4&1\\1&2\end{pmatrix}S=(41​12​).

Σ∗=\Sigma^{*} =Σ∗=
3Numeric answer15 ptsNot answered

With noise term b2=0.5b^2=0.5b2=0.5 and distance d2=2d^2=2d2=2, what is the Ledoit-Wolf intensity δ=min⁡(1,b2/d2)\delta=\min(1,b^2/d^2)δ=min(1,b2/d2)?

delta=delta =delta=accepted: ± 0.005
4Numeric answer15 ptsNot answered

The largest eigenvalue of SSS is 3+2≈4.4143+\sqrt2\approx4.4143+2​≈4.414. With δ=0.2\delta=0.2δ=0.2 and μ=3\mu=3μ=3, what is the largest eigenvalue of Σ∗\Sigma^{*}Σ∗, using (1−δ)λ+δμ(1-\delta)\lambda+\delta\mu(1−δ)λ+δμ? Give it to three decimals.

lambdamax=lambda_max =lambdam​ax=accepted: ± 0.005
5Numeric answer15 ptsNot answered

The shrunk matrix has eigenvalues 4.131 and 1.869. What is its condition number (largest over smallest)? Give it to two decimals.

kappa=kappa =kappa=accepted: ± 0.01
6Choice15 ptsNot answered

With N fixed, what happens to the optimal Ledoit-Wolf intensity as T, the number of observations, grows?

7Explain in words10 ptsNot answered

In one or two sentences, say why shrinking toward a wrong target can still improve a covariance estimate.

Math modeKeyboard or LaTeX inputTask 1 of 7 · 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