σμ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 2 · SVD and low rank›Topic 2.2·~50 minIntermediate

Low-rank approximation

Skill positionModule 2 of 5 · Topic 2 of 2
2.2 Low-rank approximation
—Lab score— / 100Total XP—Streak—

Keeping the part of a matrix that matters

The SVD writes a matrix as a sum of rank-one layers, A=∑iσiuiviTA=\sum_i\sigma_i\mathbf u_i\mathbf v_i^{T}A=∑i​σi​ui​viT​, ordered from the biggest layer to the smallest. Keeping only the first kkk layers gives Ak=UkΣkVkTA_k=U_k\Sigma_kV_k^{T}Ak​=Uk​Σk​VkT​, a matrix of rank kkk. The Eckart-Young theorem says this truncation is the best rank-kkk approximation there is, whether error is measured by the Frobenius norm or by the spectral norm. No clever choice of kkk directions can beat the top kkk singular directions.

Ak=∑i=1kσiuiviT,∥A−Ak∥F=∑i>kσi2,∥A−Ak∥2=σk+1A_k=\sum_{i=1}^{k}\sigma_i\mathbf u_i\mathbf v_i^{T},\qquad \lVert A-A_k\rVert_F=\sqrt{\sum_{i>k}\sigma_i^{2}},\qquad \lVert A-A_k\rVert_2=\sigma_{k+1}Ak​=i=1∑k​σi​ui​viT​,∥A−Ak​∥F​=i>k∑​σi2​​,∥A−Ak​∥2​=σk+1​(1)

The error is exactly the discarded singular values, so the share of squared size you keep is ∑i≤kσi2/∑iσi2\sum_{i\le k}\sigma_i^2\big/\sum_i\sigma_i^2∑i≤k​σi2​/∑i​σi2​, often called the explained variance when AAA is centred data. A rank-kkk approximation of an m×nm\times nm×n matrix needs only k(m+n+1)k(m+n+1)k(m+n+1) numbers instead of mnmnmn, which is why low rank is also compression. In finance, the layers with small σi\sigma_iσi​ are mostly sampling noise, so truncating them is denoising, and the number to keep is usually chosen by a threshold on the kept share or by a gap in the singular values.

Singular values 10, 6, 3, 1Suppose a matrix has singular values 10, 6, 3, 1. Their squares are 100, 36, 9, 1, summing to 146. The best rank-2 approximation keeps 100+36=136100+36=136100+36=136 of the 146, which is 93.2%93.2\%93.2%, and its Frobenius error is 9+1=10≈3.16\sqrt{9+1}=\sqrt{10}\approx3.169+1​=10​≈3.16; its spectral error is σ3=3\sigma_3=3σ3​=3. The best rank-1 approximation has spectral error σ2=6\sigma_2=6σ2​=6. For a 1000×2501000\times2501000×250 matrix, rank 5 needs 5×(1000+250+1)=62555\times(1000+250+1)=62555×(1000+250+1)=6255 numbers instead of 250,000.
  • Eckart-Young: truncating the SVD at kkk terms is the best rank-kkk approximation in both norms.
  • Error: Frobenius ∑i>kσi2\sqrt{\sum_{i>k}\sigma_i^2}∑i>k​σi2​​, spectral σk+1\sigma_{k+1}σk+1​.
  • Storage: k(m+n+1)k(m+n+1)k(m+n+1) numbers instead of mnmnmn.
Choosing k is a judgementNo rule is free of assumptions. A fixed share such as 90%90\%90% is simple but arbitrary, a visible gap in the singular values is natural when there is one, and in the covariance setting later in this skill the Marchenko-Pastur edge gives a principled cut-off between signal and noise. Whatever you use, check the choice out of sample: a rank that explains the training data best is not the one that predicts new data best.

Lab · what's graded

  • The Frobenius error15 pts
  • The share kept15 pts
  • A rank-one approximation15 pts
  • Storage of a low-rank matrix10 pts
  • The Eckart-Young theorem15 pts
  • Compressing a matrix15 pts
  • Why truncation denoises15 pts
0/ 7 answered
Tasks
1Numeric answer15 ptsNot answered

A matrix has singular values 10, 6, 3 and 1. What is the Frobenius error of its best rank-2 approximation? Give it to two decimals.

error=error =error=accepted: ± 0.02
2Numeric answer15 ptsNot answered

For the same matrix, what percentage of the squared Frobenius norm does the rank-2 approximation keep? Give it to one decimal.

kept=kept =kept=accepted: ± 0.1
3Matrix · vector15 ptsNot answered

The symmetric matrix A=(2112)A=\begin{pmatrix}2&1\\1&2\end{pmatrix}A=(21​12​) has singular values 3 and 1 with leading direction u=v=(1,1)/2\mathbf u=\mathbf v=(1,1)/\sqrt2u=v=(1,1)/2​. Compute its best rank-one approximation A1=3 uvTA_1=3\,\mathbf u\mathbf v^{T}A1​=3uvT.

A1=A_1 =A1​=
4Numeric answer10 ptsNot answered

A 1000×2501000\times2501000×250 matrix is approximated at rank 5 by UkU_kUk​, Σk\Sigma_kΣk​ and VkV_kVk​. How many numbers must be stored, using k(m+n+1)k(m+n+1)k(m+n+1)?

numbers=numbers =numbers=accepted: ± 0.5
5Choice15 ptsNot answered

What does the Eckart-Young theorem state?

6Order the steps15 ptsNot answered

Put the steps of a low-rank approximation in order.

Drag to reorder, or focus an item, press Space to lift it, the arrow keys to move it and Space to drop it.

  1. 1Measure the error or the share of variance kept
  2. 2Choose kkk from the singular values
  3. 3Compute the SVD of the matrix
  4. 4Rebuild Ak=UkΣkVkTA_k=U_k\Sigma_kV_k^{T}Ak​=Uk​Σk​VkT​ from the top kkk terms
7Explain in words15 ptsNot answered

In one or two sentences, say why dropping the small singular values of a returns matrix can remove noise.

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