[SciPy-user] optimize.fmin_bfgs, vectorial epsilon

Lars Friedrich lfriedri@imtek...
Thu Sep 18 04:05:53 CDT 2008


the docstring of scipy.optimze.fmin_bfgs says that the epsilon parameter 
can be an ndarray:

epsilon : int or ndarray

I assume, that it should be possible to pass different epsilons for all 
the different elements of x.

But, if I do so, this causes an error, since in optimize.approx_fprime 
there are the lines:

ei[k] = epsilon
grad[k] = (f(*((xk+ei,)+args)) - f0)/epsilon

that assume that epsilon is scalar.

Is this intended? Why does the docstring say 'int', shouldn't this be 

Besides that: I get 'Warning: Desired error not necessarily achieved due 
to precision loss' on my optimization problem. Could this be due to the 
fact that my parameters differ by several orders of magnitude? Do I have 
to rescale my error function to cope with that? Or should a 
'per-parameter-epsilon' be enough?


Dipl.-Ing. Lars Friedrich

Bio- and Nano-Photonics
Department of Microsystems Engineering -- IMTEK
University of Freiburg
Georges-Köhler-Allee 102
D-79110 Freiburg

phone: +49-761-203-7531
fax:   +49-761-203-7537
room:  01 088
email: lfriedri@imtek.de

More information about the SciPy-user mailing list