Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceStochastic ModelsGuide
Guide
Derivatives pricing
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Implied volatility and the volatility smile14Stochastic volatility and the Heston model15Static replication: Breeden–Litzenberger and Carr–Madan16Exotic options: barriers, Asians and digitals
Portfolio & risk
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08Value at Risk and expected shortfall
Fixed income
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Bond futures and the cheapest-to-deliver06Interest rate swaps07Callable bonds and negative convexity08Credit risk: default probabilities and credit spreads
Corporate finance
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04The weighted average cost of capital05Capital structure and the Modigliani–Miller theorems06Discounted cash flow valuation07Relative valuation with multiples08Real options: the value of flexibility
Stochastic models
01Random walks and Brownian motion02Probability spaces, σ-algebras and random variables03Filtrations, adapted processes and stopping times04Conditional expectation and martingales05Properties of Brownian motion06The reflection principle and first passage times07The Brownian bridge08The Itô integral09Itô's lemma10Kolmogorov equations and the Feynman–Kac formula11Change of measure and Girsanov's theorem12Monte Carlo option pricing13Simulating SDEs: the Euler–Maruyama scheme14Mean reversion: Ornstein–Uhlenbeck and Vasicek15Jumps and the Merton jump-diffusion model
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guide/Portfolio & risk

CAPM, beta and the security market line

Lesson 5 of 8 · 1 min read

The lesson "The efficient frontier and the capital market line" described how a single investor should choose a portfolio. This lesson assumes that every investor behaves that way and works out the consequence for prices. The result is the capital asset pricing model (CAPM): the expected return of any asset depends on one number, its beta.

Assumptions

The CAPM rests on the following simplifications, each stated explicitly:

  • Investors care only about the expected return and volatility of their portfolio over one common period (mean–variance preferences from the previous lesson).
  • All investors agree on the expected returns, volatilities and correlations of all assets (homogeneous expectations).
  • Everyone can lend and borrow any amount at the same risk-free rate rfr_frf​.
  • There are no taxes or transaction costs, assets can be split into any fraction, short sales are allowed, and no single investor can move prices.

None of these holds exactly. The point is to see what follows if they did, and then to judge how far reality departs.

The market portfolio

By two-fund separation, every investor holds the risk-free asset and the same tangency portfolio T, only in different amounts. Add up all investors' holdings: the total risky holding is a multiple of T. But the total risky holding must equal everything that exists, because every share outstanding is owned by someone. So in equilibrium T is the market portfolio M: every risky asset, held in proportion to its market value.

Write E[Rm]\mathbb{E}[R_m]E[Rm​] and σm\sigma_mσm​ for the expected return and volatility of the market portfolio. The capital market line becomes

E[Rp]=rf+E[Rm]−rfσm σp,\mathbb{E}[R_p] = r_f + \frac{\mathbb{E}[R_m] - r_f}{\sigma_m}\,\sigma_p,E[Rp​]=rf​+σm​E[Rm​]−rf​​σp​,

valid for efficient portfolios, that is mixes of rfr_frf​ and M. A single asset is not efficient and generally lies below this line, so the CML alone does not say what its expected return should be.

Beta

The beta of asset iii measures how strongly its return moves with the market:

βi=Cov⁡(Ri,Rm)Var⁡(Rm)=ρim σiσm.\beta_i = \frac{\operatorname{Cov}(R_i, R_m)}{\operatorname{Var}(R_m)} = \rho_{im}\,\frac{\sigma_i}{\sigma_m}.βi​=Var(Rm​)Cov(Ri​,Rm​)​=ρim​σm​σi​​.

The market itself has βm=1\beta_m = 1βm​=1, the risk-free asset has β=0\beta = 0β=0, and the beta of a portfolio is the weighted average of the betas of its assets, because covariance is linear in each argument. A beta of 1.3 means that when the market is 1% above its mean, the asset is on average 1.3% above its own.

Deriving the security market line

Start from the market portfolio and move a small amount ε\varepsilonε of money from the risk-free asset into asset iii. The expected return changes by ε(E[Ri]−rf)\varepsilon(\mathbb{E}[R_i] - r_f)ε(E[Ri​]−rf​). The variance σm2\sigma_m^2σm2​ changes by 2εCov⁡(Ri,Rm)2\varepsilon\operatorname{Cov}(R_i, R_m)2εCov(Ri​,Rm​) to first order, so the volatility changes by

dσ=ε Cov⁡(Ri,Rm)σm.d\sigma = \varepsilon\,\frac{\operatorname{Cov}(R_i, R_m)}{\sigma_m}.dσ=εσm​Cov(Ri​,Rm​)​.

Because M is the tangency portfolio, no such small move can improve the trade-off: the ratio of extra return to extra volatility must equal the slope of the CML for every asset,

E[Ri]−rfCov⁡(Ri,Rm)/σm=E[Rm]−rfσm.\frac{\mathbb{E}[R_i] - r_f}{\operatorname{Cov}(R_i, R_m)/\sigma_m} = \frac{\mathbb{E}[R_m] - r_f}{\sigma_m}.Cov(Ri​,Rm​)/σm​E[Ri​]−rf​​=σm​E[Rm​]−rf​​.

Otherwise one could tilt the portfolio towards (or away from) asset iii and obtain a higher Sharpe ratio than M. Solving for E[Ri]\mathbb{E}[R_i]E[Ri​] gives the security market line (SML):

E[Ri]=rf+βi (E[Rm]−rf).\mathbb{E}[R_i] = r_f + \beta_i\,\big(\mathbb{E}[R_m] - r_f\big).E[Ri​]=rf​+βi​(E[Rm​]−rf​).

CAPM: the expected excess return of any asset equals its beta times the market risk premium E[Rm]−rf\mathbb{E}[R_m] - r_fE[Rm​]−rf​.

Systematic and idiosyncratic risk

Split the excess return of asset iii into a part explained by the market and a remainder:

Ri−rf=αi+βi (Rm−rf)+εi,Cov⁡(εi,Rm)=0.R_i - r_f = \alpha_i + \beta_i\,(R_m - r_f) + \varepsilon_i, \qquad \operatorname{Cov}(\varepsilon_i, R_m) = 0.Ri​−rf​=αi​+βi​(Rm​−rf​)+εi​,Cov(εi​,Rm​)=0.

Taking variances gives

σi2=βi2σm2+σε2.\sigma_i^2 = \beta_i^2\sigma_m^2 + \sigma_{\varepsilon}^2.σi2​=βi2​σm2​+σε2​.

The first term is systematic risk, the second idiosyncratic (firm-specific) risk. The lesson "Diversification and correlation" showed that in a large portfolio firm-specific variances disappear while common movements remain. An investor holding the market therefore bears only systematic risk, and the SML says only that part earns a premium. Idiosyncratic risk is not priced, because it can be removed at no cost.

Example: an asset with σi=35%\sigma_i = 35\%σi​=35% and correlation 0.60.60.6 with a market of σm=20%\sigma_m = 20\%σm​=20% has β=0.6×0.35/0.20=1.05\beta = 0.6 \times 0.35 / 0.20 = 1.05β=0.6×0.35/0.20=1.05. Its systematic variance is 1.052×0.04=0.04411.05^2 \times 0.04 = 0.04411.052×0.04=0.0441, out of a total of 0.12250.12250.1225: only 36% (that is, ρ2\rho^2ρ2). The remaining 64%, a residual volatility of 28%, is idiosyncratic and earns no premium.

Worked example

Let rf=3%r_f = 3\%rf​=3%, E[Rm]=8%\mathbb{E}[R_m] = 8\%E[Rm​]=8% and β=1.3\beta = 1.3β=1.3. The market risk premium is 8%−3%=5%8\% - 3\% = 5\%8%−3%=5%. The required return of the asset is

E[Ri]=3%+1.3×5%=9.5%,\mathbb{E}[R_i] = 3\% + 1.3 \times 5\% = 9.5\%,E[Ri​]=3%+1.3×5%=9.5%,

so its risk premium is 6.5%6.5\%6.5%. An asset with β=0.5\beta = 0.5β=0.5 would require only 5.5%5.5\%5.5%, however volatile it is on its own.

The figure plots expected return against beta from 0 to 2. The SML starts at rfr_frf​ for β=0\beta = 0β=0 and passes through the market at β=1\beta = 1β=1; a second marker shows the asset. Raise E[Rm]\mathbb{E}[R_m]E[Rm​] and note that the line becomes steeper around the fixed point (0,rf)(0, r_f)(0,rf​). Move β\betaβ and note that the asset slides along the line. The readouts give the market risk premium, the required return of the asset and its risk premium.

Security market lineOpen in CAPM →
3.00%
00.06
8.00%
0.040.12
1.30
02
Security market lineMarket portfolioAsset
Market risk premium
5.00%
Required return
9.50%
Risk premium of the asset
6.50%

The SML and the CML are different lines. The CML has volatility on the horizontal axis and holds only for efficient portfolios. The SML has beta on the horizontal axis and holds for every asset and every portfolio.

Alpha

The alpha of an asset is the gap between the expected return one actually forecasts and the return the SML requires:

αi=E[Ri]−(rf+βi(E[Rm]−rf)).\alpha_i = \mathbb{E}[R_i] - \big(r_f + \beta_i(\mathbb{E}[R_m] - r_f)\big).αi​=E[Ri​]−(rf​+βi​(E[Rm​]−rf​)).

If an analyst expects 11% from the asset above, its alpha is 11%−9.5%=1.5%11\% - 9.5\% = 1.5\%11%−9.5%=1.5%: it plots above the SML and looks cheap for its risk. In the CAPM world such a gap cannot last. Investors would buy the asset, its price would rise and its expected return would fall until α=0\alpha = 0α=0. A measured alpha is therefore either a mispricing, a reward for a risk the CAPM leaves out, or estimation noise.

Estimating beta

In practice beta is estimated by an ordinary least-squares regression of the asset's excess returns on the excess returns of a broad index, typically 60 monthly observations or 2 years of weekly ones. The regression slope is the sample covariance divided by the sample variance of the index. Example: if the sample covariance of monthly returns is 0.00180.00180.0018 and the monthly index variance is 0.00160.00160.0016, then β^=0.0018/0.0016=1.125\hat\beta = 0.0018/0.0016 = 1.125β^​=0.0018/0.0016=1.125. The intercept estimates alpha.

Such estimates are noisy, they change as the firm's business and leverage change, and they depend on the index and the return frequency. Practitioners often shrink raw estimates towards 1 for these reasons.

Limitations

  • The true market portfolio contains all risky assets, including property and human capital. It cannot be observed, so every test uses a proxy index.
  • Empirically the SML is flatter than predicted: low-beta stocks earn more and high-beta stocks less than the model says.
  • Other characteristics, such as firm size and book-to-market value, explain average returns that beta does not. Multi-factor models add these as extra risk factors.
  • The model covers a single period and ignores taxes, trading costs and borrowing limits.

Despite this, the CAPM remains the standard first estimate of a required return, for instance as the cost of equity in corporate finance.

Summary

  • If all investors use mean–variance analysis with the same inputs, the tangency portfolio is the market portfolio.
  • Beta βi=Cov⁡(Ri,Rm)/Var⁡(Rm)\beta_i = \operatorname{Cov}(R_i, R_m)/\operatorname{Var}(R_m)βi​=Cov(Ri​,Rm​)/Var(Rm​) measures an asset's exposure to market movements.
  • Only systematic risk βi2σm2\beta_i^2\sigma_m^2βi2​σm2​ is priced; idiosyncratic risk can be diversified away and earns no premium.
  • Security market line: E[Ri]=rf+βi(E[Rm]−rf)\mathbb{E}[R_i] = r_f + \beta_i(\mathbb{E}[R_m] - r_f)E[Ri​]=rf​+βi​(E[Rm​]−rf​); alpha is the deviation from it.
  • Beta is estimated by regressing excess returns on an index; the model is a useful benchmark with known empirical weaknesses.
Try itEstimate betas and compare assets with the security market line in the CAPM lab →
← PreviousRisk aversion and the optimal complete portfolioNext →Performance measures: Sharpe, Treynor, Jensen and information ratio
Connections
CAPM, beta and the security market line
Open the full graph →
Labs for this lesson
CAPM