Portfolio Optimization
Portfolio theory tells you the efficient frontier exists. Portfolio optimization is the messy, error-prone business of actually computing the weights — and surviving the fact that your inputs are guesses.
From theory to weights — the mechanics of mean-variance optimization, the covariance matrix and its conditioning, why optimizers are "error maximizers", weight instability out of sample, shrinkage estimators (Ledoit–Wolf), the minimum-variance and maximum-Sharpe (tangency) portfolios, risk parity, and real constraints with transaction costs.
Portfolio theory promised one perfect blend of assets sitting on a curved efficient frontier. Actually computing that blend from real data is where the bodies are buried — a textbook-perfect optimizer can produce portfolios so unstable that practitioners spent decades learning to distrust their own machine. This topic teaches both halves: how the optimizer works, and why it betrays you.
What you will learn to do:
- Mean-variance mechanics — set up the constrained minimization over expected returns μ and the covariance matrix Σ, walk the Lagrangian intuition, and crank the small-matrix arithmetic for two and three assets.
- Minimum-variance & tangency portfolios — compute the calmest mix (no return forecast needed) and the maximum-Sharpe point the capital market line kisses, by hand.
- Error maximization — see why tiny errors in the estimated means get levered into +200%/−150% weight swings, making the naive optimizer an “error maximizer” that collapses out of sample.
- Shrinkage estimators — use Ledoit–Wolf to pull the noisy sample covariance toward a structured target for stable, better-conditioned weights, plus shrinking the means and the Black–Litterman view-blending idea.
- Risk parity — equalize each asset’s risk contribution instead of forecasting returns, because equal dollars are emphatically not equal risk.
- Real constraints — long-only and box limits, turnover penalties, and transaction costs that decide whether a strategy is profitable on paper or after the broker takes their cut.
By the end you will know when to trust an optimizer, how to tame it, and why the sharpest desks prefer a robust, shrunk, cost-aware portfolio to the razor-sharp “optimal” one — the math-plus-humility judgment that separates a quant from a calculator. A graded final exam closes the loop.
In this topic
- 1 From Frontier to Weights Recap of mean-variance theory, the optimization problem in plain terms, the two inputs (expected returns μ and covariance Σ), what a portfolio of weights even is, and what 'solving for the weights' actually means. 11 min
- 2 The Covariance Matrix How the covariance and correlation matrices are built, why a covariance matrix must be symmetric and positive semidefinite, how its size explodes with the number of assets, and what ill-conditioning means for the optimizer. 12 min
- 3 Mean-Variance Mechanics Solving for the weights: the minimum-variance portfolio, the maximum-Sharpe (tangency) portfolio, the Lagrangian and closed-form solutions that invoke the inverse covariance matrix, and a fully worked two- and three-asset example. 13 min
- 4 Estimation Error & Instability Why mean-variance optimizers are 'error maximizers': how estimation error in μ and Σ levers into wild weight swings, why optimal portfolios are unstable across samples, why naive optimization loses to equal weighting out of sample, and how sensitive the optimum is to the inputs. 12 min
- 5 Shrinkage & Robust Estimators Taming estimation error: the bias–variance trade-off, Ledoit–Wolf shrinkage of the covariance matrix toward a structured target, shrinking the expected-return vector, and the Black–Litterman idea of blending equilibrium returns with investor views. 13 min
- 6 Risk Parity & Constraints Risk-based allocation and real-world frictions: risk contribution and equal-risk-contribution (risk parity), why equal dollars aren't equal risk, long-only and box constraints, turnover penalties, and how transaction costs reshape the optimal portfolio. 13 min
- 7 Portfolio Optimization — Final Exam The graded final exam for Portfolio Optimization: weights and the two inputs, the covariance matrix and conditioning, minimum-variance and maximum-Sharpe portfolios, estimation error and instability, Ledoit–Wolf shrinkage and Black–Litterman, risk parity, constraints, and transaction costs. 16 min
Mark course as finished
Done with every lesson? Lock it in — your progress is saved on this device.