January 2020
Beginner to intermediate
432 pages
11h 24m
English
Follow these steps to implement the three-factor model in Python.
import pandas as pdimport yfinance as yfimport statsmodels.formula.api as smf
!wget http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Research_Data_Factors_CSV.zip!unzip -a F-F_Research_Data_Factors_CSV.zip!rm F-F_Research_Data_Factors_CSV.zip
RISKY_ASSET = 'FB'START_DATE = '2013-12-31'END_DATE = '2018-12-31'
factor_df = pd.read_csv('F-F_Research_Data_Factors.csv', skiprows=3) STR_TO_MATCH = ' Annual Factors: January-December ' indices = factor_df.iloc[:, 0] == STR_TO_MATCH ...
Read now
Unlock full access