How much of a mean variance portfolio is signal, and how much is estimation error? This notebook answers that on the 11 SPDR sector ETFs from June 2018 to September 2026, with SPY as the market factor and a passive benchmark.
- A cached, reproducible data pipeline for adjusted daily prices
- Simulation, bootstrap and rolling window studies of how badly μ and Σ are estimated
- Sensitivity of optimal weights to γ, μ, correlations and volatility
- A static backtest with rebalancing frequency and transaction costs
- A walk forward backtest with a rolling three year window, monthly rebalancing, costs and fees
- Minimum variance and risk parity as benchmarks that ignore μ
Constrained mean variance returned a Sharpe of 0.557 out of sample over 5.2 years. Equal weight returned 0.766 and SPY returned 0.812. Risk parity, which estimates almost nothing, beat mean variance on every metric. The estimates subtracted value.
pip install -r requirements.txt
jupyter notebook mean_variance_estimation_risk.ipynb
Restart the kernel and Run All. The price panel ships in data/prices.csv and is frozen at September 4, 2026, so every number in the notebook reproduces exactly with no network call.