90 likes | 188 Views
Linear fits. You know how to use the solver to minimize the chi^2 to do linear fits… Where do the errors on the slope and intercept come from?. Linear Fits. So far, in order to do a linear fit, we have used the solver to find the values of m and b that minimize chi^2.
E N D
Linear fits You know how to use the solver to minimize the chi^2 to do linear fits… Where do the errors on the slope and intercept come from?
Linear Fits So far, in order to do a linear fit, we have used the solver to find the values of m and b that minimize chi^2 When the theory has only a linear dependence on its parameters, then the minimum in c2 can be determined analytically. This is why it’s very nice to put data into a form where it can be described by a theory that depends linearly on its parameters. e.g., any polynomial function such as yth = A + Bx + Cx2 + … is linear in the parameters (A,B,C,…). So let’s minimize c2 for a simple polynomial: a straight line theory. Using this analytically expression, its also straight-forward to derive an analytical expression for the errors on the slope and intercept.
Then we minimize it with respect to the parameters of the theory, A and B. To find the best values of both A and B, we need to carry out this minimization simultaneously. So we take the partial derivative of c2 w.r.t. A and B, and set them both to 0 simultaneously. Minimizing c2 Suppose we have data (xi, yi,si) and we want to fit the data to a line: y = A + Bx. First we calculate c2:
Minimizing c2, cont’d. Here are our two equations, rearranged. Note that all the quantities in parentheses can be computed directly from our data, so they are just numbers. Using linear algebra or matrix techniques, it is simple to invert these equations to find A and B. I won’t do it here, but will just write the answer. The answer is:
Error on Slope and Intercept Our calculated value for A and B depend on the measured values x_i, y_i. We can therefore get the errors on A and B by using the standard propagation of errors formula on our formulas for these quantities. Let’s do this for the intercept. The derivation for the error on the slope is parallel. Let’s also just do this for the simple case when the errors on x are small (negligible) and the errors on the y’s are all the same (sigma_i -> sigma)
Error on Intercept When sigma_i -> sigma Does not depend on y_i. If ignoring errors on x_i, this is just a constant
Error on Intercept If the sigma_i’s are all the same (sigma), this becomes
D Error on intercept
Error on Intercept Look in your linear fitter spread sheet and you’ll see this linked to the error on intercept sheet