Most investors diversify by instinct: “don’t put all your eggs in one basket.” In 1952, Harry Markowitz turned that instinct into mathematics. Modern Portfolio Theory (MPT) shows how to combine assets so that, for any level of risk, you earn the highest possible expected return—and how to find the specific portfolios that do it.
This guide builds MPT step by step and lets you experiment with two interactive labs. It continues from Basics of Risk and Return, which covers variance, covariance and the Sharpe ratio.
What Modern Portfolio Theory says
MPT rests on one powerful observation: a portfolio’s risk is not the average of its assets’ risks. Because assets do not move in perfect lockstep, combining them can cut risk without cutting expected return.
| Element | In plain words |
|---|---|
| Inputs | Expected returns (μ), volatilities (σ) and correlations (ρ) for each asset |
| Objective | Best trade-off between expected return and variance (“mean–variance”) |
| Output | Portfolio weights (w) on the efficient frontier |
| Key portfolios | Global minimum variance (GMV) and the tangency (maximum-Sharpe) portfolio |
Assumptions to keep in mind
- Investors care only about expected return and variance (returns roughly normal, or quadratic preferences).
- Investors are risk-averse: for the same return, they prefer less risk.
- Inputs are known for a single period; markets are frictionless (no taxes or costs).
- Unlimited borrowing and lending at the risk-free rate (for the Capital Market Line).
None holds perfectly—section 10 covers what goes wrong in practice—but the framework remains the backbone of asset allocation, from pension funds to robo-advisers.
Diversification: the free lunch
Total risk splits into systematic risk, driven by the economy and markets, and specific risk, unique to each company. Diversification erodes specific risk; systematic risk remains. That is why, in equilibrium, investors are paid for bearing market risk (beta), not for bearing risk they could have diversified away.
Two-asset portfolios
Start with equity A (expected return 12%, volatility 18%) and bonds B (7%, 6%), correlation 0.1, risk-free rate 6.5%.
| Weight in A | 0% | 10% | 20% | 30% | 40% | 50% | 60% | 70% | 80% | 90% | 100% |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Return | 7.00% | 7.50% | 8.00% | 8.50% | 9.00% | 9.50% | 10.00% | 10.50% | 11.00% | 11.50% | 12.00% |
| Volatility | 6.00% | 5.86% | 6.28% | 7.16% | 8.37% | 9.77% | 11.30% | 12.90% | 14.57% | 16.27% | 18.00% |
| Sharpe | 0.083 | 0.171 | 0.239 | 0.279 | 0.299 | 0.307 | 0.310 | 0.310 | 0.309 | 0.307 | 0.306 |
Notice the surprise: adding 10% equity to an all-bond portfolio raises return and lowers risk. The all-bond portfolio is inefficient.
Minimum-variance and maximum-Sharpe weights
w*T = [EAσ²B − EBσAB] / [EAσ²B + EBσ²A − (EA+EB)σAB], where E = excess return over Rf
GMV: 7.4% equity, 92.6% bonds → return 7.37%, volatility 5.84%.
Tangency: 65.2% equity, 34.8% bonds → return 10.26%, volatility 12.13%, Sharpe 0.310.
Two-asset frontier explorer
Move the sliders to change the assets, the correlation and your mix. Watch the frontier bend, the GMV and tangency points move, and the Sharpe ratio respond.
Try this: set ρ to −1 and find the weight that makes risk zero. Then set ρ to +1 — the curve becomes a straight line and diversification disappears.
Multi-asset portfolios
With more assets, the same logic applies in matrix form. Our running example uses four asset classes with illustrative long-term assumptions:
| Asset | Expected return | Volatility |
|---|---|---|
| Indian equity | 13% | 18% |
| Global equity | 11% | 16% |
| Bonds | 7% | 5% |
| Gold | 9% | 15% |
| Correlations | Indian eq. | Global eq. | Bonds | Gold |
|---|---|---|---|---|
| Indian equity | 1 | 0.5 | 0.1 | −0.1 |
| Global equity | 0.5 | 1 | 0 | 0 |
| Bonds | 0.1 | 0 | 1 | 0.2 |
| Gold | −0.1 | 0 | 0.2 | 1 |
| Covariance Σ | Indian eq. | Global eq. | Bonds | Gold |
|---|---|---|---|---|
| Indian equity | 0.0324 | 0.0144 | 0.0009 | −0.0027 |
| Global equity | 0.0144 | 0.0256 | 0 | 0 |
| Bonds | 0.0009 | 0 | 0.0025 | 0.0015 |
| Gold | −0.0027 | 0 | 0.0015 | 0.0225 |
An equal-weighted portfolio (25% each) returns 10.00% with 8.34% volatility—a Sharpe ratio of 0.420. Can optimisation do better? With n assets you need n expected returns, n variances and n(n−1)/2 correlations: 14 inputs for 4 assets, but 1,325 for 50. That is where estimation error creeps in.
The efficient frontier
Every dot is a feasible portfolio. A portfolio is efficient if no other portfolio offers a higher expected return for the same risk, or lower risk for the same return. The set of efficient portfolios forms the upper-left boundary—the efficient frontier.
- Everything below the frontier is dominated: move up (more return) or left (less risk) for free.
- The frontier starts at the global minimum-variance portfolio; the curve below it is inefficient.
- Which point on the frontier is “best” depends on your risk tolerance—until we add a risk-free asset.
Optimisation 1: the minimum-variance portfolio
Closed form (shorting allowed): wGMV = Σ⁻¹1 / (1ᵀΣ⁻¹1)
The GMV needs no expected-return estimates—only the covariance matrix. That makes it popular in practice, because expected returns are the hardest input to forecast.
| Asset | GMV weight |
|---|---|
| Indian equity | 1.3% |
| Global equity | 8.0% |
| Bonds | 86.4% |
| Gold | 4.3% |
| Portfolio | Return 7.49% · Volatility 4.73% · Sharpe 0.208 |
The GMV volatility (4.73%) is lower than even the safest single asset, bonds (5%), thanks to small diversifying positions in equity and gold. Here all weights are positive, so the long-only and unconstrained answers coincide.
Optimisation 2: maximum Sharpe ratio and the tangency portfolio
Closed form (shorting allowed): wT = Σ⁻¹(μ − Rf1) / [1ᵀΣ⁻¹(μ − Rf1)]
| Asset | Tangency weight |
|---|---|
| Indian equity | 39.8% |
| Global equity | 17.5% |
| Bonds | 13.6% |
| Gold | 29.1% |
| Portfolio | Return 10.67% · Volatility 9.73% · Sharpe 0.429 |
Compared with equal weights (Sharpe 0.420) the gain looks modest; compared with GMV (0.208) it is large. Gold earns a big weight not because of its return but because its negative correlation with Indian equity makes it an excellent diversifier.
The Capital Market Line and two-fund separation
Once a risk-free asset exists, the best risky portfolio is the same for everyone: the tangency portfolio. Investors simply choose how much to hold in it versus the risk-free asset—the separation theorem (Tobin, 1958). The line joining them, the Capital Market Line, dominates the curved frontier everywhere except at the tangency point.
| Risk aversion A | Share in tangency y* | Expected return | Volatility |
|---|---|---|---|
| 6 (cautious) | 73% | 9.56% | 7.14% |
| 4 (moderate) | 110% (borrow 10%) | 11.09% | 10.72% |
| 2 (aggressive) | 220% (borrow 120%) | 15.69% | 21.43% |
Efficient frontier & tangency lab
Change the expected returns, the risk-free rate and your risk aversion. The lab recomputes the frontier, the GMV and tangency portfolios and your position on the Capital Market Line.
Volatilities and correlations are fixed as in section 04. Long-only portfolios are found numerically.
Try this: raise gold’s expected return from 9% to 10.5%. Watch how sharply the tangency weights jump. That sensitivity is the main practical weakness of mean–variance optimisation.
Excel Solver and Python
Excel Solver: maximum Sharpe in six steps
- Enter expected returns (μ) in a column and the covariance matrix Σ in a 4×4 block (use COVARIANCE.S on return history, or σᵢσⱼρᵢⱼ).
- Put starting weights (25% each) in a column w.
- Portfolio return:
=SUMPRODUCT(w, mu). Portfolio variance:=MMULT(TRANSPOSE(w), MMULT(Sigma, w)); volatility = SQRT(variance). - Sharpe:
=(return − rf) / volatility. - Solver → Set objective: Sharpe cell → Max; By changing: weights; Constraints: SUM(w) = 1 and w ≥ 0; method GRG Nonlinear.
- For the GMV, change the objective to variance → Min. For the frontier, add a constraint return = target and repeat for several targets.
import numpy as np
from scipy.optimize import minimize
mu = np.array([0.13, 0.11, 0.07, 0.09]) # expected returns
vol = np.array([0.18, 0.16, 0.05, 0.15])
rho = np.array([[1, .5, .1, -.1],
[.5, 1, 0, 0 ],
[.1, 0, 1, .2],
[-.1, 0, .2, 1 ]])
Sigma = np.outer(vol, vol) * rho
rf = 0.065
def stats(w):
ret = w @ mu
sd = np.sqrt(w @ Sigma @ w)
return ret, sd, (ret - rf) / sd
cons = {"type": "eq", "fun": lambda w: w.sum() - 1}
bounds = [(0, 1)] * len(mu) # long-only
w0 = np.full(len(mu), 1 / len(mu))
gmv = minimize(lambda w: w @ Sigma @ w, w0, bounds=bounds, constraints=cons).x
tan = minimize(lambda w: -stats(w)[2], w0, bounds=bounds, constraints=cons).x
print("GMV ", gmv.round(3), stats(gmv)) # ~[0.013 0.080 0.864 0.043]
print("Tangency", tan.round(3), stats(tan)) # ~[0.398 0.175 0.136 0.291]
# closed forms when short selling is allowed
one = np.ones(len(mu)); Si = np.linalg.inv(Sigma)
w_gmv = Si @ one / (one @ Si @ one)
w_tan = Si @ (mu - rf) / (one @ Si @ (mu - rf))Limitations—and how practitioners respond
| Problem | Why it matters | Common remedies |
|---|---|---|
| Estimation error | Expected returns are noisy; the optimiser overweights assets whose returns are overestimated (“error maximisation”) | Shrink inputs, use the GMV, or impose weight limits |
| Unstable weights | Small input changes cause large allocation swings (try Lab 2) | Black–Litterman blending of views with market weights; resampled frontiers |
| Corner solutions | Long-only optimisation often puts zero in many assets | Minimum and maximum weight constraints; sector caps |
| Variance ≠ risk | Ignores fat tails, skewness and drawdowns | Optimise CVaR / expected shortfall; stress tests |
| Unstable correlations | Correlations rise in crises, just when diversification is needed | Stress correlations; tail-dependence models |
| Single period, no costs | Rebalancing costs and taxes are ignored | Turnover penalties; rebalancing bands |
Alternatives built on the same foundations include risk parity (equalise each asset’s risk contribution), maximum diversification and hierarchical risk parity. Each trades some theoretical optimality for robustness.
Frequently asked questions
What is Modern Portfolio Theory?
A framework introduced by Harry Markowitz in 1952 that chooses portfolio weights to maximise expected return for a given level of risk (variance), using expected returns, volatilities and correlations as inputs.
What is the efficient frontier?
The set of portfolios that offer the highest expected return for each level of risk. Portfolios below the frontier are dominated, because another portfolio offers more return for the same risk or less risk for the same return.
What is the global minimum-variance portfolio?
The portfolio of risky assets with the lowest possible volatility. It depends only on the covariance matrix, not on expected returns, which makes it robust to return-forecast errors.
What is the tangency portfolio?
The portfolio on the efficient frontier with the highest Sharpe ratio. It is where a straight line from the risk-free rate (the Capital Market Line) just touches the frontier.
How is the maximum Sharpe ratio portfolio different from the minimum-variance portfolio?
The minimum-variance portfolio minimises risk regardless of return. The maximum-Sharpe portfolio maximises excess return per unit of risk, so it usually holds more of the higher-returning assets.
What is the Capital Market Line?
The line from the risk-free asset through the tangency portfolio. Every point on it is a mix of the two; with borrowing, it extends beyond the tangency portfolio. It offers the best possible return for each level of risk.
Why do optimised weights change so much when inputs change slightly?
Mean–variance optimisation is very sensitive to expected-return estimates. Small changes can make the optimiser shift heavily between similar assets. Constraints, shrinkage and Black–Litterman help stabilise results.
Can I do portfolio optimisation in Excel?
Yes. Compute portfolio return with SUMPRODUCT and variance with MMULT, then use Solver (GRG Nonlinear) to maximise the Sharpe ratio or minimise variance subject to weights summing to one.
Does correlation matter more than volatility?
Both matter, but correlation determines how much diversification you get. A volatile asset with low or negative correlation can reduce portfolio risk, which is why gold often receives a meaningful weight.
Is Modern Portfolio Theory still used?
Yes. It underpins strategic asset allocation, robo-advisers and risk budgeting, usually with constraints and robust input estimates rather than in its textbook form.
Further reading
- Markowitz, H. (1952), “Portfolio Selection”, Journal of Finance 7(1)
- Tobin, J. (1958), “Liquidity Preference as Behavior Towards Risk”, Review of Economic Studies
- Sharpe, W. F. (1964), “Capital Asset Prices”, Journal of Finance; and (1966), “Mutual Fund Performance”
- Merton, R. C. (1972), “An Analytic Derivation of the Efficient Portfolio Frontier”, Journal of Financial and Quantitative Analysis
- Michaud, R. (1989), “The Markowitz Optimization Enigma: Is ‘Optimized’ Optimal?”, Financial Analysts Journal
- Black, F. and Litterman, R. (1992), “Global Portfolio Optimization”, Financial Analysts Journal
- Bodie, Kane and Marcus, Investments (McGraw Hill), chapters on optimal risky portfolios
Educational content. Capital-market assumptions are illustrative and are not forecasts or recommendations.
Prof. V. Ravichandran · The Mountain Path Academy · https://themountainpathacademy.com