[SciPy-User] How to estimate error in polynomial coefficients from scipy.polyfit?
Charles R Harris
Thu Mar 25 15:52:32 CDT 2010
On Thu, Mar 25, 2010 at 2:32 PM, Jeremy Conlin <email@example.com> wrote:
> I am using scipy.polyfit to fit a curve to my data. Members of this
> list have been integral in my understanding of how to use this
> function. Now I would like to know how I can get the uncertainties
> (standard deviations) of polynomial coefficients from the returned
> values from scipy.polyfit. If I understand correctly, the residuals
> are sometimes called the R^2 error, right? That gives an estimate of
> how well we have fit the data. I don't know how to use rank or any of
> the other returned values to get the uncertainties.
> Can someone please help?
You want the covariance of the coefficients, (A.T * A)^-1/var, where A is
the design matrix. I'd have to see what the scipy fit returns to tell you
more. In anycase, from that you can plot curves at +/- sigma to show the
error bounds on the result. I can be more explicit if you want.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User