[SciPy-user] constrained optimization

John Hunter jdh2358@gmail....
Mon Apr 28 13:34:24 CDT 2008

I need to do a N dimensional constrained optimization over a weight w
vector with the constraints:

  * w[i] >=0

  * w.sum() == 1.0

Scanning through the scipy.optimize docs, I see a number of examples
where parameters can be bounded by a bracketing interval, but none
where constraints can be placed on combinations of the parameters, eg
the sum of them.  One approach I am considering is doing a bracketed
[0,1] constrained optimization over N-1 weights (assigning the last
weight to be 1-sum others) and modifying my cost function to punish
the optimizer when the N-1 input weights sum  to more than one.

Is there a better approach?


More information about the SciPy-user mailing list