Alpha and multi-factor models

Introduction to Portfolio Risk Management in Python

Dakota Wixom

Quantitative Analyst | QuantCourse.com

The Fama-French 3 factor Model

$$ R_{P} = $$

$$ RF + \beta_{M}(R_{M}-RF)+b_{SMB} \cdot SMB + b_{HML} \cdot HML + \alpha $$

  • SMB: The small minus big factor
  • $b_{SMB}$: Exposure to the SMB factor
  • HML: The high minus low factor
  • $b_{HML}$: Exposure to the HML factor
  • $\alpha $: Performance which is unexplained by any other factors
  • $\beta_{M}$: Beta to the broad market portfolio B
Introduction to Portfolio Risk Management in Python

The Fama-French 3 factor model

Introduction to Portfolio Risk Management in Python

The Fama-French 3 factor model in Python

Assuming you already have excess portfolio and market returns in the object Data:

import statsmodels.formula.api as smf
model = smf.ols(formula='Port_Excess ~ Mkt_Excess + SMB + HML', 
                data=Data)
fit = model.fit()
adjusted_r_squared = fit.rsquared_adj
adjusted_r_squared
0.90
Introduction to Portfolio Risk Management in Python

P-values and statistical significance

To extract the HML p-value, assuming you have a fitted regression model object in your workspace as fit:

fit.pvalues["HML"]
0.0063

To test if it is statistically significant, simply examine whether or not it is less than a given threshold, normally 0.05:

fit.pvalues["HML"] < 0.05
True
Introduction to Portfolio Risk Management in Python

Extracting coefficients

To extract the HML coefficient, assuming you have a fitted regression model object in your workspace as fit:

fit.params["HML"]
0.502
fit.params["SMB"]
-0.243
Introduction to Portfolio Risk Management in Python

Alpha and the efficient market hypothesis

Assuming you already have a fitted regression analysis in the object fit:

portfolio_alpha = fit.params["Intercept"]
portfolio_alpha_annualized = ((1 + portfolio_alpha) ** 252) - 1
portfolio_alpha_annualized
0.045
Introduction to Portfolio Risk Management in Python

Let's practice!

Introduction to Portfolio Risk Management in Python

Preparing Video For Download...