Coder Social home page Coder Social logo

Speed up the solver() about riskfolio-lib HOT 11 CLOSED

dcajasn avatar dcajasn commented on May 22, 2024
Speed up the solver()

from riskfolio-lib.

Comments (11)

dcajasn avatar dcajasn commented on May 22, 2024

Hi @lemon234071,

It depends on the solver that you choose. To reduce computation time is better to use a commercial solver like GUROBI, CEPLEX or MOSEK. All of them offer academic licenses, but personally I prefer MOSEK because its academic license is less restrictive and also supports all kind of cones. On the other hand, for linear models GUROBI is a little faster in academic version but has more restrictions in the number of variables and constraints.

Best,
Dany

from riskfolio-lib.

lemon234071 avatar lemon234071 commented on May 22, 2024

Hi @lemon234071,

It depends on the solver that you choose. To reduce computation time is better to use a commercial solver like GUROBI, CEPLEX or MOSEK. All of them offer academic licenses, but personally I prefer MOSEK because its academic license is less restrictive and also supports all kind of cones. On the other hand, for linear models GUROBI is a little faster in academic version but has more restrictions in the number of variables and constraints.

Best, Dany

I found that the rp.Portfolio() has the default self.solvers = ["ECOS", "SCS", "OSQP", "CVXOPT"].
So, all i need to do is change it like self.solvers = ["MOSEK"] ? Will there any hidden danger?

from riskfolio-lib.

dcajasn avatar dcajasn commented on May 22, 2024

I use these solvers by default because are open source and are installed by default with CVXPY.
Yes, that's the idea but first you must install MOSEK and get an academic license in its website. If you see Entropic Value at Risk tutorial, I use MOSEK to reduce computation time.

from riskfolio-lib.

lemon234071 avatar lemon234071 commented on May 22, 2024

Thank you first, i just tried MOSEK with just pip install MOSEK . It faster but it return the None solution while other solvers return a weights....

from riskfolio-lib.

dcajasn avatar dcajasn commented on May 22, 2024

It's because you need a valid license. In riskfolio-lib install instructions are the links to get an academic license.

from riskfolio-lib.

lemon234071 avatar lemon234071 commented on May 22, 2024

Thank you very much i ll try it.

from riskfolio-lib.

lemon234071 avatar lemon234071 commented on May 22, 2024

It works thank you very much, btw, did you try the Cvxpylayers on GPU? Would it be faster???

from riskfolio-lib.

dcajasn avatar dcajasn commented on May 22, 2024

No, I didn't try cvxlayers. I use a Macbook air, so I don't have a GPU to try cvxlayers, but based on the information I read on papers, blogs and forums; commercial solvers like GUROBI, CPLEX, XPRESS and MOSEK are the best.

from riskfolio-lib.

lemon234071 avatar lemon234071 commented on May 22, 2024

Thank you very much!

from riskfolio-lib.

lemon234071 avatar lemon234071 commented on May 22, 2024

Hello there, me again! Thank you for your time first!

I still have some problems with the speed:

1, With constraints "upperlng“ and “nea”, my problem should be solved with numerical methods.
Do the different objective functions heavily affect the speed?
(i mean I saw that optimization of sharpe is realized by minimizing the risk with constraints. I mean do the different forms of the function with constraints will be solved by different methods detected by mosek?).
2, Do the parameters of Mosek affect the speed and the performance? (i mean in self.sol_params)

My sincerest thanks!
Best wishes!

Some info with cvxpy
2cfc64328c420bb16bcaf4cb126d876

from riskfolio-lib.

dcajasn avatar dcajasn commented on May 22, 2024
  1. Yes
  2. Yes

from riskfolio-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.