quantopian / empyrical

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

TST Add test for inf Sharpe #93

Closed gusgordon closed 6 years ago

richafrank commented 6 years ago

Looks like a nice addition to me, so we can know what to expect. Any thoughts @llllllllll ?

llllllllll commented 6 years ago

Is inf the desired value? If so, this seems good.

gusgordon commented 6 years ago

Yeah - spoke with Thomas about it and he was also OK with it being inf. The nan value is unreliable anyways due to float error, eg ep.sharpe_ratio([1, 1, 1, 1, 1]) is inf but ep.sharpe_ratio([0.1, 0.1, 0.1, 0.1, 0.1]) is a large number.