robertmartin8 / PyPortfolioOpt

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

for singular matrix portfolio optimization #434

Closed anchitshrivastava closed 2 years ago

anchitshrivastava commented 2 years ago

Sometimes, we get a Singular Matrix error in case we have a very stable asset such as USD. To solve this error we can simply use pinv from NumPy instead of inv. Please refer to the research paper below for more details.

https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.401.9163&rep=rep1&type=pdf