quantopian / empyrical

Common financial risk and performance metrics. Used by zipline and pyfolio.
https://quantopian.github.io/empyrical
Apache License 2.0
1.31k stars 406 forks source link

ENH Add beta_fragility_heuristic and gpd_risk_estimates functions #42

Closed jeyoor closed 5 years ago

jeyoor commented 7 years ago

Hi,

I thought it'd be interesting to add some risk metrics to empyrical for use in zipline/pyfolio.

Here's the papers I used.

I wasn't sure about whether or not docstrings and tests are required for subroutines. (I'm missing some docstrings and tests for subroutines of gpd_risk_estimates.)

If the above are required, please feel free to ping me back and I'll work on adding them.

Thanks!

Jeyan

twiecki commented 7 years ago

Thanks @jeyoor, this looks great. I'll try to take a look next week (traveling).

twiecki commented 6 years ago

Sorry @jeyoor, I completely dropped the ball on this. This looks great, if you solve the merge conflicts we can go ahead and merge this.

jeyoor commented 6 years ago

Hi @twiecki,

No worries; schedule pressure can be tough.

I solved the merge conflicts, but tests are currently failing. I am planning to look into this some more when I have some time.

Tests run fine on quantopian:master so it must be something I added or changed, but it isn't clear to me right now exactly what's causing the tests to fail...

I'll keep you posted on the status.

Thanks!

jeyoor commented 6 years ago

Hi @twiecki,

I think everything passes now.

I wasn't sure if the new functions should be in SIMPLE_STAT_FUNCS or FACTOR_STAT_FUNCS, but they seemed to fit best in FACTOR_STAT_FUNCS so I moved them there.

I look forward to your feedback.

Thanks!

twiecki commented 6 years ago

Thanks for picking this back up! Looks like the merge wasn't quite successful yet. If everything fails, you could from a clean master you cherry-pick your commits, or recreate those functions.

jeyoor commented 6 years ago

Doh! Looks like I accidentally added some merge backup files. EDIT: found and fixed another missed merge file.

How does it look now? Went into the "Files Changed" tab and the diff looks cleaner...

jeyoor commented 6 years ago

Hi @twiecki,

How are the diffs looking after the most recent update?

Thanks!

gusgordon commented 5 years ago

Closing this as it's old. Feel free to reopen if this is still relevant.

jeyoor commented 5 years ago

@gusgordon , Thank you for the reminder on this! I'm a bit slammed at the moment, but once I get some free time I plan to update the branch per the comments and ping you back. Thanks again! Jey

jeyoor commented 5 years ago

Moved to new pull request here https://github.com/quantopian/empyrical/pull/118