Portfolio construction determines how much capital to allocate to each stock. Even the best stock picks can produce poor portfolio results if position sizing is wrong. This article covers the three optimization approaches available in QuanterLab and the theoretical foundations behind them.
The Position Sizing Problem
After screening identifies 10 candidate stocks, you need to decide: how much in each? Equal weight (10% each) is simple but ignores risk. Concentration in your highest-conviction pick maximizes potential return but also maximizes risk. Portfolio optimization finds the mathematically optimal balance.
Mean-Variance Optimization (MVO)
Developed by Harry Markowitz in 1952. The foundational framework of modern portfolio theory.
The Efficient Frontier
For any set of assets, there exists a curve of portfolios that offer the maximum possible return for each level of risk. Portfolios on this curve are "efficient" — no other portfolio offers higher return at the same risk level.
Two Key Portfolios
- Maximum Sharpe Ratio — The portfolio with the highest risk-adjusted return: (Return - Risk-Free Rate) / Volatility. This is the theoretically optimal portfolio for a rational investor
- Minimum Variance — The portfolio with the lowest possible volatility. Ignores expected returns entirely; purely a risk-minimization approach
Return Estimation Methods
MVO requires expected return estimates — notoriously difficult to forecast accurately. Three approaches:
- Historical Mean — Uses past average returns as the forecast. Simple but assumes the past repeats
- CAPM — Estimates returns from each stock's beta and the market risk premium. More theoretically grounded but depends on beta stability
- Black-Litterman — Starts from market-implied equilibrium returns (derived from market-cap weights) and blends in investor views. Most sophisticated; reduces extreme positions common in basic MVO
Covariance Estimation
The covariance matrix captures how assets move together. Three estimation methods:
- Sample Covariance — Direct calculation from historical return data. Accurate with enough data but noisy with limited history
- Ledoit-Wolf Shrinkage — Shrinks the sample covariance toward a structured target (constant correlation model). Reduces estimation noise. Recommended when the number of assets approaches the number of time periods
- Exponential Weighted — Gives more weight to recent returns. Captures changing market dynamics but may overreact to short-term events
MVO is sensitive to its inputs. Small changes in expected returns can produce drastically different optimal weights. This is why covariance shrinkage and the Black-Litterman model exist — they reduce this sensitivity. If you see very concentrated results (90%+ in one stock), consider switching to Ledoit-Wolf covariance or using HRP instead.
Hierarchical Risk Parity (HRP)
Developed by Marcos López de Prado (2016). A fundamentally different approach that does not require expected return estimates.
How It Works
- Correlation clustering — Assets are organized into a tree structure (dendrogram) based on their correlation patterns. Highly correlated assets cluster together
- Quasi-diagonalization — The correlation matrix is reordered so similar assets are adjacent, forming a block-diagonal pattern
- Recursive bisection — The algorithm splits the tree in half repeatedly, allocating more weight to the less risky branch at each split
Advantages Over MVO
- No return estimates needed — Eliminates the biggest source of estimation error in MVO
- Naturally diversified — The clustering algorithm ensures each group of similar assets gets proportional allocation
- More stable — Small changes in correlations produce small changes in weights, unlike MVO where small input changes can flip the entire portfolio
Inverse Volatility (IVO)
The simplest approach: allocate more capital to less volatile assets.
No expected returns needed. No covariance matrix needed. Just individual asset volatilities. The intuition: less volatile assets are more predictable, so they deserve larger positions. More volatile assets are riskier, so position sizes should be smaller.
When to Use Each
- MVO — When you have strong views on expected returns and want to maximize risk-adjusted return. Best with Black-Litterman or CAPM return estimates and Ledoit-Wolf covariance
- HRP — When you want diversification without making return predictions. Best default choice for most investors. Produces stable, well-diversified portfolios
- IVO — When you want the simplest possible approach. Good for portfolios where all stocks have similar expected returns (e.g., index components after screening)