Does cleaning the matrix pay?
The minimum-variance portfolio takes a covariance matrix Σ and returns the fully invested weights with the smallest variance, w=Σ⁻¹ 1 / ( 1ᵀΣ⁻¹ 1). It looks like pure mathematics, yet it is the sharpest test of a covariance estimator, because it exploits every error in the matrix. This capstone puts the whole skill to that test. You estimate Σ from the last 63 trading days, build the portfolio, hold it for the next 21 days, then roll forward, and measure the volatility of the portfolio you would really have held. Three estimators compete: the plain sample covariance, the eigenvalue-clipped one and the Ledoit-Wolf shrunk one.
Never invert the matrix: solve the linear system Σ x= 1 and divide by the sum, which is faster and more accurate. The honest part is the timing. The weights for a block of days must use only the days before it, and the result is the volatility of the joined out-of-sample returns, not the variance the optimiser promised. For clipping you work on the correlation matrix, replace the eigenvalues that are not above λ₊ by their mean, rebuild, rescale the diagonal to 1 and multiply back by the volatilities. For shrinkage you compute the intensity from the formula in the starter file, exactly as in the previous lesson, with S divided by T.
- Weights: solve Σ x= 1 and divide by the sum; never invert the matrix.
- Clipping and shrinkage: noise eigenvalues to their mean; or a blend with μI with a computed intensity.
- Backtest: estimate on the last
windowdays, hold forstepdays, roll on, and measure the joined out-of-sample volatility.
Lab · what's graded
- Eigenvalue clipping25 pts
- Ledoit-Wolf shrinkage25 pts
- Minimum-variance weights10 pts
- A rolling backtest20 pts
- Comparing the estimators20 pts