cvxportfolio
cvxportfolio copied to clipboard
Feature request: Add constraint priority with automatic resolution into soft-constraints
Rationale Only primal infeasibility benefits from managing the problem formulation. Dual infeasibility (unboundedness) is typically due to bugs in the user syntax. Primal infeasibility instead should have an automatic exception handling procedure.
Idea is simple; use the order of constraints provided by the user as priority, and add an option to SPO/MPO to automatically try to turn each constraint into soft-constraint, starting from the lowest priority one, in case of infeasibility. Option could be the soft-constraint multiplier, by default plus infinity (meaning don't use this procedure).
All pieces should be there, I think the way I factored the compile_to_cvxpy
code separate from initialize_estimator
should make this really easy and self-contained, as well as how I designed the constraint base classes. It needs a deep look into all pieces to make sure there is no implicit assumption that the method execution order is the default one, but it probably is all fine.