Repository navigation
Apply fully-invested risk lower bound only to fully-invested portfolios - #770
Open
kadyrbekovhamit-cyber wants to merge 1 commit into
Open
kadyrbekovhamit-cyber wants to merge 1 commit into
kadyrbekovhamit-cyber wants to merge 1 commit into
Conversation
Signed-off-by: kadyrbekovhamit-cyber <288885044+kadyrbekovhamit-cyber@users.noreply.github.com>
|
I checked out this branch (Python 3.12, cvxpy 1.9.3) and ran the two-asset case from the description with Two things I'd add tests for, since the precheck was the only thing that stopped some bad inputs early:
The |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
efficient_risk(..., market_neutral=True)currently applies the sum(weights)=1 global-minimum-volatility lower bound before solving the sum(weights)=0 problem. That rejects feasible low-risk neutral portfolios.For returns
[.1,0], covariance.04*I, bounds(-1,1)and target volatility.05, weights[.05/sqrt(.08),-.05/sqrt(.08)]are feasible and analytically optimal. The current precheck rejects them because the fully-invested lower bound is sqrt(.02).Apply that precheck only when
market_neutral=False; the solver still evaluates all user constraints. Tests cover three low-risk targets, updating the target parameter, preservation of the fully-invested rejection and a genuinely infeasible neutral constraint.Validation: original regressions 5 failed / 1 passed; patched efficient-frontier module plus regressions 77 passed / 4 skipped. Main a6638d2; Python 3.12, cvxpy 1.9.3. Related #569 discusses minimum-volatility rejections but does not supply this market-neutral counterexample; #362 concerns sector constraints, which this patch does not change.
AI-assisted investigation and patch; numerical work was sequential and single-threaded. This is a feasibility-check correction, not a claim about production portfolios.