Mean-Variance Portfolio Optimization (Markowitz)

Statistics
Introduced by
Harry Markowitz
Year
1952
Type
Mean-variance optimization model

What does it do?

Mean-variance portfolio optimization is the foundational model of modern portfolio theory, introduced by Harry Markowitz in 1952.

It describes portfolios in an expected-return versus risk (variance) plane and traces the efficient frontier of allocations that offer the highest expected return for each level of risk. The base formulation imposes a target-return constraint and a full-investment constraint (weights sum to one). Long-only limits, concentration limits and a shrunk covariance estimate are added in practice, and the frontier includes the minimum-variance and maximum-Sharpe-ratio portfolios.

The intuition behind the method

Think of every possible mix of assets as a point plotted by its expected return and its risk, measured as variance. For any level of risk, one mix offers the highest expected return, and collecting those best mixes gives the efficient frontier. Diversification works because combining assets that do not move in lockstep lowers total variance more than it lowers the weighted average of expected returns. With risk on the horizontal axis, the frontier forms the upper-left edge of the set of attainable portfolios.

History

Mean-variance analysis originates in Harry Markowitz's 1952 paper 'Portfolio Selection' in The Journal of Finance, which formalised the return-risk trade-off and the efficient frontier. The instability of optimised weights to noisy covariance estimates was later addressed in part by Ledoit and Wolf (2004), who proposed a well-conditioned shrinkage estimator for large covariance matrices. This estimator is widely used as an input to the optimisation.

When to use it

Use mean-variance optimization to construct or rebalance a portfolio across several assets when you have a return history long enough to estimate their means and covariance matrix, and when you are willing to treat those historical estimates as usable inputs for the period ahead. The model is best suited to choosing weights when you have reasonable expected-return estimates. The reliability of the covariance estimate depends on the ratio of the number of observations T to the number of assets N: T should be well above N, and the estimate deteriorates quickly as N approaches or exceeds T. As a rough rule of thumb, histories of around 250 observations or fewer often yield unreliable covariance estimates. This is a heuristic, not a fixed threshold. Meeting a minimum sample size does not by itself make the estimates reliable. Do not rely on the method when the history is short relative to the number of assets, when the covariance estimate is too noisy to trust, or when expected returns are essentially unknown, since then the weights mainly reflect estimation error.

Limitations and considerations

  • The optimised weights are highly sensitive to the inputs: because the optimiser exploits small differences in estimated returns and covariances, modest estimation errors can produce large swings in the weights, the so-called error-maximiser effect.
  • The covariance matrix Σ is estimated from sample data and becomes noisy as the number of assets grows relative to the history; Ledoit-Wolf shrinkage is a common stabilising step.
  • When the history is short relative to the number of assets, the covariance estimate is unreliable. As a rough guide, histories of about 250 observations or fewer are often too short for a stable estimate. Shrinkage improves the estimate but does not remove the problem.
  • The formula uses only the first two moments, mean and covariance. Skewness, fat tails and changing moments are not represented, so the weights inherit any drift in the estimated inputs over the sample period.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Makes the trade-off between expected return and variance explicit in a single optimisation problem, so the diversification logic is stated in the formula rather than left to judgement.
  • Generates the whole efficient frontier, including the minimum-variance and maximum-Sharpe-ratio portfolios.
  • Accepts additional constraints such as long-only or concentration limits, and can use a shrunk covariance estimate in place of the raw sample matrix.

Applications

  • Constructing diversified investment portfolios across multiple assets.
  • Building the minimum-variance or maximum-Sharpe-ratio portfolio for an asset universe.
  • Strategic asset allocation and periodic rebalancing under long-only and concentration constraints.

How it works

How it works

1

Each portfolio is summarised by two numbers built from the asset weights w: its expected return μ_p = wᵀμ, a weighted average of the individual expected returns, and its variance σ_p² = wᵀΣw. The covariance matrix Σ carries the correlations between assets, not only their individual variances, so the risk of a mix depends on how the assets move together. The inputs μ and Σ are estimated from historical returns, and the calculation treats them as known. It implicitly assumes that the return behaviour captured in the estimation window is stable enough to describe the period ahead.

Formula
\mu_p = w^{\top}\mu, \quad \sigma_p^2 = w^{\top}\Sigma w
2

The optimiser finds the weights w that minimise the portfolio variance wᵀΣw for a chosen target return, subject to the weights summing to one (full investment). Varying the target return across its range traces the efficient frontier, and two points on it are of special interest: the global minimum-variance portfolio and the maximum-Sharpe-ratio (tangency) portfolio. The tangency portfolio maximises the excess return per unit of risk, (wᵀμ − r_f)/√(wᵀΣw), subject to wᵀ1 = 1, so it requires a risk-free rate r_f as an additional input. The formula above contains only these equality constraints; long-only and concentration limits are extra constraints added in practice, and a Ledoit-Wolf shrinkage estimate is commonly used for Σ to reduce estimation noise.

Formula
\min_{w}\; w^{\top}\Sigma w \;\; \text{s.t.}\;\; w^{\top}\mu = \mu_{\text{target}},\; w^{\top}\mathbf{1}=1

Common pitfalls

  • Trusting raw historical covariances on short samples instead of applying Ledoit-Wolf shrinkage.
  • Optimising without short-sale or concentration constraints, which can yield extreme, undiversified weights.
  • Treating weights estimated from past means and covariances as if they were stable forecasts; if the return process has shifted, the optimal weights reflect a period that no longer applies.
  • Over-interpreting precise-looking weights and frontier positions as point estimates. They carry sampling uncertainty, which is large when expected-return estimates are imprecise. Report intervals, for example from bootstrap resampling, alongside the weights.

Frequently asked questions

What is the efficient frontier?

It is the curve of portfolios that deliver the highest expected return for each level of risk (variance). Portfolios below the frontier are dominated; you can always find another mix with the same risk but higher expected return.

Why are the optimised weights so sensitive to the inputs?

Mean-variance optimization behaves like an 'error maximiser': small errors in the estimated expected returns or covariances are amplified into large swings in the weights. Robust covariance estimation and constraints reduce this instability.

Why use Ledoit-Wolf shrinkage for the covariance matrix?

The sample covariance matrix is noisy, especially when the number of assets is large relative to the history. Ledoit and Wolf's (2004) shrinkage estimator produces a well-conditioned matrix that stabilises the optimisation and yields more reliable weights.

When should I use a risk-parity model instead?

A risk-parity model can be considered when expected-return estimates are unreliable, because it allocates by risk contribution and does not require estimated expected returns. It still depends on a covariance matrix, so a short return history affects it as well, and shrinkage estimators such as Ledoit-Wolf apply to both approaches.

Related methods

Sources

  1. Markowitz, H. (1952). Portfolio Selection. The Journal of Finance, 7(1), 77-91.

    Open DOI reference
  2. Ledoit, O. & Wolf, M. (2004). A Well-Conditioned Estimator for Large-Dimensional Covariance Matrices. Journal of Multivariate Analysis, 88(2), 365-411.

    Open DOI reference