I\'m trying to fit a second order polynomial to raw data and output the results using Matplotlib. There are about a million points in the data set that I\'m trying to fit.
The problem is probably using a power basis for data that is displaced some distance from zero along the x axis. If you use the Polynomial class from numpy.polynomial it will scale and shift the data before the fit, which will help, and also keep track of the scale and shift used. Note that if you want the coefficients in the normal form you will need to convert to that form.