Risk Factor Regressions

Maximilian Wimmer
3 min readMay 15, 2021

--

Asset Pricing and Factor Regressions in Python.

In this articel we explore the key asset pricing models (CAPM, FF3, and FF5) and how to run these models in Python. We will write a function that extracts the risk factor returns from Ken French’s website and runs a CAPM, FF3, and FF5 regression. Furthermore we will take a closer look at the regression results and how to interpret the stats model output.

1. The Asset Pricing Models

1.1. Capital Asset Pricing Model (CAPM)

The CAPM model explains the relationship between systematic risk and the expected return for assets. The CAPM is used for pricing of risky assets, by generating the expected return of the asset given its riskiness. The CAPM model tells us that the return of a risky asset is explained by the market factor.

CAPM Regression Framework

With:

1.2. Fama-French 3-Factor (FF3)

Another very popular asset pricing model in the empirical finance literature is the Fama-French 3-Factor that was published in 1993. Eugene Fama and researcher Kenneth French found that value stocks tend to outperform growth stocks, and that small-cap stocks outperform large-cap stocks. The FF3 mode adds in size and value as risk factors to the model.

FF3 Regression Framework

With:

1.3. Fama-French 5-Factor (FF5)

In 2015 Fama-French added two more ‘quality’ factors to their FF3 model, to make the Fama-French 5 Factor model. The namely profitability (stocks with a high operating profitability perform better) and investment (stocks of companies with high total asset growth have below average returns) factors.

FF5 Regression Framework

With:

2. Risk Factor Regressions in Python

To set up a virtual environment and run a Jupyter-Notebook I recommend you use Anaconda.

2.1. Import Modules

2.2. Functions

We use AMD as an example stock for the risk factor regression.

The output shows that for all three models the market factor (MKT) is statistically significant and positive which means that AMD has significant exposure to market risk. Even when we allow the other risk factors into the model the market risk factor remains significant (as given by the ***). The size factor (SMB) also shows a less positive statistically significant relationship. As shown by the value factor (HML) there is a negative statistically significant relationship. Once we go into the FF5 model we find that RMW and CMA which are profit and investment respectively the factors result in being not statistically significant.

All the code

Sources:

--

--