[SciPy-User] quadratic programming with fmin_slsqp

josef.pktd at gmail.com josef.pktd at gmail.com
Wed Mar 21 09:51:53 EDT 2012


On Tue, Mar 20, 2012 at 7:58 AM, denis <denis-bz-gg at t-online.de> wrote:
>
> On Mar 16, 5:45 pm, josef.p... at gmail.com wrote:
>> scipy is missing a fmin_quadprog
>
> Josef,
>  minmize()  is a reasonable common interface to 10 or so optimizers,
> see http://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html
> however
> - minimize.py is not in scipy-0.9.0.tar nor in scipy-0.10.1.tar
>    (a test to see if anybody's using it ?)
> - only L-BFGS-B TNC COBYLA and SLSQP support bounds.
>
> One could supply a trivial box / penaltybox as outlined below
> (I use this playing around with Neldermead)
> but I'm not sure anybody would use it
> plus there's openopt pyomo mystic ...
> maybe more solvers than real testcases :-
>
> cheers
>  -- denis
>
>
> class Funcbox:
>    """ F = Funcbox( func, [box=(0,1), penalty=None, grid=0,
> *funcargs, **kwargs
>        wraps a func() with a constraint box and grid
>
>    Parameters
>    ----------
>    func: a function of a numpy vector or array-like
>    box: (low, high) to np.clip, default (0,1).
>        These can be vectors; low_j == high_j freezes x_j at that
> value.
>    penalty: e.g. (0, 1, 1000) adds a quadratic penalty
>        to func() where xclip is outside (0, 1)
>            1000 * sum( max( 0 - x, 0 )**2 + max( x - 1, 0 )**2 )
>            = 1 4 9 16 ... at -.01 -.02 ... and 1.01 1.02 ...
>        The default is None, no penalty.
>        (The penalty box should be smaller than the clip box;
>        x is first gridded if grid > 0, then clipped, then penalty
> computed.)
>    grid: e.g. .01 snaps all x_j to multiples of .01 --
>        a simple noise smoother, recommended for noisy functions.
>        The default is 0, no gridding.
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user

What I meant was, getting a high level interface that can be used as
in other packages

http://stats.stackexchange.com/questions/15741/matlabs-quadprog-equivalent-in-python

http://www.mathworks.com/help/toolbox/optim/ug/quadprog.html
http://svitsrv25.epfl.ch/R-doc/library/quadprog/html/solve.QP.html
http://abel.ee.ucla.edu/cvxopt/userguide/coneprog.html#quadratic-programming

scikits.datasmooth is using cvxopt for it

fmin_slsqp "sounds" similar

Josef



More information about the SciPy-User mailing list