Open metin-akyol opened 5 years ago
factor_data.groupby(['factor_quantile']).mean()
should equal to al.performance.mean_return_by_quantile(factor_data, demeaned=False)
elif demeaned:
factor_data = utils.demean_forward_returns(factor_data)
else:
factor_data = factor_data.copy()
the parameter demeaned
default True
Problem Description
I am having some issues computing mean returns by quantile with the example of alphalens that is provided in the Quantopian Tutorial (Lesson 4):
https://www.quantopian.com/tutorials/getting-started#lesson4
In particular, the mean_return by quantile function yields different results than if I use Pandas groupby function.