famafrench.FamaFrench.getPortfolios¶
-
FamaFrench.getPortfolios(self, portLevel, factorsBool, freq, dt_start, dt_end, *args)[source]¶ Generalized routine used to construct datasets containing portfolio returns (which may include factor returns), number of firms in each portfolio, or average anomaly portfolio characteristics at a given frequency and for a given sample period. See subroutines for more details.
- Parameters
portLevel (str) –
Dataset type to construct. Possible choices are:
ReturnsNumFirmsCharacs
factorsBool (bool) –
Flag for choosing whether to construct Fama-French factors or not. If True, then
portLevelmust be one of the following:Returns,NumFirms. Otherwise, it must be one of the following:ReturnsNumFirmsCharacs
freq (str) –
Observation frequency of the portfolios. Possible choices are:
D: dailyW: weeklyM: monthlyQ: quarterly (3-months)A: annual
dt_start (datetime.date) – Starting date for the dataset queried or locally retrieved.
dt_end (datetime.date) – Ending date for the dataset queried or locally retrieved.
dim (list, int, [optional]) – Dimensions for sorting on each element in the list
idList. For example, ifidList = ['ME', 'BM']anddim = [5, 5], then the portfolio sorting strategy is characterized by a bivariate quintile sort on both size and book-to-market.retType (str, [optional]) –
Weighting-scheme for portfolios. Possible choices are:
vw: value-weightsew: equal-weights
- Returns
portTable – Dataset(s) w/ portfolio returns (which may include factor returns), number of firms in each portfolio, or average anomaly portfolio characteristics observed at frequency
freqover sample period fromdt_starttodt_endfor a given portfolio sorting strategy.- Return type