I'm trying to optimize a portfolio using cvxpy. My original construction is the following:
w = Variable(n)
ret = mu.T * w
risk = quad_form(w, Sigma)
prob = Problem(Maximize(ret), [risk <= .01])
which is just maximize return under some risk constraint. However, I would like to also have a weights/leverage constraint, like the following:
prob = Problem(Maximize(ret), [risk <= .01, sum(abs(w)) <= 1.0])
However, when I add this constraint in many of my weights go to zero and the optimal portfolio is just concentrated in 2-3 assets. This is different from the case without this constraint which results in a much more diversified portfolio. I'm a little confused as to why the weights constraint causes this. Does anyone have any insight?