Mean-Variance Optimization

Markowitz portfolio theory

optimization
investing
equities
Mean-variance optimization finds the portfolio weights that maximize return for a given risk level, forming the efficient frontier.
Author

Quantimi Research

Published

January 13, 2026

1 Abstract

Mean-variance optimization (MVO), introduced by Harry Markowitz in 1952, is the foundational framework of modern portfolio theory. It finds optimal portfolio weights by maximizing expected return for a given level of risk, or equivalently, minimizing risk for a given return target. The set of optimal portfolios forms the efficient frontier.

2 Definition

For a portfolio of \(n\) assets with weight vector \(\mathbf{w}\):

Portfolio return: \[ \mu_p = \mathbf{w}^T \boldsymbol{\mu} \]

Portfolio variance: \[ \sigma_p^2 = \mathbf{w}^T \Sigma \mathbf{w} \]

Where:

  • \(\boldsymbol{\mu}\) = vector of expected returns
  • \(\Sigma\) = covariance matrix
  • \(\mathbf{w}\) = weight vector with \(\sum w_i = 1\)

3 Optimization Problem

Minimum variance for target return \(\mu^*\):

\[ \min_{\mathbf{w}} \quad \mathbf{w}^T \Sigma \mathbf{w} \]

Subject to: \[ \mathbf{w}^T \boldsymbol{\mu} = \mu^* \quad \text{(return target)} \] \[ \mathbf{w}^T \mathbf{1} = 1 \quad \text{(fully invested)} \] \[ w_i \geq 0 \quad \text{(no short selling, optional)} \]

4 Compute (Python)

Expected Annual Returns:
Ticker
EFA    0.0910
GLD    0.1673
SPY    0.1311
TLT   -0.0899
VNQ    0.0104
dtype: float64

Covariance Matrix:
Ticker     EFA     GLD     SPY     TLT     VNQ
Ticker                                        
EFA     0.0275  0.0102  0.0227  0.0041  0.0195
GLD     0.0102  0.0360  0.0050  0.0063  0.0060
SPY     0.0227  0.0050  0.0293  0.0025  0.0212
TLT     0.0041  0.0063  0.0025  0.0246  0.0087
VNQ     0.0195  0.0060  0.0212  0.0087  0.0355

5 Portfolio Optimization Functions

6 Efficient Frontier

7 Optimal Portfolio Weights

Asset Min Variance Max Sharpe Equal Weight
0 SPY 5.42 0.00 20.0
1 TLT 21.71 55.38 20.0
2 GLD 31.50 44.62 20.0
3 VNQ 41.36 0.00 20.0
4 EFA 0.00 0.00 20.0

8 Portfolio Statistics

Portfolio Return (%) Volatility (%) Sharpe Ratio
0 Min Variance 4.54 11.21 0.05
1 Max Sharpe 15.11 13.91 0.80
2 Equal Weight 6.20 12.09 0.18

9 Capital Market Line

With a risk-free asset, investors can combine the tangency portfolio (max Sharpe) with borrowing/lending at the risk-free rate.

10 Limitations

  • Estimation error: Small changes in inputs cause large weight changes
  • Concentrated portfolios: Often produces extreme allocations
  • Historical data: Past returns don’t predict future returns
  • Single period: Ignores rebalancing and transaction costs
  • Normal assumption: Doesn’t account for fat tails or skewness

Modern approaches like Black-Litterman, shrinkage estimators, and robust optimization address some of these limitations.

11 Conclusion

Mean-variance optimization provides the theoretical foundation for portfolio construction. While the basic framework has practical limitations, understanding MVO is essential for quantitative finance. The efficient frontier demonstrates the fundamental risk-return tradeoff, and the capital market line shows how combining a risk-free asset with the tangency portfolio improves investment opportunities.