σμ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.1·~55 minAdvanced

Sample covariance and its noise

Skill positionModule 4 of 5 · Topic 1 of 3
4.1 Sample covariance and its noise
—Lab score— / 100Total XP—Streak—

An unbiased estimate that is still wrong

The sample covariance matrix S=1T−1XcTXcS=\frac1{T-1}X_c^{T}X_cS=T−11​XcT​Xc​ is unbiased: on average over many samples it equals the true Σ\SigmaΣ. That sounds reassuring and is misleading. A portfolio of NNN assets has N(N+1)/2N(N+1)/2N(N+1)/2 covariance parameters, which for N=100N=100N=100 is 5,050, and you estimate them from TTT observations of NNN returns. When NNN is not small compared with TTT, every entry is noisy and, worse, the eigenvalues of SSS are systematically spread out: the large ones too large, the small ones too small, even if the truth has all eigenvalues equal.

q=NT,λ±=σ2(1±q)2,VrealVprom≈1(1−q)2q=\frac{N}{T},\qquad \lambda_{\pm}=\sigma^{2}\big(1\pm\sqrt{q}\big)^{2},\qquad \frac{V_{\mathrm{real}}}{V_{\mathrm{prom}}}\approx\frac{1}{(1-q)^{2}}q=TN​,λ±​=σ2(1±q​)2,Vprom​Vreal​​≈(1−q)21​(1)

If the true covariance is the identity (σ2=1\sigma^2=1σ2=1, all eigenvalues 1) and N,TN,TN,T are large, the eigenvalues of SSS fill the interval [λ−,λ+][\lambda_-,\lambda_+][λ−​,λ+​] of the first formula, the Marchenko-Pastur edges. With q=0.25q=0.25q=0.25 that is [0.25,2.25][0.25,2.25][0.25,2.25], a spread of nine to one where the truth has none. When N>T−1N>T-1N>T−1, SSS has rank at most T−1T-1T−1, so it is singular and has zero eigenvalues. A minimum-variance optimiser is the worst victim: it loads up on the directions in which SSS shows the least variance, which are exactly the directions where SSS underestimates risk most. Simulations with Σ=I\Sigma=IΣ=I show that the realised variance of the sample minimum-variance portfolio is about 1/(1−q)21/(1-q)^21/(1−q)2 times the variance it promised in-sample, and 1/(1−q)1/(1-q)1/(1−q) times the true minimum.

Five hundred stocks, two yearsEstimate the covariance of N=500N=500N=500 stocks from two years of daily data, T=504T=504T=504. Then q=500/504≈0.99q=500/504\approx0.99q=500/504≈0.99, and the Marchenko-Pastur edges for a unit truth are λ−=(1−0.996)2≈0.00002\lambda_-=(1-0.996)^2\approx0.00002λ−​=(1−0.996)2≈0.00002 and λ+=(1+0.996)2≈3.98\lambda_+=(1+0.996)^2\approx3.98λ+​=(1+0.996)2≈3.98: the smallest eigenvalues are essentially zero, so SSS is almost singular and its inverse is dominated by noise. The matrix has 500×501/2=125,250500\times501/2=125{,}250500×501/2=125,250 distinct entries but only 504×500504\times500504×500 numbers behind them. By contrast, the twelve stocks of the capstone with 4,184 days have q=0.003q=0.003q=0.003, so the edges are about 0.890.890.89 and 1.111.111.11 and noise is a small issue there.
  • Unbiased but noisy: E[S]=ΣE[S]=\SigmaE[S]=Σ, yet for large q=N/Tq=N/Tq=N/T the eigenvalues of SSS are spread out.
  • Edges: for a unit truth the sample eigenvalues lie in [(1−q)2,(1+q)2][(1-\sqrt q)^2,(1+\sqrt q)^2][(1−q​)2,(1+q​)2].
  • Rank: for N>T−1N>T-1N>T−1 the sample covariance is singular; an optimiser exploits its smallest eigenvalues.
Optimisers are error maximisersA portfolio optimiser reads the covariance matrix as truth and concentrates where the matrix says risk is cheapest. Estimation errors are therefore not averaged out; they are selected for. The cures in the next lessons all shrink or clean the eigenvalues, because that is where the damage sits, and they are judged the only honest way: by the variance of the portfolio on data the estimator never saw.

Lab · what's graded

  • The upper edge15 pts
  • The lower edge10 pts
  • Counting parameters10 pts
  • The maximum rank10 pts
  • Realised versus promised variance15 pts
  • Why optimisers amplify the noise20 pts
  • Reducing the noise20 pts
0/ 7 answered
Tasks
1Numeric answer15 ptsNot answered

With a true covariance equal to the identity and q = N/T = 0.25, what is the upper Marchenko-Pastur edge (1+q)2(1+\sqrt q)^2(1+q​)2?

lambda+=lambda_+ =lambda+​=accepted: ± 0.01
2Numeric answer10 ptsNot answered

For the same q = 0.25, what is the lower edge (1−q)2(1-\sqrt q)^2(1−q​)2?

lambda−=lambda_- =lambda−​=accepted: ± 0.005
3Numeric answer10 ptsNot answered

How many distinct entries does the covariance matrix of N = 100 assets have, N(N+1)/2N(N+1)/2N(N+1)/2?

entries=entries =entries=accepted: ± 0.5
4Numeric answer10 ptsNot answered

A sample covariance matrix of N = 50 assets is built from T = 30 daily observations. What is the largest possible rank, T−1T-1T−1?

rank=rank =rank=accepted: ± 0.01
5Numeric answer15 ptsNot answered

For a unit true covariance and q = 0.2, the realised variance of the sample minimum-variance portfolio is about 1/(1−q)21/(1-q)^21/(1−q)2 times the variance promised in-sample. What is that factor? Give it to two decimals.

factor=factor =factor=accepted: ± 0.01
6Choice20 ptsNot answered

Why does a minimum-variance optimiser do so badly with a noisy sample covariance matrix?

7Explain in words20 ptsNot answered

In one or two sentences, say two ways to make a sample covariance matrix less noisy.

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