Closed dev590t closed 2 years ago
What does your price dataframe look like? Are there any infinities, or data issues?
I have decrease the resolution of input data to bypass the problem.
According cvxpy/cvxpy#1424, even if the input matrix is correct, cvxpy can raise this error. PyPortfolio maybe crash because this bug from cvxpy. That can limit usage of PyPortfolio in some case. Maybe that could be interested Pyportfolio add a psd_wrap protection against it
Currently, decrease the resolution is the only solution possible. This couldn't very practice if user want on higher resolution data.
Thanks for sharing your solution! I'll see if I can catch the error or do a check. In theory, PyPortfolioOpt makes sure that the matrix is positive semidefinite first.
@robertmartin8 I don't exclude the possibility that exist some issue in my data. I haven't check it before I submit the issue. It is also possible that the problem is from my side. But if PyPortfolioOpt do already a check, it could be nice to have a warning for user that the input data has some problem, user can understand why that doesn't run, and solve the issue immediately. And thanks for this very useful library.
Describe the bug Get
scipy.sparse.linalg.eigen.arpack.arpack.ArpackNoConvergence: ARPACK error -1: No convergence
for some input dataCode sample
get
version pyportfolioopt 1.4.1 cvxpy 1.1.18
Additional context According https://github.com/cvxpy/cvxpy/issues/1424, it is a problem from cvxpy. The version 1.1.18 of cvxpy should contain a fix https://github.com/cvxpy/cvxpy/issues/1532. But v1.1.18 doesn't solve my problem. I have try to use psd_wrap to bypass the issue as describe in https://github.com/cvxpy/cvxpy/issues/1424#issuecomment-865967780, but that isn't run for me. I'm not a cvxpy programmer, maybe I don't use in right way. I have change PyPortfolioOpt/pypfopt/base_optimizer.py, line 276: