Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The behavior of get_clean_factor_and_forward_returns in regards to periods is strange. #292

Closed
mmargenot opened this issue Apr 17, 2018 · 4 comments
Assignees
Labels

Comments

@mmargenot
Copy link
Contributor

If I say I want (1, 15, 30) as periods, I occasionally get formatted outputs like:
image

There does not seem to be a firm way to predict whether my period value will be augmented by 1, 2, or more. To have a non-deterministic change like this seems undesirable. Is this expected behavior?

@mmargenot mmargenot changed the title The behavior in get_clean_factor_and_forward_returns in regards to periods is strange. The behavior of get_clean_factor_and_forward_returns in regards to periods is strange. Apr 17, 2018
@luca-s
Copy link
Collaborator

luca-s commented Apr 17, 2018

The days we expect to see reported by Alphalens are trading days but it can be tricky to detect the actual number of trading days since there is no trading calendar passed to Alphalens. There is a logic though that tries to infer the trading calendar and so the actual trading days. This logic probably fails with some input. If there is a way I can replicate the bug I will fix that.

@luca-s luca-s self-assigned this Apr 17, 2018
@luca-s
Copy link
Collaborator

luca-s commented Apr 20, 2018

Just an update. I found out that since Alphalens is not aware of the public holidays the computation of the periods goes wrong. For short periods we don't see the problem because Alphalens performs several tests and it is unlikely that in all those tests there is always a public holiday in between the period. The longer the period the more likely Alphalens fails in detecting the right period length. I will find a solution.

@mmargenot
Copy link
Contributor Author

Nice catch! It definitely seems worse as periods get longer.

luca-s added a commit to luca-s/alphalens that referenced this issue Apr 23, 2018
Since Alphalens is not aware of the public holidays the computation of the
periods goes wrong in certain scenarios.

issue quantopian#292
luca-s added a commit to luca-s/alphalens that referenced this issue Apr 23, 2018
Since Alphalens is not aware of the public holidays the computation of the
periods goes wrong in certain scenarios.

issue quantopian#292
luca-s added a commit to luca-s/alphalens that referenced this issue Apr 23, 2018
Since Alphalens is not aware of the public holidays the computation of the
periods goes wrong in certain scenarios.

issue quantopian#292
luca-s added a commit to luca-s/alphalens that referenced this issue Apr 23, 2018
Since Alphalens is not aware of the public holidays the computation of the
periods goes wrong in certain scenarios.

issue quantopian#292
luca-s added a commit to luca-s/alphalens that referenced this issue Apr 23, 2018
Since Alphalens is not aware of the public holidays the computation of the
periods goes wrong in certain scenarios.

issue quantopian#292
luca-s added a commit to luca-s/alphalens that referenced this issue Apr 23, 2018
Since Alphalens is not aware of the public holidays the computation of the
periods goes wrong in certain scenarios.

issue quantopian#292
luca-s added a commit that referenced this issue Apr 23, 2018
Since Alphalens is not aware of the public holidays the computation of the
periods goes wrong in certain scenarios.

issue #292
@luca-s
Copy link
Collaborator

luca-s commented Apr 23, 2018

Fixed in #295

@luca-s luca-s closed this as completed Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants