Git Product home page Git Product logo

Comments (7)

rluce avatar rluce commented on September 24, 2024

I like it. I think it won't harm much if the nup function allows for either the variance-covariance matrix, or its factor.

from gurobi-optimods.

rluce avatar rluce commented on September 24, 2024

Maybe we should complement this Nup with a minimum variance portfolio selection (you'd minimize "just" x @ Q @ X), or can this be covered by some paramters in this Nup already?

from gurobi-optimods.

rluce avatar rluce commented on September 24, 2024

I think we (@etowle, @silkehorn, and myself) should team up and create a small variety of base models in the financial space. This one and #9 are the first two on the list, but they would share the interface (and implementation) of the extra gadgets (min. buy-in, max. allocations, etc.). We may be even able to integrate the online-problem (you start with an existing allocation) into each formulation. A third variation may be needed for minimizing a tracking error.

from gurobi-optimods.

ChinSquared avatar ChinSquared commented on September 24, 2024

I would love to see the best way to include these in a multi-objective problem. Sharpe, TE, MV, etc...How would you link the y world and x in an efficient and convex way using the built in multi-objective method?

from gurobi-optimods.

simonbowly avatar simonbowly commented on September 24, 2024

Hi @ChinSquared, could you please elaborate on what you mean here? Gurobi allows you to combine objectives either as a weighted sum, or in a hierarchical manner using priorities. Which are you looking for, and for which metrics?

from gurobi-optimods.

ChinSquared avatar ChinSquared commented on September 24, 2024

Sure, for example, if you specify a hierarchical objective, first is to max Sharpe with a budget of 20 bps. Then minimize tracking error as the second objective. Other constraints in the portfolio are active like max trade, step size, max positions. Thanks!

from gurobi-optimods.

etowle avatar etowle commented on September 24, 2024

To incorporate other performance metrics into the Sharpe ratio model and retain convexity, these other metrics would have to be modeled in the space of the y variables (the reformulated variable space used in the Sharpe ratio model). This is because:

  • The Sharpe ratio model is only convex in the space of the y variables
  • We can't simultaneously model some metrics in the x-variable space and others in the y- variable space, unless we link together the x and y variables with the non-convex constraints x = y / (e^T y)

At any rate, I fear a multi-objective, multiple-metric model with side constraints is outside the scope of what this Mod is trying to accomplish. That said, you could always use the Sharpe ratio model-building code as a starting point for building a more complex model:

def _max_sharpe_ratio_numpy(cov_matrix, mu, rf_rate, create_env):
with create_env() as env, gp.Model("sharpe_ratio", env=env) as model:
y = model.addMVar(mu.size, name="y")
model.addConstr((mu - rf_rate) @ y == 1)
model.setObjective(y @ cov_matrix @ y, sense=GRB.MINIMIZE)
model.optimize()
# Translate solution to original variable space
x = y.X / y.X.sum()
ret = mu @ x
risk = x @ cov_matrix @ x
sharpe_ratio = (ret - rf_rate) / math.sqrt(risk)
return SharpeRatioResult(x, sharpe_ratio, ret, risk)

from gurobi-optimods.

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.