[SciPy-User] maximization functions

Alan G Isaac aisaac@american....
Thu Oct 22 19:45:46 CDT 2009


On 10/22/2009 8:03 PM, Dennis C wrote:
> an example of what and how exactly to call from scipy if I have a
> function to MAXimize that takes one variable (direct parabolic
> interpolation) say between 0 and 1 with a precision of 0.01 up to 100
> iterations?

>>> from scipy.optimize import fmin_bfgs
>>> def f4min(x): return -myf(x)
...
>>> fmin_bfgs(f4min, x0=1000, gtol=0.01, maxiter=100)
Optimization terminated successfully.
          Current function value: 0.000000
          Iterations: 4
          Function evaluations: 21
          Gradient evaluations: 7
array([ 0.00017235])

hth,
Alan Isaac



More information about the SciPy-User mailing list