robertmartin8 / PyPortfolioOpt

Financial portfolio optimisation in python, including classical efficient frontier, Black-Litterman, Hierarchical Risk Parity
https://pyportfolioopt.readthedocs.io/
MIT License
4.24k stars 927 forks source link

Erratic error while running EfficientFrontier #563

Open ck1178 opened 8 months ago

ck1178 commented 8 months ago

When running EfficientFrontier I sometimes get this error message:

cvxpy.error.DCPError: Problem does not follow DCP rules. Specifically: The objective is not DCP. Its following subexpressions are not: QuadForm(var1, [[0.25 0.47] [0.47 0.20]])

This depends on the historical data.S I verified that the data is correct and added solver_options={"warm_start":False} but problem still persists

Here is an example data that causes problem: mu: