Path: blob/main/notebooks/published/capm_model/capm_model.ipynb
51 views
Capital Asset Pricing Model (CAPM)
Theoretical Foundation
The Capital Asset Pricing Model (CAPM) is a foundational framework in modern portfolio theory that describes the relationship between systematic risk and expected return for assets. Developed independently by William Sharpe (1964), John Lintner (1965), and Jan Mossin (1966), CAPM provides a method for pricing risky securities and generating expected returns for assets given their risk profile.
The CAPM Equation
The expected return of an asset is given by:
where:
= Expected return of asset
= Risk-free rate
= Beta of asset (systematic risk measure)
= Expected return of the market portfolio
= Market risk premium
Beta Coefficient
The beta coefficient measures the sensitivity of an asset's returns to market returns:
where:
= Covariance between asset returns and market returns
= Variance of market returns
Security Market Line (SML)
The Security Market Line graphically represents the CAPM equation, showing the linear relationship between expected return and beta. Assets plotted above the SML are undervalued (offering excess return for their risk), while those below are overvalued.
Key Assumptions
Investors are rational and risk-averse
Markets are frictionless (no taxes or transaction costs)
All investors have homogeneous expectations
All investors can borrow and lend at the risk-free rate
Assets are infinitely divisible
Single-period investment horizon
Simulating Market and Asset Returns
We generate synthetic return data for the market portfolio and individual assets with varying beta exposures. The returns follow a factor model structure:
where represents idiosyncratic risk.
Beta Estimation via OLS Regression
We estimate beta coefficients using Ordinary Least Squares regression of asset returns on market returns:
Expected Returns and the Security Market Line
Using the estimated betas, we compute expected returns according to CAPM and compare them with realized returns to identify potential mispricings.
Visualization: Security Market Line
The Security Market Line (SML) plots expected return against beta, with the slope equal to the market risk premium.
Portfolio Beta and Expected Return
For a portfolio of assets with weights , the portfolio beta is:
And the expected portfolio return follows:
Limitations and Extensions
CAPM Limitations
Single-factor model: Only considers market risk, ignoring size, value, momentum factors
Unrealistic assumptions: Perfect markets, homogeneous expectations
Static beta: Assumes constant risk exposure over time
Empirical challenges: Low-beta anomaly, beta instability
Modern Extensions
Fama-French Three-Factor Model: Adds size (SMB) and value (HML) factors
Carhart Four-Factor Model: Adds momentum factor
Fama-French Five-Factor Model: Adds profitability and investment factors
Conditional CAPM: Time-varying betas based on economic conditions
Applications
Cost of equity estimation for corporate finance
Performance attribution and benchmark comparison
Risk management and portfolio construction