L1 Norm Constraint in Maximum-Sharpe-Ratio Portfolio
Dear Gurobi Community,
I successfully implemented a Minimum-Variance Portfolio with L1 Norm Constraint in order to control the short selling budget (e.g. to create a 130/30 long short strategy). Doing so, I chose to linearize the L1 Norm Constraint for subsequent representation purposes.
However, I am struggling now to transfer the linearized L1 Norm Constraint to a Maximum-Sharpe-Ratio Portfolio, because of the conversion which is necessary to optimize the portfolio in Gurobi, see:
https://support.gurobi.com/hc/en-us/community/posts/360074491212-Divisor-must-be-a-constant
I was able to model the Maximum-Sharpe-Ratio Portfolio with Short Selling Constraint due to Eli's awesome explanation, but does anyone know how to do the conversion in case of a linearized L1 Norm Constraint in Gurobi? All of my attempts failed so far.
The following displays the optimization problem and its corresponding conversion on paper:
The following displays a code snippet of my current approach to a Maximum-Sharpe-Ratio Portfolio with Short Selling Constraint in Python/Gurobi and serves as my starting point I'd like to augment for the linearized L1 Norm Constraint:
N = returns.shape[1] # number of assets
S = returns.cov().to_numpy() # covariance matrix
mu = returns.mean().to_numpy() # expected returns
A = mu
b = np.array([1])
C = np.identity(N)
d = np.repeat(0,N)
model = gp.Model("MaxSharpeSSC")
y = model.addMVar((N,), lb=-gp.GRB.INFINITY)
model.setObjective(y @ S @ y, gp.GRB.MINIMIZE)
model.addConstr(A @ y == b)
model.addConstr(C @ y >= d)
model.update()
model.optimize()
print(y.X)
Any ideas would be much appreciated.
Best Regards,
Dominik
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
Post is closed for comments.
Comments
1 comment