I'm using scipy.optimize.minimize
's COBYLA method to find a matrix of parameters for a categorical distribution. I need to impose the constraint that each parameter is greater than zero, and that the sum of the rows of the parameter matrix is a column of ones.
It's not clear to me how to implement this in scipy.minimize
, because the constraints are checked for non-negativity rather than truth. The minimization raises an exception if I just pass the arrays as the constraint.
Does anyone know how to go about implementing these kinds of constraints?