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

Factor models and systematic risk

Lesson 7 of 8 · 1 min read

The lesson "CAPM, beta and the security market line" split the risk of a single asset into a systematic part, driven by the market, and an idiosyncratic part. This lesson turns that split into a model for a whole set of assets at once. The model explains why stocks move together, gives every covariance from a handful of numbers, and shows exactly how much risk a portfolio keeps however many stocks it holds.

The number of parameters

The lesson "The efficient frontier and the capital market line" needed the full covariance matrix of the assets. For NNN assets this matrix has NNN variances on the diagonal and N(N−1)/2N(N-1)/2N(N−1)/2 different covariances off the diagonal (the matrix is symmetric, σij=σji\sigma_{ij} = \sigma_{ji}σij​=σji​), so it has

N+N(N−1)2=N(N+1)2N + \frac{N(N-1)}{2} = \frac{N(N+1)}{2}N+2N(N−1)​=2N(N+1)​

separate entries. For 500 stocks that is 500×501/2=125 250500 \times 501/2 = 125\,250500×501/2=125250 numbers to estimate. With a few years of monthly data there are far fewer observations per stock than that, so most of these estimates would be noise. A factor model cuts the number down by assuming that all common movement comes from a few sources.

The single-index model

The simplest factor model uses one factor, the return RMR_MRM​ of a broad market index with volatility σM\sigma_MσM​. Each stock's return is written as

Ri=αi+βiRM+εi,i=1,…,N.R_i = \alpha_i + \beta_i R_M + \varepsilon_i, \qquad i = 1, \dots, N.Ri​=αi​+βi​RM​+εi​,i=1,…,N.

Here βi\beta_iβi​ is the sensitivity of stock iii to the index, αi\alpha_iαi​ is a constant, and εi\varepsilon_iεi​ is the stock's specific (idiosyncratic) return, with mean zero and volatility σε,i\sigma_{\varepsilon,i}σε,i​. The model makes two assumptions:

  • Each εi\varepsilon_iεi​ is uncorrelated with the index: Cov⁡(εi,RM)=0\operatorname{Cov}(\varepsilon_i, R_M) = 0Cov(εi​,RM​)=0.
  • The specific returns of different stocks are uncorrelated with each other: Cov⁡(εi,εj)=0\operatorname{Cov}(\varepsilon_i, \varepsilon_j) = 0Cov(εi​,εj​)=0 for i≠ji \ne ji=j.

The first assumption only defines βi\beta_iβi​ as a regression slope. The second is the real restriction: it says the index is the only reason two stocks move together.

Variances and covariances in the index model

Take the variance of RiR_iRi​. The constant αi\alpha_iαi​ drops out, and because εi\varepsilon_iεi​ is uncorrelated with RMR_MRM​ there is no cross term:

Var⁡(Ri)=βi2σM2+σε,i2.\operatorname{Var}(R_i) = \beta_i^2\sigma_M^2 + \sigma_{\varepsilon,i}^2.Var(Ri​)=βi2​σM2​+σε,i2​.

For two different stocks, covariance is linear in each argument, so expand the product. The terms Cov⁡(RM,εj)\operatorname{Cov}(R_M, \varepsilon_j)Cov(RM​,εj​), Cov⁡(εi,RM)\operatorname{Cov}(\varepsilon_i, R_M)Cov(εi​,RM​) and Cov⁡(εi,εj)\operatorname{Cov}(\varepsilon_i, \varepsilon_j)Cov(εi​,εj​) are all zero by the assumptions, which leaves

Cov⁡(Ri,Rj)=βiβj Cov⁡(RM,RM)=βiβj σM2(i≠j).\operatorname{Cov}(R_i, R_j) = \beta_i\beta_j\,\operatorname{Cov}(R_M, R_M) = \beta_i\beta_j\,\sigma_M^2 \qquad (i \ne j).Cov(Ri​,Rj​)=βi​βj​Cov(RM​,RM​)=βi​βj​σM2​(i=j).

Every entry of the covariance matrix now follows from the betas, the specific volatilities and σM\sigma_MσM​. Counting the numbers that the covariance matrix needs, there are NNN betas, NNN specific volatilities and one market volatility: 2N+12N + 12N+1 parameters instead of N(N+1)/2N(N+1)/2N(N+1)/2. If the alphas are included as well, to describe expected returns, the count is 3N+13N + 13N+1. For 500 stocks that is 1001 risk parameters (1501 with the alphas) instead of 125 250.

Diversification in the index model

A portfolio with weights wiw_iwi​ has return Rp=∑iwiRi=αp+βpRM+∑iwiεiR_p = \sum_i w_i R_i = \alpha_p + \beta_p R_M + \sum_i w_i\varepsilon_iRp​=∑i​wi​Ri​=αp​+βp​RM​+∑i​wi​εi​, where βp=∑iwiβi\beta_p = \sum_i w_i\beta_iβp​=∑i​wi​βi​ is the weighted average beta. The specific returns are uncorrelated with the index and with each other, so

σp2=βp2σM2+∑i=1Nwi2 σε,i2.\sigma_p^2 = \beta_p^2\sigma_M^2 + \sum_{i=1}^{N} w_i^2\,\sigma_{\varepsilon,i}^2.σp2​=βp2​σM2​+i=1∑N​wi2​σε,i2​.

Now take NNN stocks in equal weights wi=1/Nw_i = 1/Nwi​=1/N, all with the same beta β\betaβ and the same specific volatility σε\sigma_\varepsilonσε​. The specific sum has NNN terms of size σε2/N2\sigma_\varepsilon^2/N^2σε2​/N2:

σp2=β2σM2+σε2N  ⟶  β2σM2(N→∞).\sigma_p^2 = \beta^2\sigma_M^2 + \frac{\sigma_\varepsilon^2}{N} \;\longrightarrow\; \beta^2\sigma_M^2 \quad (N \to \infty).σp2​=β2σM2​+Nσε2​​⟶β2σM2​(N→∞).

This is the result of "Diversification and correlation" with a structure filled in. There, the variance of an equally weighted portfolio tended to the average covariance. In the index model every covariance between different stocks is β2σM2\beta^2\sigma_M^2β2σM2​, so the average covariance is exactly the systematic variance, and the volatility can never fall below the systematic floor βσM\beta\sigma_MβσM​.

In the single-index model the specific variance of an equally weighted portfolio is σε2/N\sigma_\varepsilon^2/Nσε2​/N and vanishes as NNN grows. The systematic part βp2σM2\beta_p^2\sigma_M^2βp2​σM2​ does not depend on NNN at all.

The systematic share of variance

The fraction of variance explained by the index is

R2=β2σM2β2σM2+σε2,R^2 = \frac{\beta^2\sigma_M^2}{\beta^2\sigma_M^2 + \sigma_\varepsilon^2},R2=β2σM2​+σε2​β2σM2​​,

the same R2R^2R2 that a regression of the stock on the index reports. For a single stock it equals ρ2\rho^2ρ2, the squared correlation with the index, as in the CAPM lesson. For a typical single stock R2R^2R2 is well below one half; for a portfolio of 20 or more stocks it is usually close to one.

Estimating the index model

The parameters come from the regression already used to estimate beta in "CAPM, beta and the security market line": regress the stock's returns on the index returns over, say, 60 months. The slope is β^i\hat\beta_iβ^​i​, the intercept is α^i\hat\alpha_iα^i​, and the standard deviation of the residuals estimates σε,i\sigma_{\varepsilon,i}σε,i​. That lesson used excess returns; with a constant rfr_frf​ the slope is the same and only the intercept changes. The sample variance of the index gives σM\sigma_MσM​.

The index model and the CAPM

The two look alike but make different kinds of claims. The single-index model is a statistical model: it describes how returns covary, and its key assumption, uncorrelated specific returns, can be checked in the data. It says nothing about what expected returns should be; any value of αi\alpha_iαi​ is allowed. The CAPM is an equilibrium model: from assumptions about investors it concludes that expected excess returns are proportional to beta, so that alpha in the excess-return regression is zero. The CAPM does not need the specific returns to be uncorrelated, and the index model does not need the CAPM to hold. In practice the CAPM supplies the expected returns and the index model the covariance matrix.

Worked example

Let σM=18%\sigma_M = 18\%σM​=18%, β=1\beta = 1β=1 and σε=30%\sigma_\varepsilon = 30\%σε​=30% for every stock. A single stock has variance 0.0324+0.09=0.12240.0324 + 0.09 = 0.12240.0324+0.09=0.1224, a volatility of about 35.0%35.0\%35.0%, and an R2R^2R2 of 0.0324/0.1224≈26.5%0.0324/0.1224 \approx 26.5\%0.0324/0.1224≈26.5%. With 20 stocks in equal weights,

σp2=0.0324+0.0920=0.0369,σp≈19.21%.\sigma_p^2 = 0.0324 + \frac{0.09}{20} = 0.0369, \qquad \sigma_p \approx 19.21\%.σp2​=0.0324+200.09​=0.0369,σp​≈19.21%.

The floor is βσM=18%\beta\sigma_M = 18\%βσM​=18%, and the systematic share is 0.0324/0.0369≈87.8%0.0324/0.0369 \approx 87.8\%0.0324/0.0369≈87.8%. Twenty stocks have removed almost all of the specific risk: the volatility fell from 35% to 19.2%, and only 1.2 percentage points remain above the floor. For 100 stocks the full covariance matrix has 100×101/2=5050100 \times 101/2 = 5050100×101/2=5050 entries, while the index model needs 2×100+1=2012 \times 100 + 1 = 2012×100+1=201 (301 with the alphas).

The figure keeps the market volatility fixed at σM=18%\sigma_M = 18\%σM​=18% and builds an equally weighted portfolio of NNN stocks that all share the same beta and the same specific volatility. The sliders set the average beta β\betaβ (0.5 to 1.5, default 1), the specific volatility (10% to 60%, default 30%) and the number of stocks NNN (1 to 100, default 20). The chart plots portfolio volatility against NNN from 1 to 100 together with the floor βσM\beta\sigma_MβσM​, and a vertical line marks the chosen NNN. The readouts give the portfolio volatility at that NNN, the floor, the systematic share of variance, and the number of parameters for NNN stocks under the full covariance matrix and under the single-index model. Raise the specific volatility to 60% and note how many more stocks it takes to approach the floor: about 25 stocks bring the volatility within one percentage point of 18% at 30%, about 98 at 60%. Then move β\betaβ and watch the floor shift, to 23.4%23.4\%23.4% at β=1.3\beta = 1.3β=1.3.

Portfolio volatility against the number of stocksOpen in CAPM →
1.00
0.51.5
30%
0.10.6
20
1100
Portfolio volatilitySystematic floor βσ_M
Portfolio volatility
19.21%
Systematic floor βσ_M
18.00%
Systematic share of variance
87.8%
Parameters: full / single-index
210 / 41

Multi-factor models

One index rarely explains all common movement: banks move with banks and small firms with small firms, so the specific returns of related stocks are correlated, against the second assumption. A multi-factor model adds more common sources F1,…,FKF_1, \dots, F_KF1​,…,FK​:

Ri=αi+∑k=1KβikFk+εi,R_i = \alpha_i + \sum_{k=1}^{K}\beta_{ik}F_k + \varepsilon_i,Ri​=αi​+k=1∑K​βik​Fk​+εi​,

again with specific returns uncorrelated with the factors and with each other. Collect the loadings βik\beta_{ik}βik​ into an N×KN \times KN×K matrix BBB, the factor covariances into a K×KK \times KK×K matrix ΣF\Sigma_FΣF​, and the specific variances into a diagonal matrix DDD. The same expansion as above gives the covariance matrix of the returns

Σ=B ΣF B⊤+D,\Sigma = B\,\Sigma_F\,B^{\top} + D,Σ=BΣF​B⊤+D,

with NK+K(K+1)/2+NNK + K(K+1)/2 + NNK+K(K+1)/2+N parameters; for 500 stocks and 3 factors that is 2006. The best-known factors are those of Fama and French: besides the market, size (the return of small firms minus large firms) and value (the return of high book-to-market firms minus low book-to-market firms). Carhart added momentum, the return of recent winners minus recent losers. Each such factor is itself the return of a long–short portfolio. Whether these factors are rewards for risk or persistent mispricings is still debated; as a description of covariances they work well.

Summary

  • A full covariance matrix for NNN assets has N(N+1)/2N(N+1)/2N(N+1)/2 entries; factor models replace it with a few parameters per asset.
  • Single-index model: Ri=αi+βiRM+εiR_i = \alpha_i + \beta_i R_M + \varepsilon_iRi​=αi​+βi​RM​+εi​, giving Var⁡(Ri)=βi2σM2+σε,i2\operatorname{Var}(R_i) = \beta_i^2\sigma_M^2 + \sigma_{\varepsilon,i}^2Var(Ri​)=βi2​σM2​+σε,i2​ and Cov⁡(Ri,Rj)=βiβjσM2\operatorname{Cov}(R_i, R_j) = \beta_i\beta_j\sigma_M^2Cov(Ri​,Rj​)=βi​βj​σM2​, with 2N+12N + 12N+1 risk parameters (3N+13N + 13N+1 with alphas).
  • Portfolio variance is βp2σM2+∑iwi2σε,i2\beta_p^2\sigma_M^2 + \sum_i w_i^2\sigma_{\varepsilon,i}^2βp2​σM2​+∑i​wi2​σε,i2​; in equal weights the specific part is σε2/N\sigma_\varepsilon^2/Nσε2​/N and the volatility falls towards the floor βpσM\beta_p\sigma_Mβp​σM​.
  • The index model is a statistical description of covariances; the CAPM is an equilibrium statement about expected returns.
  • Multi-factor models (market, size, value, momentum) give Σ=BΣFB⊤+D\Sigma = B\Sigma_F B^{\top} + DΣ=BΣF​B⊤+D.

The next lesson, "Value at Risk and expected shortfall", turns a portfolio's volatility into a loss level, and a factor covariance matrix is how that volatility is usually computed for large portfolios.

Try itEstimate betas and split systematic from specific risk in the CAPM lab →
2 questions on this lesson at the end of the series →
← PreviousPerformance measures: Sharpe, Treynor, Jensen and information ratioNext →Value at Risk and expected shortfall
Connections
Factor models and systematic risk
Open the full graph →
Labs for this lesson
CAPMPortfolio Lab