Skip to content

Conversation

@dpapakyriak
Copy link
Contributor

I implemented an initial attempt for the sorting ratio, as asked in issue #401. In order to achieve this, I initially implemented a function to calculate the downside deviation for all assets. Then, I made the sorting_ratio() function to return the sorting ratio for a given portfolio. This is a draft, please review and contact me via email to fix any issues and/or any additional documentation.

@robertmartin8
Copy link
Collaborator

I'm not merging this for now for a couple of reasons:

  1. I think there are probably much more efficient vectorised ways of computing downside deviation, something along the lines of a[a<thresh].std().
  2. Variable name conventions: PyPortfolioOpt uses snake_case as per PEP8

@chriss1245
Copy link

Is there any update related to this topic?
I consider this feature may be very interesting

@tschm
Copy link
Contributor

tschm commented Nov 12, 2025

@fkiraly please close. For that purpose there are packages such as quantstats or jquantstats. Minimizing the semi variance is a different beast which is not solved here. This can be done though with cvxpy.

@fkiraly
Copy link
Collaborator

fkiraly commented Nov 14, 2025

@tschm, can you provide your reasoning why this feature does not beling in pyportfolioopt?

It seems topical to me.

Maybe there is a wider scope discussion to be had.
(of course the PR has some issues that need to be resolved but the scope discussion is perhaps to be had first)

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.

5 participants