[SciPy-User] multidimensional least squares fitting

Daniel Mader danielstefanmader@googlemail....
Wed Nov 9 13:52:17 CST 2011


> there is also optimize.curve_fit as wrapper for least_sq

I thought this would only work with y = f(x)? Will try!

> your error function returns 2d instead of 1d
> you need one ravel
> return np.ravel(p0 + p1*x + p2*y - f)

Thank you very much, that's it! Works nicely!


More information about the SciPy-User mailing list