Portfolio Optimization with Modern Portfolio Theory
Portfolio Management

Portfolio Optimization with Modern Portfolio Theory

May 12, 202511 min readby QuantArtisan
efficient frontierMarkowitzMPTportfolio optimization

Portfolio Optimization with Modern Portfolio Theory

Harry Markowitz's 1952 paper "Portfolio Selection" introduced the concept of the efficient frontier — the set of portfolios that maximize expected return for a given level of risk. Seventy years later, it remains the foundation of quantitative portfolio construction, despite well-known practical limitations.

The Mean-Variance Optimization Problem

maxwwTμλ2wTΣw\max_w \quad \mathbf{w}^T \boldsymbol{\mu} - \frac{\lambda}{2} \mathbf{w}^T \Sigma \mathbf{w}

Subject to: iwi=1\sum_i w_i = 1, wi0w_i \geq 0 (long-only constraint)

Where w\mathbf{w} is the weight vector, μ\boldsymbol{\mu} is the expected return vector, Σ\Sigma is the covariance matrix, and λ\lambda is the risk aversion parameter.

python
1from pypfopt import EfficientFrontier, risk_models, expected_returns
2
3def optimize_portfolio(prices: pd.DataFrame) -> dict:
4    mu = expected_returns.mean_historical_return(prices)
5    S = risk_models.sample_cov(prices)
6    
7    ef = EfficientFrontier(mu, S)
8    weights = ef.max_sharpe()
9    cleaned_weights = ef.clean_weights()
10    
11    performance = ef.portfolio_performance(verbose=True)
12    return cleaned_weights

The Estimation Error Problem

The fundamental weakness of mean-variance optimization is its sensitivity to estimation error. Expected returns are notoriously difficult to estimate — small errors in μ\boldsymbol{\mu} lead to wildly different optimal portfolios. This is why naive mean-variance optimization often produces highly concentrated, unstable portfolios.

Practical Alternatives

Minimum variance portfolio: Ignore expected returns entirely and minimize portfolio variance. More stable than maximum Sharpe because it only requires estimating the covariance matrix.

Risk parity: Allocate capital such that each asset contributes equally to portfolio risk. Popularized by Bridgewater's All Weather fund.

Black-Litterman: Combines market equilibrium expected returns (derived from the market cap-weighted portfolio) with the investor's own views. Produces more stable, diversified portfolios than unconstrained MVO.

Applied Ideas

The frameworks discussed above translate directly into deployable trading logic. Here are concrete next steps for practitioners:

  • Backtest first: Validate any signal-generation or risk-management approach with walk-forward analysis before committing capital.
  • Start small: Deploy with fractional position sizing and paper-trade for at least one full market cycle.
  • Monitor regime shifts: Set automated alerts for when your model detects a regime change — manual review before large rebalances is prudent.
  • Iterate on KPIs: Track Sharpe, Sortino, max drawdown, and win rate weekly. If any metric degrades beyond your predefined threshold, pause and re-evaluate.
  • Combine signals: The strongest edges come from combining uncorrelated signals — pair the ideas in this post with your existing alpha sources.

Found this useful? Share it with your network.