◆Financial Derivatives — In Progress Please await announcements of new courses and upcoming batches. Course Updates →
The Mountain Path Academy

Portfolio Optimisation with Modern Portfolio Theory

Two-asset and multi-asset portfolios, the efficient frontier, minimum-variance and maximum-Sharpe (tangency) portfolios — with two interactive labs

Fundamentals · Portfolio Management · CFA / FRM / MBA · 14 min read · Interactive · Excel Solver & Python

▲ THE MOUNTAIN PATH ACADEMY · FUNDAMENTALS
MPT at a Glance
Diversification · Efficient frontier · GMV · Max Sharpe · CML — one screen, one story
0.43 vs 0.21
Same four assets, very different portfolios

In our example the tangency portfolio earns 0.43 of excess return per unit of risk; the minimum-variance portfolio earns 0.21. Optimisation is about choosing the right objective.

Founder
Markowitz 1952
“Portfolio Selection” — Nobel Prize 1990
Portfolio return
E[Rp] = wᵀμ
Weighted average of asset returns
Portfolio variance
σ²p = wᵀΣw
Depends on every covariance pair
Diversification
ρ < 1
Risk falls below the weighted average
Efficient frontier
Max E[R] for each σ
Portfolios no one should beat
Min-variance (GMV)
w = Σ⁻¹1 / 1ᵀΣ⁻¹1
Lowest-risk portfolio of risky assets
Max Sharpe
max (E[Rp]−Rf)/σp
Best reward per unit of risk
Tangency portfolio
w ∝ Σ⁻¹(μ − Rf1)
Where the CML touches the frontier
Capital Market Line
E[R] = Rf + ST σ
Mix tangency with the risk-free asset
Two-fund separation
Same risky mix for all
Only the cash/risky split differs
Your allocation
y* = ST / (A σT)
Risk aversion A sets the split
Biggest risk
Estimation error
Small input changes, big weight swings
TWO OPTIMAL PORTFOLIOS 4-asset example, long-only
GMV
σ 4.73% · R 7.49%
Tangency
σ 9.73% · R 10.67%
Indian equityGlobal equityBondsGold
GMV hides in bonds; tangency spreads risk across equity and gold because gold diversifies equity.
🎓 TEACHING MOMENT

Everyone holds the same risky portfolio — only the dose differs.

A = 6Cautious: 73% tangency + 27% risk-free → 9.6% return, 7.1% risk.
A = 4Moderate: 110% tangency (borrow 10%) → 11.1% return, 10.7% risk.
A = 2Aggressive: 220% tangency — heavy leverage, 21.4% risk.

That is two-fund separation (section 07). Try it in the lab.

Education only · Illustrative capital-market assumptions · Rf = 6.5%

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.

01 / OVERVIEW

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.

ElementIn plain words
InputsExpected returns (μ), volatilities (σ) and correlations (ρ) for each asset
ObjectiveBest trade-off between expected return and variance (“mean–variance”)
OutputPortfolio weights (w) on the efficient frontier
Key portfoliosGlobal 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.

02 / CORE CONCEPTS

Diversification: the free lunch

0%10%20%30%40%11020304050Systematic (market) risk — cannot be diversified awayUnsystematic (specific) risk — diversified awayNumber of stocks in the portfolioPortfolio volatility
Adding stocks removes specific risk, but total volatility levels off at the market (systematic) risk. Illustrative: 15% market risk, 35% average specific risk.

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.

E[Rp] = Σ wᵢ E[Rᵢ] = wᵀμ   |   σ²p = Σᵢ Σⱼ wᵢ wⱼ σᵢⱼ = wᵀΣw   |   Σ wᵢ = 1
03 / TWO ASSETS

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%.

σ²p = w²σ²A + (1−w)²σ²B + 2w(1−w)ρσAσB
Weight in A0%10%20%30%40%50%60%70%80%90%100%
Return7.00%7.50%8.00%8.50%9.00%9.50%10.00%10.50%11.00%11.50%12.00%
Volatility6.00%5.86%6.28%7.16%8.37%9.77%11.30%12.90%14.57%16.27%18.00%
Sharpe0.0830.1710.2390.2790.2990.3070.3100.3100.3090.3070.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*GMV = (σ²B − ρσAσB) / (σ²A + σ²B − 2ρσAσB)
w*T = [EAσ²B − EBσAB] / [EAσ²B + EBσ²A − (EA+EB)σAB],  where E = excess return over Rf
✎ Results

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.

0%4%8%12%16%20%6%8%10%12%14%Risk (standard deviation)Expected returnA: EquityB: Bondsρ = +1ρ = +0.5ρ = +0ρ = -0.5ρ = -1
The same two assets traced for five correlations. The lower the correlation, the further the curve bends left — more risk reduction. At ρ = −1, a zero-risk portfolio exists.
INTERACTIVE LAB 1

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.

04 / MANY ASSETS

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:

AssetExpected returnVolatility
Indian equity13%18%
Global equity11%16%
Bonds7%5%
Gold9%15%
CorrelationsIndian eq.Global eq.BondsGold
Indian equity10.50.1−0.1
Global equity0.5100
Bonds0.1010.2
Gold−0.100.21
Covariance ΣIndian eq.Global eq.BondsGold
Indian equity0.03240.01440.0009−0.0027
Global equity0.01440.025600
Bonds0.000900.00250.0015
Gold−0.002700.00150.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.

05 / EFFICIENT FRONTIER

The efficient frontier

0%4%8%12%16%20%6%8%10%12%14%Risk (standard deviation)Expected returnIndian equityGlobal equityBondsGoldMinimum variance (GMV)Tangency (max Sharpe)Risk-free 6.5%Capital Market Line ↘EfficientfrontierInefficient (dominated) partFeasible portfolios
Grey dots: random long-only portfolios of the four assets. Navy curve: the efficient frontier. Red dashed: the inefficient lower half. Gold line: the Capital Market Line from the 6.5% risk-free rate, touching the frontier at the tangency portfolio.

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.
06 / MINIMUM VARIANCE

Optimisation 1: the minimum-variance portfolio

minimise wᵀΣw  subject to  Σwᵢ = 1  (and wᵢ ≥ 0 if long-only)
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.

AssetGMV weight
Indian equity1.3%
Global equity8.0%
Bonds86.4%
Gold4.3%
PortfolioReturn 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.

07 / MAX SHARPE

Optimisation 2: maximum Sharpe ratio and the tangency portfolio

maximise (wᵀμ − Rf) / √(wᵀΣw)  subject to  Σwᵢ = 1
Closed form (shorting allowed): wT = Σ⁻¹(μ − Rf1) / [1ᵀΣ⁻¹(μ − Rf1)]
AssetTangency weight
Indian equity39.8%
Global equity17.5%
Bonds13.6%
Gold29.1%
PortfolioReturn 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

E[R] = Rf + [(E[RT] − Rf) / σT] × σ   |   optimal share in tangency y* = (E[RT] − Rf) / (A σ²T)

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 AShare in tangency y*Expected returnVolatility
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%
Key idea: optimise the risky mix once (tangency), then match risk appetite with cash or borrowing. Changing your risk tolerance should change the cash split, not the asset mix.
INTERACTIVE LAB 2

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.

08 / IMPLEMENTATION

Excel Solver and Python

Excel Solver: maximum Sharpe in six steps

  1. Enter expected returns (μ) in a column and the covariance matrix Σ in a 4×4 block (use COVARIANCE.S on return history, or σᵢσⱼρᵢⱼ).
  2. Put starting weights (25% each) in a column w.
  3. Portfolio return: =SUMPRODUCT(w, mu). Portfolio variance: =MMULT(TRANSPOSE(w), MMULT(Sigma, w)); volatility = SQRT(variance).
  4. Sharpe: =(return − rf) / volatility.
  5. Solver → Set objective: Sharpe cell → Max; By changing: weights; Constraints: SUM(w) = 1 and w ≥ 0; method GRG Nonlinear.
  6. 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))
09 / LIMITATIONS

Limitations—and how practitioners respond

ProblemWhy it mattersCommon remedies
Estimation errorExpected returns are noisy; the optimiser overweights assets whose returns are overestimated (“error maximisation”)Shrink inputs, use the GMV, or impose weight limits
Unstable weightsSmall input changes cause large allocation swings (try Lab 2)Black–Litterman blending of views with market weights; resampled frontiers
Corner solutionsLong-only optimisation often puts zero in many assetsMinimum and maximum weight constraints; sector caps
Variance ≠ riskIgnores fat tails, skewness and drawdownsOptimise CVaR / expected shortfall; stress tests
Unstable correlationsCorrelations rise in crises, just when diversification is neededStress correlations; tail-dependence models
Single period, no costsRebalancing costs and taxes are ignoredTurnover 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.

10 / FAQs

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.

REFERENCES

Further reading

  1. Markowitz, H. (1952), “Portfolio Selection”, Journal of Finance 7(1)
  2. Tobin, J. (1958), “Liquidity Preference as Behavior Towards Risk”, Review of Economic Studies
  3. Sharpe, W. F. (1964), “Capital Asset Prices”, Journal of Finance; and (1966), “Mutual Fund Performance”
  4. Merton, R. C. (1972), “An Analytic Derivation of the Efficient Portfolio Frontier”, Journal of Financial and Quantitative Analysis
  5. Michaud, R. (1989), “The Markowitz Optimization Enigma: Is ‘Optimized’ Optimal?”, Financial Analysts Journal
  6. Black, F. and Litterman, R. (1992), “Global Portfolio Optimization”, Financial Analysts Journal
  7. 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