A risk-free asset
A risk-free asset pays a return known in advance, such as a government bill held to maturity (case study 1.2.4). Its volatility is 0, and it has no covariance with anything. Here a year, a simple return like the assets' .
Take a risky portfolio P, with expected return and volatility . Put a fraction of your money in P and the rest, , in the bill.
The expected return is the weighted average . For the variance, add the bill to case study 3.2.5's covariance matrix as a row and column of zeros: then leaves only .
Rule: Mixing with the risk-free asset
For both are straight lines in , so the mixes lie on a straight line from the bill, at , through P. A above 1 means borrowing at to hold more than 100% in P.
Take P to be asset C, with and :
| 0 | 0.5 | 1 | 1.5 | ||
|---|---|---|---|---|---|
| 0.03 | 0.07 | 0.11 | 0.15 | ||
| 0.125 | 0 | 0.125 | 0.25 | 0.375 |
Half in C and half in the bill expects 7% with 12.5% volatility. With the investor borrows half their capital at 3%: leverage, more return and more risk.
With they sell C short and put the proceeds in the bill. The volatility is 12.5% again, but the expected return is : the line folds back downwards.
Try it
The loop is the table: the expected return and volatility of in C and in the bill. abs(t) keeps the volatility positive for a short position.
The Sharpe ratio
The slope of that line is the extra expected return each unit of volatility brings. Funds report it widely.
Rule: Sharpe ratio
The excess return , earned for taking risk, per unit of volatility. With annual , and it is an annual ratio of two returns, so it has no units.
With , asset A has , B has 0.2778 and C has 0.32. Case study 3.2.5's 50/30/20 mix has 0.3852, and the minimum-variance portfolio of case study 4.5.5 has 0.3476.
- Leverage does not change it. For , every mix of P with the bill has P's Sharpe ratio. The excess return and the volatility both scale by ; for the ratio flips sign.
- Signs. is negative when : the portfolio pays less than the bill and takes risk too. It is 0 when , and the bill itself, with , has none.
- The period matters. Over a month the mean is about of the annual one and the volatility (case study 3.2.5). So a monthly Sharpe ratio is the annual one divided by : C's 0.32 a year is 0.0924 a month.
At any volatility, a steeper line from the bill reaches a higher expected return. So the best risky portfolio to mix with the bill is the one with the highest Sharpe ratio.
Each asset mixed with the bill traces a line from 3% through the asset, with its Sharpe ratio as slope. The steepest line that still reaches a portfolio touches the frontier at the tangency portfolio.
Try it
sharpe takes weights summing to 1. The cell prints the Sharpe ratios of A, B and C, the 50/30/20 mix and the minimum-variance portfolio.
Then C mixed with the bill at and : the ratio stays 0.32. The last line is C's monthly ratio, worked out both ways.
The tangency portfolio
Two assets: a table
Mix A and C, with a weight in C, and compute the Sharpe ratio of each mix:
| 0 | 0.2 | 0.4 | 0.6 | 0.8 | 1 | |
|---|---|---|---|---|---|---|
| Sharpe ratio | 0.25 | 0.3553 | 0.3878 | 0.3704 | 0.3435 | 0.32 |
The ratio climbs above both assets' and peaks near . The excess return moves in a straight line between the two assets. The volatility of a mix stays below the straight line between theirs: diversification (case study 1.2.4).
The algebra: the best investor with a bill
Lesson 4.6.1's investor can now hold the bill too.
Write for the amounts in the risky assets, as fractions of capital. They need not add up to 1, because the bill holds the rest, . The expected return is and the variance , so
There is no constraint left. Maximising is minimising , which is lesson 4.4.1's quadratic , plus a constant, with and .
Its minimum solves , so . It is the one best point, because is positive definite (lesson 3.7.1).
The direction is the same for every : only the amount changes. Scaled so its entries add up to 1, it is a portfolio of risky assets alone.
Rule: Tangency portfolio
The risky portfolio with the highest Sharpe ratio, where the line from the bill touches the frontier. Its Sharpe ratio has . It needs .
For A and C, , which adds up to 3.0269. So : 39.38% in C, with a Sharpe ratio of 0.3878, the peak of the table.
For all three assets, and :
It expects 7.93% with a volatility of 12.47%, a Sharpe ratio of 0.3951, and gives the same 0.3951. Among 100,000 random portfolios, none does better.
Try it
The first loop is the table for A and C. Then the formula for two assets, np.linalg.solve(S2, mu2 - rf), which is .
Try it
The same for the three assets. The second line prints , , and the square root of .
The last lines draw 100,000 random portfolios, short sales allowed, with weights adding up to 1. The best of their Sharpe ratios is compared with .
When there is no tangency portfolio
The scaling divides by . In case study 4.5.5's letters, .
Here , and is the minimum-variance portfolio's expected return. So exactly when the risk-free rate is below .
| 0 | 5.6611 | 0.0744 | 0.1146 | 0.6489 | |
| 0.02 | 3.9995 | 0.077 | 0.1193 | 0.4773 | |
| 0.03 | 3.1687 | 0.0793 | 0.1247 | 0.3951 | |
| 0.05 | 1.5071 | 0.0915 | 0.166 | 0.2502 | |
| 0.06 | 0.6763 | 0.1203 | 0.2986 | 0.202 | |
| 0.07 | 1.2202 |
As rises towards 6.81%, the tangency portfolio climbs the frontier and runs away, with ever larger positions.
Above it, no line from the bill touches the upper half of the frontier. The formula still returns weights, but they sit on the lower half and have a negative Sharpe ratio: the worst line, not the best. Code must check .
At the tangency portfolio is almost lesson 4.6.1's best portfolio for , . That portfolio's multiplier was to four places, and with exactly the two coincide. Every portfolio on the upper frontier is the tangency portfolio for some risk-free rate.
Try it
The loop is the table. The last line is and , the rate at which reaches 0.
The capital market line and two-fund separation
The line from the bill through the tangency portfolio is the capital market line. Every point on it mixes with the bill. Away from T, each point beats every frontier portfolio of the same volatility.
Rule: Capital market line
The best portfolios when a risk-free asset exists. An investor with risk aversion puts the fraction in the tangency portfolio and in the bill. Also , the sum of the entries of .
Here , and three investors split their money like this:
| in | in the bill | ||||
|---|---|---|---|---|---|
| 2 | 1.5843 | 0.1081 | 0.1976 | 0.069 | |
| 4 | 0.7922 | 0.2078 | 0.069 | 0.0988 | 0.0495 |
| 8 | 0.3961 | 0.6039 | 0.0495 | 0.0494 | 0.0398 |
The investor with borrows 58.43% of their capital at 3%. The one with scored 4.85% in lesson 4.6.1 without a bill, and scores 4.95% with it. Cutting risk with the bill costs less than moving down the frontier.
Two-fund separation: every investor holds the same two funds, the bill and . Only the split depends on . Case study 4.5.5's two-fund theorem built the frontier from two risky portfolios; with a risk-free asset, one of the two funds is the bill.
Try it below. Move the risk-free rate from 0 to 6% and watch the tangency portfolio climb the frontier while its Sharpe ratio falls.
Push it past 6.81%, the minimum-variance return, and the tangency portfolio disappears. The explorer finds it with short sales allowed, as the formula does.
Explore
Every mix of the three assets is a point: its volatility across, its expected return up. Move the target return and read the cheapest mix in risk that earns it. Turn on a risk-free rate to add the tangency portfolio.
Grey dots are the assets, the open circle the minimum-variance portfolio, the square the tangency portfolio and the dashed line the capital market line.
- Frontier portfolio
- A 29.9%, B 16.9%, C 53.2%
- Return and risk
- expected return 9%, volatility 15.99%
- Minimum variance
- A 74.7%, B 15.1%, C 10.2%: return 6.81%, volatility 10.97%
- Tangency portfolio
- A 51.8%, B 16%, C 32.1%: return 7.93%, volatility 12.47%, Sharpe ratio 0.395
In practice, borrowing costs more than lending. Then lenders use the tangency portfolio for the lending rate, and borrowers a riskier one, further up the frontier, for the higher borrowing rate. Investors in between hold frontier portfolios and neither lend nor borrow.
Try it
For each , the cell computes . It prints the amount in risky assets, the bill, the expected return, the volatility and , then from the formula.
Lesson 4.6.3 asks what happens if every investor does this: the tangency portfolio becomes the market, and expected returns line up with beta.
Common mistakes
- Subtract the risk-free rate. C's Sharpe ratio is , not .
- Keep the periods together. Divide an annual Sharpe ratio by for a monthly one. A monthly mean minus an annual is meaningless.
- Leverage does not raise the Sharpe ratio. It moves along the line; only a better risky mix makes the line steeper.
- Check before scaling. With above the minimum-variance return, the formula returns the worst portfolio, not the best.
- Use the whole matrix. The tangency weights are , scaled. Ranking assets by their own Sharpe ratios ignores the correlations: A has the lowest ratio, 0.25, yet the largest weight, 51.85%.
- A negative amount in the bill is borrowing, and a negative weight in an asset is a short sale.
The tangency portfolio and the Sharpe ratio
0 of 12 correct
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
How to type answers
- Powers with
^:x^7,2^(1/3),a^-2. - Multiply with
*or by writing side by side:3x^2,2(x+1). ln(x)is the natural log,log(x, 2)is log base 2,eis Euler's number,sqrt(x)is a square root.sin(x),cos(x)andtan(x)take radians; writepifor π andsin(x)^2for sin²x.- Your first answer to each question is saved: it counts towards your score and brings the question back for review.
- Exact answers like
ln(20)/ln(3)are best. Decimals need about 4 significant figures.
Summary card
- Mixing a risky portfolio with a risk-free asset gives and : a straight line from . is borrowing.
- The Sharpe ratio is that line's slope. Leverage does not change it; a monthly ratio is the annual one over .
- The tangency portfolio has the highest Sharpe ratio, with . It exists only if , that is .
- For the three assets with : , , , .
- The capital market line is . Every investor holds the bill and , with in : two-fund separation.