def f(x, a, b):
return a * np.exp(-b*x)
xdata = np.linspace(0, 1, 11)
ydata = f(xdata, 2., 2.)
bounds = ([1., 0], [1.5, 3.])
p0 = [1.01, 2.9]
for method in [None, "trf", "dogbox"]:
After Change
bounds=bounds, method=method)
// If the initial guess is ignored, then popt_2 would be close 0.
assert_allclose(popt_1, popt_2)
class TestFixedPoint(TestCase):