Lesson 12 of 15

Single-Factor Model

Single-Factor Model (OLS Regression)

The single-factor model explains an asset's excess return as a linear function of a single factor's excess return:

Rirf=α+β(Rffactorrf)+εR_i - r_f = \alpha + \beta (R_f^{\text{factor}} - r_f) + \varepsilon

This is estimated via Ordinary Least Squares (OLS) regression.

OLS Formulas

Given two series of observations (x, y), the OLS estimates are:

β=t(xtxˉ)(ytyˉ)t(xtxˉ)2\beta = \frac{\sum_t (x_t - \bar{x})(y_t - \bar{y})}{\sum_t (x_t - \bar{x})^2}

α=yˉβxˉ\alpha = \bar{y} - \beta \bar{x}

where we regress excess asset returns (y) on excess factor returns (x).

Application

The factor exposure (beta) tells us how much the asset co-moves with the factor per unit of factor return. The alpha is the return unexplained by the factor.

Your Task

Implement:

  • factor_exposure(asset_returns, factor_returns) — OLS beta of asset returns on factor returns
  • fama_french_alpha(asset_returns, factor_returns, rf) — alpha from regression of excess asset returns on excess factor returns
Python runtime loading...
Loading...
Click "Run" to execute your code.