From 70ae2812c30fdb01f53dc588318ab1a8abe03780 Mon Sep 17 00:00:00 2001 From: Wirawan Purwanto Date: Thu, 4 Jun 2015 16:06:21 -0400 Subject: [PATCH] * wpylib.math.fitting.fit_func_base: changed default fitting method to leastsq. --- math/fitting/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/math/fitting/__init__.py b/math/fitting/__init__.py index 39d29e2..18594ef 100644 --- a/math/fitting/__init__.py +++ b/math/fitting/__init__.py @@ -41,8 +41,8 @@ The following methods are currently supported for scipy.optimize: See the documentation of `scipy.optimize` for more details. The `fmin` algorithm is the slowest although it is fairly foor proof to -converge it (it may take many iterations). -The leastsq` algorithm is the best but it requires parameter guess that is +converge it (it may take very many iterations). +The `leastsq` algorithm is the best, but it requires parameter guess that is reasonable. I don't have much success with `anneal`--it seems to behave erratically in my limited experience. YMMV. @@ -492,7 +492,7 @@ class fit_func_base(object): fit_default_opts["lmfit:leastsq"] = dict(xtol=1e-8, epsfcn=1e-6) debug = 0 dbg_params = 1 - fit_method = 'fmin' + fit_method = 'leastsq' # changed 20150529 from fmin. Leastsq is much faster. fit_opts = fit_default_opts #fit_opts = dict(xtol=1e-5, maxfun=100000, maxiter=10000, disp=0) def fit(self, x, y, dy=None, fit_opts=None, Funct_hook=None, Guess=None):