Closed Ann-eat-apple closed 2 years ago
Hi,
Could you try the following:
pip install ecos scs osqp
etc)EfficientFrontier(mu, S)
).verbose=True
as suggested by the error message and post back here. If the problem persists, could you please share more information about what environment you're using (operating system, python version, pyportfolioopt version) and how you installed.
Cheers, Robert
ECOS 2.0.7 - (C) embotech GmbH, Zurich Switzerland, 2012-15. Web: www.embotech.com/ECOS
It pcost dcost gap pres dres k/t mu step sigma IR | BT
0 -2.513e+13 -6.197e+29 +3e+32 9e-01 6e+00 1e+00 2e+30 --- --- 1 1 - | - -
Slacks/multipliers leaving the cone, recovering best iterate (0) and stopping.
NUMERICAL PROBLEMS (reached feastol=6.1e+00, reltol=1.3e+19, abstol=3.4e+32)./Users/anne/miniconda3/envs/tf_new/lib/python3.8/site-packages/PyPortfolioOpt-1.2.7-py3.8.egg/pypfopt/risk_models.py:68: UserWarning: The covariance matrix is non positive semidefinite. Amending eigenvalues.
/Users/anne/miniconda3/envs/tf_new/lib/python3.8/site-packages/PyPortfolioOpt-1.2.7-py3.8.egg/pypfopt/risk_models.py:88: UserWarning: Could not fix matrix. Please try a different risk model.
ECOS 2.0.7 - (C) embotech GmbH, Zurich Switzerland, 2012-15. Web: www.embotech.com/ECOS
It pcost dcost gap pres dres k/t mu step sigma IR | BT
0 +2.513e+13 -0.000e+00 +1e+30 9e-01 5e-08 1e+00 7e+27 --- --- 1 1 - | - -
Slacks/multipliers leaving the cone, recovering best iterate (0) and stopping.
NUMERICAL PROBLEMS (reached feastol=9.1e-01, reltol=nan, abstol=1.1e+30).Solver 'ECOS' failed. Try another solver, or solve with verbose=True for more information.
@robertmartin8
The problem appears to be in your covariance matrix. Could you check that all of your input data is ok? I.e no missing data or infinite returns etc
Closing due to inactivity. Often, these types of issues are due to data problems (e.g missing data, infinite returns).
What are you trying to do? Clear description of the problem you are trying to solve with PyPortfolioOpt
I tried the following:
Solver 'ECOS' failed. Try another solver, or solve with verbose=True for more information.
Is there any thing that I can do to get a less accurate solution? (and get rid of this error).
What have you tried?
I also tried QRPS and other cvxpy optimizer, problem still persist.
What data are you using? What asset class, how many assets, how many data points. Preferably provide a sample of the dataset as a csv attachment.