The capital market line and the tangency portfolio

The question
Choose a risky mix before revealing its best attainable slope.
- 1 SeeFind a steep line from cash.
- 2 TryScale the risky position.
- 3 ProveProve the best attainable slope.
- 4 ApplySolve five allocation problems.
Before you start · 3 quick checks on variance, weights, and efficiency
Two ideas before you start
2 ideasKeep the budget visible
Two bars show complementary initial weights. Choose a split below.
A portfolio weight is a fraction of initial wealth. Changing one weight requires adjusting the other to preserve the budget.
Exact definition
Use simple total returns over one common year, with cash distributions included in terminal wealth. Hold initial positions without rebalancing. In a frictionless market with no taxes, transaction costs, or outside cash flows, a fully invested risky portfolio has return \(R_p=w^TR\), where the entries of w sum to one. These are simple returns, not log returns; there is no compounding across multiple years.
The vector μ contains real-world expected returns, and Σ contains covariances. Assume finite second moments and supplied, fixed moments rather than estimates from a changing sample. Then \(\mu_p=\mu^Tw\) and \(\sigma_p^2=w^T\Sigma w\). Review portfolio correlation for the cross terms.
A certain return has no spread
A horizontal line shows the same cash return in each illustrative outcome.
Changing a certain rate changes its mean. The return still has no deviations from that mean.
Exact definition
A risk-free asset here pays the known simple return \(r_f\) over the same year, with no default. Its variance and its covariance with every risky return are zero. The plotted horizontal line uses equally likely illustrative outcomes; certainty, rather than those probabilities, is what makes the variance vanish.
For a risky portfolio with positive volatility, its Sharpe ratio is \(S_p=(\mu_p-r_f)/\sigma_p\). In a mean-versus-volatility plot this is the slope of the line joining the cash point to the portfolio. Both returns and volatility must use the same period and units. No normality or risk-neutral probability measure is assumed.
Refresher: the frontier and matrix notation
The efficient frontier contains portfolios for which no feasible alternative has at least as much mean and at most as much variance, with a strict improvement in one. Minimum variance at a fixed mean is a different comparison. The lower part of a risky minimum-variance boundary is inefficient.
A superscript T means transpose. Thus \(\mathbf1^Tw\) adds the weights. A symmetric positive-definite covariance matrix satisfies \(z^T\Sigma z\gt0\) for every nonzero z, so its inverse exists. Writing \(v=\Sigma^{-1}e\) means solving \(\Sigma v=e\). This assumption rules out redundant risk directions. The proof below expands quadratic forms directly; it does not require a matrix square root.
Choose a line from the cash point
- Set the cash rate and the initial percentage of the risky portfolio in A. The rest of that risky portfolio goes into B.
- Use the live slope to search. Press Check my line to compare your choice with the exact maximum.
- Try again clears the comparison. Start over also restores the initial controls.
What the contact means
The maximizing risky mix is the tangency portfolio, denoted T. Its line touches the efficient upper branch of the risky boundary. A higher expected return alone does not make a better slope: the extra return must be compared with the extra volatility. In this example the maximizing mix lies strictly inside the long-only weight interval at every available cash rate.
Two assumptions give this line its meaning. First, if you can lend and borrow at the same certain rate \(r_f\), every point on the ray from cash through T can be reached by holding T with a deposit (below T) or a loan (beyond T); stage 2 works this out. Second, ranking portfolios by this slope assumes mean-variance preferences: an investor judges a portfolio only by its mean and volatility, preferring a higher mean and a lower volatility. Both are assumptions of the model, not consequences of it.
The game permits only nonnegative risky weights. The theorem later permits unrestricted short positions and gives the same optimizer for these inputs. That agreement is specific to this example. In another model, long-only restrictions can exclude the unrestricted tangency portfolio.
Reading the search and its score
The curve uses the supplied moments of a one-year frictionless buy-and-hold model. Each point is a risky portfolio with all its wealth in A and B. Cash is a separate point at zero volatility. The dashed moving segment connects cash to your selected portfolio; it does not claim that a risky return is certain.
Checking reveals the upper and lower boundary branches, the tangency mark, and your shortfall in slope. The control grid need not contain the exact optimum. The stated slope tolerance gives an approximate success only. The analytic comparison searches continuous weights rather than merely picking the best slider position.
Change the scale of the risky position
Answer before opening the allocation formula and explorer. This stage uses the original cash rate, regardless of your last search.
In a frictionless one-year market, put initial fraction y in a fixed risky fund T and the remainder in cash. Assume borrowing and lending are both available at the same certain simple rate, with no fees, margin requirements, or leverage limit. For \(y\ge0\),
\[\begin{aligned}\mu_c&=r_f+y(\mu_T-r_f),\\\sigma_c&=y\sigma_T.\end{aligned}\]Thus the nonnegative allocations trace a ray through cash and T. Below full risky exposure, the remainder is a deposit. Above it, the cash position is a loan. Volatility scales with the absolute value of exposure; our explorer excludes negative y.
Why a different borrowing rate changes the path
If the borrowing rate is \(r_b\gt r_f\), the equal-rate formula still applies to deposits. For a loan, use \(\mu_c=y\mu_T+(1-y)r_b\). The negative cash weight multiplies the borrowing rate, so an increase in that rate lowers mean return. The loan is still certain; it contributes no variance.
The displayed path keeps T fixed to isolate financing cost. It is not a claim about the new efficient frontier. If borrowing is costlier than lending, the optimal leveraged risky fund can change too. A single line at the lending rate no longer describes all efficient choices.
Prove the best attainable slope
Assume the one-year frictionless simple-return model, finite second moments, a positive-definite Σ, and unrestricted risky positions. Short proceeds can finance other holdings; signed total returns include distributions owed on shorts. Borrow and lend without limits at the same certain rate \(r_f\). Let
\[\begin{aligned}e&=\mu-r_f\mathbf1,\quad e\ne0,\\v&=\Sigma^{-1}e,\\q&=e^Tv,\quad h=\mathbf1^Tv\gt0.\end{aligned}\]Positive definiteness gives \(q\gt0\). For any target excess mean \(a\gt0\), the unique least-variance risky position vector is \(x_*=(a/q)v\); put the rest of wealth in cash. Its volatility is \(a/\sqrt q\). Normalizing v gives the fully invested risky fund
\[\begin{aligned}w_T&=v/h,\\\mu_T-r_f&=q/h,\\\sigma_T&=\sqrt q/h,\\S_T&=\sqrt q.\end{aligned}\]Every fully invested risky portfolio p with positive volatility has \(S_p\le S_T\), with equality only for p = T: the tangency portfolio maximizes the Sharpe ratio. Now assume mean-variance preferences: investors judge portfolios only by mean and variance, preferring a higher mean and a lower variance, and efficiency below is meant in this sense. Then all efficient complete portfolios are nonnegative multiples of this fund plus cash. They lie on the line
\[\begin{aligned}\mu_c&=r_f+\frac{\mu_T-r_f}{\sigma_T}\,\sigma_c\\&=r_f+S_T\sigma_c,\end{aligned}\]including cash at zero volatility. The hypothesis h positive ensures the positive-excess-return direction can be normalized into a fully invested tangency fund.
Fix a positive target a. Compare \(x_*\) with a distinct risky position vector x having the same excess mean. Define \(d=x-x_*\ne0\) and \(D=d^T\Sigma d\gt0\). The total budget includes the cash holding; the risky entries of x need not sum to one. Choose each justified step.
From this calculation to the capital market line
The proof minimizes variance at each positive excess mean. It also shows that T maximizes the Sharpe ratio. A fully invested risky portfolio with excess mean \(a\gt0\) has variance at least \(a^2/q\), so its Sharpe ratio is at most \(a/(a/\sqrt q)=\sqrt q=S_T\). Equality requires the position \(x_*=(a/q)v\), which is fully invested only when \(a=q/h\), that is, at T. A portfolio with nonpositive excess mean has a nonpositive Sharpe ratio, below \(S_T\).
Under mean-variance preferences, any portfolio with a nonpositive excess mean and positive variance is dominated by cash. Along the resulting upper ray, increasing mean requires increasing volatility, so none of its points dominates another. This also explains why, once borrowing and lending are added, every risky frontier portfolio other than T is dominated: the line has a higher mean at the same volatility.
The optimizer is common to investors using these same moments, constraints, and mean-variance comparisons; the chosen exposure can differ. Finding a candidate with Lagrange multipliers gives \(\Sigma x\) proportional to e. The variance-gap argument proves global optimality.
Strictly, any fixed risky fund and cash define a capital allocation line. Calling the optimal line the capital market line adds an equilibrium identification: investors share the same opportunity set and beliefs, choose mean-variance efficient portfolios, and markets clear, so the common tangency fund is the aggregate risky market portfolio. The optimization alone does not identify a real market index. The line describes efficient portfolios using total volatility; it is not a pricing equation for every individual asset.
Separate the risky mix from its funding
Use the hypothetical one-year simple-total-return model: fixed initial positions, finite second moments, no fees, taxes, or outside cash flows. Cash pays a certain rate; borrowing has no fees or margin constraints. The borrowing rate equals the lending rate unless the problem explicitly changes it. Means are real-world inputs. Enter a decimal in the requested units.
Further reading
- J. Tobin, “Liquidity Preference as Behavior Towards Risk,” Review of Economic Studies, 1958.
- W. F. Sharpe, “Capital Asset Prices: A Theory of Market Equilibrium under Conditions of Risk,” Journal of Finance, 1964.