Skip to content
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

efficient_return raises an unnecessary value error in the long/short case #606

Open
jgerlach93 opened this issue Nov 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jgerlach93
Copy link

Describe the bug
when passing a vector of expected returns with possibly negative values, as desired for the long short case, i guess max_return_value is still wrongly computed as the max(expected_returns), but, should be computed as max(weight_bounds[0] * neg_expected_returns) and max(weight_bounds[1]) * pos_expected_returns) for the differently signed parts of the expected_returns vector

    399 if target_return > self._max_return_value:
--> 400     raise ValueError(
    401         "target_return must be lower than the maximum possible return"
    402     )
    404 update_existing_parameter = self.is_parameter_defined("target_return")
    405 if update_existing_parameter:

ValueError: target_return must be lower than the maximum possible return

Expected behavior
A clear and concise description of what you expected to happen.

Code sample
Add a minimal reproducible example (see here).

Operating system, python version, PyPortfolioOpt version
e.g MacOS 10.146, python 3.7.3, PyPortfolioOpt 1.2.6

Additional context
Add any other context about the problem here.

@jgerlach93 jgerlach93 added the bug Something isn't working label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant