[SciPy-user] Fitting a polynomial to data

Alan G Isaac aisaac at american.edu
Thu Jun 30 16:51:50 EDT 2005


On Thu, 30 Jun 2005, CJ Fleck apparently wrote: 
> I have some data points that I'd like to fit a polynomial to.  I have 
> a gut feeling that this can be done with scipy, but I'm not sure how. 
> Admitadly, my math skills are a bit lacking and I'm not real sure how 
> to go about it. 

You can certainly do this in scipy:
you can just use a linear regression
to get the polynomial coefficients.

You can also use a polynomial fitting function
in Scientific Python, if I recall.
http://starship.python.net/~hinsen/ScientificPython/
Scientific.Functions.LeastSquares

hth,
Alan Isaac






More information about the SciPy-User mailing list