Maximizing Profit Subject to a CVaR Constraint? #2830
-
|
UPDATE: This has been solved as part of #2836 Per the title, I'm trying to maximize profit of a portfolio subject to not exceeding a specified CVaR. I'm trying the code below but getting an error when the solution is being inverted. I imagine this is a result of what I'm trying to do, so any advice is appreciated! Code that ErrorsError TracebackEdit: For those finding this in the future and looking for a working example: technically the snippet above doesn't have the right sign convention to properly limit CVaR if the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Update: HiGHs should work for all versions that include #2836 Swapping the solver from My actual problem is larger/more complex than the example shared in this discussion and SCS is infeasibly slow to solve compared to HiGHS, so any advice is appreciated! Edit: Using HiGHS Output (pre-error)SCS OutputSCIPY Output |
Beta Was this translation helpful? Give feedback.
-
|
Final question: I'm still a little confused on how the CVXPY calculated value connects to the actual value, but I think I hacked my way to it below. Ultimately, this code returns the positively signed version of the actual mean CVaR (where negative sign convention = loss). Is this the correct way to think about it? Future edit: I've convinced myself this is correct. Thanks again all of the work on this library! Code |
Beta Was this translation helpful? Give feedback.
Update: HiGHs should work for all versions that include #2836
Swapping the solver from
cp.HIGHStocp.SCSseemed to fix my problem, but now I'm curious why HiGHS is having a problem inverting. The printout suggests it finds the same optimum as SCS, so my naive guess is that it isn't related to the type of problem but something else instead.My actual problem is larger/more complex than the example shared in this discussion and SCS is infeasibly slow to solve compared to HiGHS, so any advice is appreciated!
Edit: Using
cp.SCIPYalso works, and seems to use HiGHS under the hood without any inversion error.HiGHS Output (pre-error)