I am trying to solve a problem that involves \sqrt{w^t \Sigma w}
in the objective function. To compute w^t \Sigma w
, I use the quad_form
function. How do I take its square root?
When in the code I try to write
risk = sqrt(quad_form(w, E))
I am getting a DCP rule error but I am pretty sure it is convex given the other constraints I have. So the question is not really about maths but the actual implementation of the convex program.
The problem I am trying to solve is
ret = mu.T*w
risk = sqrt(quad_form(w, E))
gamma.value = distr.pdf(distr.ppf(alpha)) / (1 - alpha)
minimizer = Minimize(-ret + risk * gamma) #cvxpy.sqrt(risk) * gamma)
constraints = [w >= 0,
b.T * log(w) >= k]
prob = Problem(minimizer, constraints)
prob.solve(solver='ECOS_BB',verbose=True)