Lesson 9 of 15

Beta & Alpha

Beta & Alpha (CAPM)

The Capital Asset Pricing Model (CAPM) decomposes an asset's return into market exposure and excess return:

rasset=α+βrmarket+ϵr_{asset} = \alpha + \beta \cdot r_{market} + \epsilon

Beta measures systematic risk — how much the asset moves with the market: β=Cov(rasset,rmarket)Var(rmarket)\beta = \frac{\text{Cov}(r_{asset}, r_{market})}{\text{Var}(r_{market})}

  • β>1\beta > 1: more volatile than market (amplifies moves)
  • β<1\beta < 1: less volatile than market (dampens moves)
  • β<0\beta < 0: moves opposite to market (hedge)

Alpha is the excess return not explained by market exposure: α=rˉassetrfβ(rˉmarketrf)\alpha = \bar{r}_{asset} - r_f - \beta (\bar{r}_{market} - r_f)

A positive alpha means the asset outperformed the CAPM prediction — the manager "added value."

Your Task

Implement:

  • beta(asset_returns, market_returns) — CAPM beta
  • alpha(asset_returns, market_returns, rf=0.0) — CAPM alpha
Python runtime loading...
Loading...
Click "Run" to execute your code.