famafrench.FamaFrench.getNyseThresholdsAndRet¶
-
FamaFrench.getNyseThresholdsAndRet(self, idList, factorsBool, freq, dt_start, dt_end, *args)[source]¶ Select NYSE stocks used in the construction of breakpoints (ie thresholds) for portfolio sorting. Selection occurs at a given frequency and for a given sample period.
- Parameters
idList (list, str) – List of factors or list of anomaly portfolio characteristics whose naming convention is consistent w/ earlier described conventions.
factorsBool (bool) – Flag for choosing whether to construct Fama-French factors or not. If False, then
dim(w/ or w/out a value forretType) must be passed as additional argument(s), otherwise these additional arguments are not passed.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
dfportSort_tableList (pandas.DataFrame, or dict, pandas.DataFrame) –
Dataset(s) providing one of the following:
Time-series of Fama-French-style factors.
Panel data consisting of portfolios sorted on specific anomaly characteristics w/ the corresponding:
portfolio returns
number of firms in each portfolio
Observation frequency is given by
freq. Sample period is fromdt_starttodt_end. Rows index time periods, columns index the factors or portfolios.dfportSort_characs (pandas.DataFrame, or dict, pandas.DataFrame) – Dataset providing average anomaly characteristics for each portfolio sorted on a specific set anomaly characteristics. The anomaly characteristics used to sort portfolios NEED NOT coincide w/ the average anomaly characteristics calculated for each portfolio. Observation frequency is given by
freq. Sample period is fromdt_starttodt_end. Rows index time periods, columns index the portfolios.