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

Add the assume_PSD flag in calls to cvxpy.quad_form #543

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AveryLevin
Copy link

@AveryLevin AveryLevin commented Jun 28, 2023

Resolves an issue where ArpackNoConvergence errors were being raised by CVXPY when trying to optimize large portfolios. This error is raised when CVXPY checks if the given matrix is Positive Semi-Definite, calling scipy.sparse.linalg.eigsh to determine if the min eigenvalue is negative, which uses Arnoldi Iteration. However, CVXPY relies on SciPy's default maxiter argument for eigsh which is simply the matrix's dimension multiplied by 10 which can fail to converge when checking larger matrices.

Since the covariance matrices being sent to CVXPY are already checked/corrected for PSD in fix_nonpositive_semidefinite, we can use the assume_PSD flag when calling cp.quad_form to prevent these errors from being raised.

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.

ArpackNoConvergence: ARPACK error -1: No convergence (951 iterations, 0/1 eigenvectors converged)
2 participants