σμ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
  • 日本語
  • 中文
Statistics skill›Module 3 · Models and regression›Topic 3.4·~50 minIntermediate

Multicollinearity and regularisation

Skill positionModule 3 of 4 · Topic 4 of 4
3.4 Multicollinearity and regularisation
—Lab score— / 100Total XP—Streak—

Predictors that say the same thing

When two regressors move almost together, such as a stock's momentum over 6 and over 12 months, the regression cannot tell which one deserves the credit. This is multicollinearity. The fit can stay good, but the individual coefficients become unstable: a small change in the data can swing one up and the other down, and their standard errors blow up. The variance inflation factor of regressor jjj is VIFj=11−Rj2\mathrm{VIF}_j=\dfrac{1}{1-R_j^2}VIFj​=1−Rj2​1​, where Rj2R_j^2Rj2​ comes from regressing that regressor on all the others. A VIF above 5 or 10 is a warning.

β^ridge=(XTX+λI)−1XTy,β^lasso=arg⁡min⁡ ∥y−Xβ∥2+λ∥β∥1\hat{\boldsymbol\beta}_{\text{ridge}}=(X^{T}X+\lambda I)^{-1}X^{T}\mathbf{y},\qquad \hat{\boldsymbol\beta}_{\text{lasso}}=\arg\min\ \|\mathbf{y}-X\boldsymbol\beta\|^{2}+\lambda\|\boldsymbol\beta\|_{1}β^​ridge​=(XTX+λI)−1XTy,β^​lasso​=argmin ∥y−Xβ∥2+λ∥β∥1​(1)

Regularisation fixes the instability by adding a penalty on the size of the coefficients. Ridge (L2) adds λ∥β∥2\lambda\|\boldsymbol\beta\|^2λ∥β∥2: the solution is the ordinary one with λI\lambda IλI added to XTXX^{T}XXTX, which makes the matrix well conditioned (tie this to the linear algebra skill) and shrinks every coefficient towards zero. Lasso (L1) adds λ∥β∥1\lambda\|\boldsymbol\beta\|_1λ∥β∥1​ and can set some coefficients exactly to zero, selecting predictors. Both trade a little bias for a large drop in variance, and λ\lambdaλ is chosen by cross-validation, the next topic.

Numbers for correlated predictorsIf regressing predictor jjj on the others gives Rj2=0.9R_j^2=0.9Rj2​=0.9, then VIFj=1/(1−0.9)=10\mathrm{VIF}_j=1/(1-0.9)=10VIFj​=1/(1−0.9)=10: its standard error is 10≈3.2\sqrt{10}\approx3.210​≈3.2 times larger than with uncorrelated predictors. Conversely VIF=5\mathrm{VIF}=5VIF=5 means Rj2=0.8R_j^2=0.8Rj2​=0.8. With XTX=(4334)X^{T}X=\begin{pmatrix}4&3\\3&4\end{pmatrix}XTX=(43​34​), ridge with λ=1\lambda=1λ=1 uses (5335)\begin{pmatrix}5&3\\3&5\end{pmatrix}(53​35​). In one dimension with XTX=4X^{T}X=4XTX=4, XTy=8X^{T}y=8XTy=8, OLS gives β^=2\hat\beta=2β^​=2 while ridge with λ=4\lambda=4λ=4 gives 8/(4+4)=18/(4+4)=18/(4+4)=1: the penalty halves the coefficient.
  • Multicollinearity: unstable coefficients and inflated standard errors, predictions often still fine.
  • Ridge: shrinks all coefficients, never exactly to zero. Lasso: can set coefficients to exactly zero.
  • Choose the penalty λ\lambdaλ by cross-validation, never by looking at the training fit.
Do not read a coefficient when its twin is in the modelWith two near-duplicate factors, each coefficient alone is not interpretable: a large positive and a large negative one can cancel to give a sensible sum. Judge the pair together, drop or combine one of them, or regularise. Predictions from the model can still be good, because the combination is well determined even when each part is not.

Lab · what's graded

  • A variance inflation factor15 pts
  • From VIF back to R squared10 pts
  • The ridge matrix15 pts
  • A shrunken coefficient15 pts
  • Which penalty selects variables15 pts
  • What collinearity does15 pts
  • Why ridge helps15 pts
0/ 7 answered
Tasks
1Numeric answer15 ptsNot answered

Regressing one predictor on all the others gives R squared = 0.9. What is its VIF?

VIF=VIF =VIF=accepted: ± 0.001
2Numeric answer10 ptsNot answered

A predictor has VIF = 5. What is the R squared of its regression on the other predictors?

R2=R^2 =R2=accepted: ± 0.001
3Matrix · vector15 ptsNot answered

Let XTX=(4334)X^{T}X=\begin{pmatrix}4&3\\3&4\end{pmatrix}XTX=(43​34​). Fill in XTX+λIX^{T}X+\lambda IXTX+λI for λ=1\lambda=1λ=1.

XTX+I=X^T X + I =XTX+I=
4Numeric answer15 ptsNot answered

With one regressor, X^T X = 4 and X^T y = 8. OLS gives 2. What does ridge give with lambda = 4, using X^T y / (X^T X + lambda)?

beta=beta =beta=accepted: ± 0.001
5Choice15 ptsNot answered

Which penalty can set some coefficients exactly to zero?

6Choice15 ptsNot answered

Select every effect of strong multicollinearity.

7Explain in words15 ptsNot answered

In two sentences, say why ridge regression helps when predictors are strongly correlated.

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