[SciPy-user] polynomal regression

A. M. Archibald peridot.faceted at gmail.com
Mon Oct 16 08:27:03 CDT 2006

On 16/10/06, Christian Meesters <meesters at uni-mainz.de> wrote:
> Hi,
> Well, scipy allows to fit a polynomal of arbitrary order. But is there any
> method implemented which does this and returns uncertainties in the
> coefficients as well?
> For instance: If the data represent a polynomal p0 + p1*x + p1*x^2, is there a
> way to retreive delta-p0, -p1, and p2?
> Sorry, if this question has already been asked - or even answered. I could
> image that somebody came up with it already, but I can't find the thread. Any
> hints / links appreciated ...

numpy's least-squares fitting procedure will do just what you're
asking for. I think it's called numpy.lstsqr (but it may have a
different number of ss and ts). What you really want is probably the
full covariance matrix, and I think it can give that to you.

A. M. Archibald

More information about the SciPy-user mailing list