-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
added beta & alpha #1221
Merged
Merged
added beta & alpha #1221
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
effda1a
added beta & alpha / resolved merge conflict
jensnesten 763e2dc
simplified beta calculation
jensnesten 150845f
Merge branch 'master' into master
jensnesten 8f7c51f
remove DS_store
jensnesten 62a2983
move beta & alpha / use log return
jensnesten 871464e
Update backtesting/_stats.py
jensnesten 65adda0
Update backtesting/_stats.py
jensnesten 6be63bb
alpha & beta test
jensnesten a213d74
#noqa: E501
jensnesten 5abc3d8
add space
jensnesten 52ab559
update docs
jensnesten b03f333
Revert unrelated change
kernc fc6ffc6
Add comment
kernc d486c53
Merge branch 'master' into master
kernc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For given values of
s.loc['Return [%]']
ands.loc['Buy & Hold Return [%]']
, the previous computation ofseemed much more reasonable! Can you explain the discrepancy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LLM suggests, among the less applicable options, that the values are not computed on the same time scale—beta is computed on daily returns and alpha on the whole duration ... 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the 'simple' alpha we first had is absolute alpha, where we simply calculate the absolute difference of our strategy relative to the underlying benchmark. The new calc is risk-adjusted alpha, which is the official definition of alpha, but here we might end up in situations where alpha is positive, despite underperforming the benchmark in terms of return. Especially in beta neutral strategies where beta approaches 0, you'd have situations where the right-most term will go to 0 - essentially signaling very little risk:
when
I personally like the simple alpha calc in this context, because its simple and intuitive. But the alpha we have now is the correct alpha definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I added a source code comment so that we remain aware of this counter-intuitive issue. Hope not too many users get confused by it, or that we eventually get to improve on it.