Greetings,
Imagine I have the following factors and would like to weight them unequally (number in () indicates weight):
- EPS_Growth_3M (10%)
- Mean_Reversion_1M (20%)
- Price_Momentum_12M (20%)
- Price_To_Forward_Earnings (15%)
- ForwardPEvsSector (15%)
- ForwardPEvsIndustry (20%)
I've written/borrowed the following code in research:
# Market Cap
class Market_Cap(CustomFactor):
...
# Forward Price to Earnings Ratio (MORNINGSTAR)
class Price_To_Forward_Earnings(CustomFactor):
...
# 3-month EPS Growth
class EPS_Growth_3M(CustomFactor):
...
# 12-month Price Rate of Change
class Price_Momentum_12M(CustomFactor):
...
# 1-month Mean Reversion
class Mean_Reversion_1M(CustomFactor):
...
def filter_universe():
...
pipe = Pipeline(
columns={
'Price_To_Forward_Earnings': Price_To_Forward_Earnings(),
'EPS_Growth_3M': EPS_Growth_3M(),
'Price_Momentum_12M': Price_Momentum_12M(),
'Mean_Reversion_1M': Mean_Reversion_1M(),
'morningstar_industry_group_code': asset_classification.morningstar_industry_group_code.latest,
'morningstar_sector_code': asset_classification.morningstar_sector_code.latest
},
screen=filter_universe()
)
results = run_pipeline(pipe, '2014-01-01', '2014-06-30')
results = results.fillna(value=0.0)
sector_forward_pe = results.groupby(['morningstar_sector_code'])['Price_To_Forward_Earnings'].mean()
results['sector_forward_pe'] = results['morningstar_sector_code'].map(sector_forward_pe)
industry_forward_pe = results.groupby(['morningstar_industry_group_code'])['Price_To_Forward_Earnings'].mean()
results['industry_forward_pd'] = results['morningstar_industry_group_code'].map(industry_forward_pe)
results['ForwardPEvsSector'] = results['Price_To_Forward_Earnings']/results['sector_forward_pe']
results['ForwardPEvsIndustry'] = results['Price_To_Forward_Earnings']/results['industry_forward_pd']
At which point (and how) do I weight the various factors? I can't just apply the weights to the raw values (can I?). Do I rank them first then weight the rank before combining?
Comments, resources or other posts are gratefully appreciated.