'Tests results from `LevMarLSQFitter` against `scipy.optimize.leastsq`.'

def test_with_optimize(self):

    fitter = LevMarLSQFitter()
    model = fitter(self.gauss, self.xdata, self.ydata, estimate_jacobian=True)
    def func(p, x):
        return (p[0] * np.exp((((-0.5) / (p[2] ** 2)) * ((x - p[1]) ** 2))))
    def errfunc(p, x, y):
        return (func(p, x) - y)
    result = optimize.leastsq(errfunc, self.initial_values, args=(self.xdata, self.ydata))
    assert_allclose(model.parameters, result[0], rtol=(10 ** (-3)))
