Loading [MathJax]/jax/output/CommonHTML/jax.js

Friday, June 30, 2017

Python Plotting Tutorial -- Part 8

Fitting data with error bars

Suppose you have data (xi,yi), with uncertainties σi in the y-values. Let
Un=ixniσ2i,Wn=iyixniσ2i,
and let
D=U0U2U21.
Then the best fit line is given by
slope=U0W1U1W0D,intercept=U2W0U1W1D,
with uncertainties
σ2slope=U0D,σ2intercept=U2D.

As part of your homework, you will write a function which implements this method.

No comments:

Post a Comment