[SciPy-user] Minimize a bounded convex function

Anne Archibald peridot.faceted@gmail....
Thu Oct 18 21:04:22 CDT 2007

On 18/10/2007, Geoffrey Zhu <zyzhu2000@gmail.com> wrote:

> I am trying to minimize a convex function f(x) that is not defined
> when x<=0 or when x>=1.5. I am trying to use scipy.optimize.golden(),
> but when the minimal point is very close to zero, golden() will call
> my target function on the undefined region. Is there any way to ensure
> that the optimizer will only look for answers within the domain?

There's one open interval that many optimizers can handle, namely the
real line. You can try transforming your x coordinate so that (for
example) x = (tanh(w)+1)*0.75 and then minimizing as a function of w.
This probably doesn't preserve convexity (though it should not
introduce any local minima), but it means that you can use unbounded
minimization and avoid the endpoints.


More information about the SciPy-user mailing list