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

Issues with return data #378

Open
noobmaster29 opened this issue May 11, 2020 · 1 comment
Open

Issues with return data #378

noobmaster29 opened this issue May 11, 2020 · 1 comment

Comments

@noobmaster29
Copy link

Problem Description

I'm having issues with the returns being calculated. When I run a longer window, more current returns suddenly jump 200% in one day. As seen below in the attached images, if I run from September 2018 to Jan 2020, the daily returns look fairly normal. However, if I open the window to Jan 2018 to Jan 2020, there is a sudden huge jump in Oct 2019. I'm not sure what is causing this. Between the 2 runs, I did not change any variables or data. I only changed the starting date.

Code used to generate the returns:
factor_data = alphalens.utils.get_clean_factor_and_forward_returns(predictive_factor,
pricing,
quantiles=5, #default is 5
bins=None,
groupby=ticker_sector,
groupby_labels=sector_names
)

I've also tried to breakout the return and factor calculations (It produces the same issues):

returns = alphalens.utils.compute_forward_returns(predictive_factor, pricing)
factor_data = alphalens.utils.get_clean_factor(predictive_factor, returns,
quantiles=5, #default is 5
bins=None,
groupby=ticker_sector,
groupby_labels=sector_names)

Screen Shot 2020-05-11 at 7 51 04 PM

Screen Shot 2020-05-11 at 7 41 00 PM

Versions

  • Alphalens version: '0.3.6'
  • Python version: 3
  • Pandas version: '0.22.0'
  • Matplotlib version: '3.0.0'
@noobmaster29
Copy link
Author

I also plotted all the daily returns for all individual assets in the dataset and there doesn't seem to be any difference that would cause the huge jump seen in the cumulative return by quantile graph (Jan 2018 - Jan 2020).

download
download (1)

I will take a look through the source code. Any thoughts on what might be causing this issue is welcomed. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant