Introduction to Portfolio Risk Management in Python
Dakota Wixom
Quantitative Analyst | QuantCourse.com
The original paper that started it all:
A paper published later by Cliff Asness from AQR:
In 2015, Fama and French extended their previous 3-factor model, adding two additional factors:
The RMW factor represents the returns of companies with high operating profitability versus those with low operating profitability.
The CMA factor represents the returns of companies with aggressive investments versus those who are more conservative.
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 + RMW + CMA',
data=Data)
fit = model.fit()
adjusted_r_squared = fit.rsquared_adj
adjusted_r_squared
0.92
Introduction to Portfolio Risk Management in Python