robertmartin8 / PyPortfolioOpt

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

Erratic error while running EfficientFrontier #563

Open ck1178 opened 1 year ago

ck1178 commented 1 year 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: