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

Investigate adding support for different frequencies of data #357

Open
gusgordon opened this issue Dec 8, 2016 · 1 comment
Open

Investigate adding support for different frequencies of data #357

gusgordon opened this issue Dec 8, 2016 · 1 comment

Comments

@gusgordon
Copy link
Contributor

Currently, we only officially support daily returns and positions streams. Some tear sheets and plots work okay with other frequencies of data (e.g. monthly). Other plots and performance functions, namely the beta and Fama-French factors, will fail to compute accurate measures because they compare their daily reference data to whatever is thrown at them.

It would definitely be useful to support different frequencies if we can do it in a way that's elegant. I'm not sure what the best way to do this is, open for input and help.

@gusgordon gusgordon changed the title Add support for different frequencies of data Investiage adding support for different frequencies of data Dec 8, 2016
@gusgordon gusgordon changed the title Investiage adding support for different frequencies of data Investigate adding support for different frequencies of data Dec 8, 2016
@eigenfoo
Copy link
Contributor

@kitovh has expressed interest in looking into this! Duplicate of #456.

I took a cursory glance at the code, and this issue looks like it'll take more reading than writing code. Unfortunately I'm not free right now to whip up a PR, but I'd be happy to help anyone who wants to take this up.

  • Most of pyfolio's output is a matplotlib graph. The easiest thing to do would be to use pandas' built-in plotting capabilities, and do something like returns.plot(), and then adding legends, colors, etc. afterwards if necessary. This way, all graphs will have x tick labels with the correct time period. It looks like most pyfolio functions are already doing this, but it would be good to make sure they all did.
  • Most of the summary stats are simply call-throughs to empyrical. Luckily for us, empyrical already supports different time periods, and it's only a matter of making sure pyfolio sets the right flags. The nicest thing to do would be to make pyfolio smart enough to read the freq argument of the DatetimeIndex in the input dataframes.
  • There might be some other problems that I'm not anticipating... Particularly the perfomance attribution and Bayesian tear sheets, since they perform statistical analyses that assume daily frequency.

Thoughts?

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

No branches or pull requests

2 participants