famafrench.FamaFrench.getPortfolioReturns¶
-
FamaFrench.
getPortfolioReturns
(self, factorsBool, dt_start, dt_end, *args)[source]¶ Construct dataset w/ portfolio returns (which may include factor returns) at a given frequency and for a given sample period.
- Parameters
factorsBool (bool) – Flag for choosing whether to construct Fama-French-style factor returns or not.
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.
pDim (list, int, [optional]) – Dimensions for sorting on each element in the list
self.sortCharacsId
.pRetType (str, [optional]) –
Weighting-scheme for portfolios. Possible choices are:
vw
: value-weightsew
: equal-weights
- Returns
portRetTable – Dataset w/ portfolio returns observed at frequency
self.freqType
over sample period fromdt_start
todt_end
for a given portfolio sorting strategy.- Return type
Note
Portfolios require anomaly characteristics from the last fiscal year. To get non-missing observations starting on date
dt_start
, we construct portfolios using a startdate that is two/three years prior todt_start
. We then slice the resulting pandas.DataFrames starting w/dt_start
.