Skip to content

temporary fix for: Rf rate when not 0 metrics are incorrectly calculated due to dataframe alteration#159

Merged
ranaroussi merged 2 commits intoranaroussi:mainfrom
BartStolarek:temp-fix-for-Rf-rate-report
Jan 22, 2022
Merged

temporary fix for: Rf rate when not 0 metrics are incorrectly calculated due to dataframe alteration#159
ranaroussi merged 2 commits intoranaroussi:mainfrom
BartStolarek:temp-fix-for-Rf-rate-report

Conversation

@BartStolarek
Copy link
Copy Markdown
Contributor

Bug: when rf rate is used the _prepare_benchmark function is called twice before and subtracts the annual rf rate twice from both returns and benchmark data frames.

Temporary fix for issue #158: identity which function calls prepare_returns() and don't allow data frames to be cleaned via the to_excess_returns() function, only for certain functions is it allowed, such as Sharpe and Sortino ratios.

If you would like to see my testing on how i came to this conclusion, please see issue #158

…ted, due to dataframes being unnecessarily updated
@BartStolarek
Copy link
Copy Markdown
Contributor Author

Ran,

This is my first ever pull request, any notes or suggestions on how i can better handle a bug fix in someone elses repo would be of great value to me. Thanks mate!

'Risk-Free Rate %'] = _pd.Series(s_rf)*100 so that it shows in the report as the right percentage (specifically in html report)
@ranaroussi ranaroussi merged commit 2bc9bc0 into ranaroussi:main Jan 22, 2022
ranaroussi added a commit that referenced this pull request Jan 22, 2022
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

Successfully merging this pull request may close these issues.

2 participants