
Python for Finance

Before discussing the Fama-French three-factor model and other models, let's look at a general equation for a three-factor linear model:
Here, y is the dependent variable, α is the intercept, x1, x2, and x3 are three independent variables, β1, β2 and β3 are three coefficients, and ε is a random factor. In other words, we try to use three independent variables to explain one dependent variable. The same as a one-factor linear model, the graphical presentation of this three-factor linear model is a straight line, in a four-dimensional space, and the power of each independent variable is a unit as well. Here, we will use two simple examples to show how to run multifactor linear regression. For the first example, we have the following code. The values have no specific meaning and readers could enter their own values as well:
from pandas.stats.api import ols import pandas as pd y = [0.065, 0.0265, -0.0593, ...
Change the font size
Change margin width
Change background colour