# Constraints for a Long-Short Mean Variance Objective Function

### Problem:

I am trying to set up constraints for a long/short mean variance optimization problem. My constraints include:

• beta neutrality

• cash neutrality

• equality constraints on categories: A_categ is a matrix of 1s and 0 and b_categ is a vector 1xn of weights equal to 1/n where n is number of categories.

### Script:

h_pos = cvx.Variable(n)
h_neg = cvx.Variable(n)
h = h_pos-h_neg
Sigma = np.identity(n)

ret = mu.T*h