Yotam
Yotam

Reputation: 10685

curve fitting with python

I'm trying to fit some data and stuff, I know there is a simple command to do this with python/numpy/matplotlib, but I can't find it. I think it is something like

popt,popc = numpy.curvefit(f,x)

where popt is the paramters of f, popc is the fit quality and f is a predefined function of f. Does any of you know it?

Upvotes: 14

Views: 39507

Answers (2)

Yotam
Yotam

Reputation: 10685

Found it. Curve_fit from optimize in scipy

Upvotes: -1

ars
ars

Reputation: 123558

Take a look at scipy.optimize.curve_fit:

scipy.optimize.curve_fit(f, xdata, ydata, p0=None, sigma=None, **kw)

Use non-linear least squares to fit a function, f, to data.

Upvotes: 29

Related Questions