Mean-Variance Optimization

The foundational Markowitz (1952) framework for constructing optimal portfolios by balancing expected return against portfolio variance along the efficient frontier.

Overview

Mean-Variance Optimization (MVO), introduced by Harry Markowitz in his seminal 1952 paper "Portfolio Selection," is the cornerstone of Modern Portfolio Theory (MPT). The framework provides a rigorous mathematical approach to portfolio construction by quantifying the trade-off between expected return and risk, measured as portfolio variance.

The key insight is that an investor can reduce portfolio risk through diversification without necessarily sacrificing expected return. By considering the correlations between asset returns, MVO identifies the set of portfolios that offer the highest expected return for each level of risk -- the efficient frontier. Any rational investor should hold a portfolio on this frontier, with the specific choice depending on their risk tolerance.

The framework assumes that investors are risk-averse and that asset returns follow a multivariate normal distribution, making the mean and covariance matrix sufficient statistics for portfolio selection. While these assumptions are often violated in practice, MVO remains the most widely used quantitative portfolio construction method in finance.

Mathematical Formulation

Notation

  • -- Vector of expected returns for assets
  • -- Covariance matrix of asset returns (symmetric, positive semi-definite)
  • -- Vector of portfolio weights
  • -- Target minimum portfolio return
  • -- Risk-free rate of return

Portfolio Return

The expected return of a portfolio is the weighted sum of individual asset expected returns:

Portfolio Variance

The portfolio variance captures both individual asset variances and all pairwise covariances, weighted by the portfolio allocation:

where is the covariance between assets and . When , this reduces to the variance of asset .

Full Optimization Problem

Textbook expositions usually state MVO as a variance minimization subject to a target return. The problem this platform solves for the MVO method sits at a different point on the same frontier: it maximizes the Sharpe ratio, so it returns the tangency portfolio. The request carries no target-return field, and the program carries no target-return row:

The first constraint ensures full investment (weights sum to one). The second constraint prevents short selling. Both are fixed for this method. The risk-free rate comes from the request. Because the objective is the Sharpe ratio, MVO and the Maximum Sharpe Ratio method describe the same tangency point on the efficient frontier.

The inputs come from the daily returns of the run window. The expected-return vector is the historical mean return, annualized as a compound growth rate. The covariance matrix is the Ledoit-Wolf shrunk estimate, annualized over 252 trading days. PyPortfolioOpt's EfficientFrontier.max_sharpe solves the program.

The tangency objective needs at least one asset whose expected return is above . When no asset is, the run lowers the rate it optimizes against to just below the highest expected return, marks the result as degraded, and records both the requested and the applied rate. Under constraints the run also checks that some portfolio which satisfies them has an expected return above . When none does, the method does not run, and the run states the reason.

Sharpe Ratio

The Sharpe Ratio measures the risk-adjusted return of a portfolio, quantifying the excess return per unit of total risk:

where is the portfolio return, is the risk-free rate, and is the portfolio standard deviation. The tangency portfolio on the efficient frontier maximizes this ratio.

Capital Market Line

When a risk-free asset is available, the Capital Market Line (CML) represents the set of optimal portfolios that combine the risk-free asset with the tangency portfolio:

where and are the return and standard deviation of the market (tangency) portfolio. The slope of the CML equals the Sharpe Ratio of the market portfolio.

Worked Example: Two-Asset Portfolio

Consider two assets with the following characteristics:

Asset A (Stock)

  • Expected return:
  • Standard deviation:

Asset B (Bond)

  • Expected return:
  • Standard deviation:

Correlation: , so

Portfolio with 60% Stock, 40% Bond

Expected return:

Portfolio variance:

Portfolio standard deviation:

Notice that the portfolio standard deviation (13.3%) is less than the weighted average of individual standard deviations (0.6 x 20% + 0.4 x 8% = 15.2%). This reduction is the diversification benefit, arising because the correlation is less than 1.

Advantages & Limitations

Advantages

  • Rigorous framework: Provides a mathematically sound basis for portfolio construction with clear optimality conditions.
  • Diversification: Explicitly accounts for correlations between assets, capturing diversification benefits.
  • Customizable: Accepts the three constraint families the platform supports as extra linear rows on the program: per-name weight bounds, asset exclusions, and group sum limits such as sector or segment caps. Turnover budgets, tracking-error constraints and target-return rows are not available on any method.
  • Efficient frontier: Provides the complete set of optimal risk-return trade-offs for decision-making.

Limitations

  • Input sensitivity: Small changes in expected returns or covariances can produce dramatically different optimal weights (Michaud, 1989).
  • Estimation error: Expected returns are notoriously difficult to estimate accurately, amplifying optimizer error.
  • Concentration risk: Often produces highly concentrated portfolios that load heavily on a few assets.
  • Normality assumption: Assumes returns are normally distributed, ignoring fat tails, skewness, and higher moments.
  • Static single-period: Does not natively account for transaction costs, rebalancing, or multi-period dynamics.

References

  • Markowitz, H. (1952). "Portfolio Selection." The Journal of Finance, 7(1), 77-91.
  • Markowitz, H. (1959). Portfolio Selection: Efficient Diversification of Investments. John Wiley & Sons.
  • Michaud, R. O. (1989). "The Markowitz Optimization Enigma: Is 'Optimized' Optimal?" Financial Analysts Journal, 45(1), 31-42.
  • Black, F., & Litterman, R. (1992). "Global Portfolio Optimization." Financial Analysts Journal, 48(5), 28-43.
  • DeMiguel, V., Garlappi, L., & Uppal, R. (2009). "Optimal Versus Naive Diversification: How Inefficient is the 1/N Portfolio Strategy?" The Review of Financial Studies, 22(5), 1915-1953.

Not investment advice. Past performance is not indicative of future results.