[SciPy-User] curve_fit with float32 values

Pauli Virtanen pav@iki...
Sat Jan 12 08:58:59 CST 2013


12.01.2013 14:54, Georg Brandl kirjoitti:
[clip]
> In the end (which took quite a while!) we found that the problem
> was that the X data (which was directly loaded from a HDF file)
> had a float32 dtype.  This seems to confuse curve_fit.  Same goes
> for float16.  float128 at least raises an exception.  Integer types
> seem fine given rounding, see the code/output below.

AFAIK, a likely bug here is probably the choice of epsilon for numerical
differentiation in leastsq --- the chosen epsilon is probably smaller
than the machine epsilon for float32, hence problems appear.

-- 
Pauli Virtanen



More information about the SciPy-User mailing list