# To perform the chi square fit we first generate the

• Lesson Plan
• 66

This preview shows pages 26–29. Sign up to view the full content.

To perform the chi-square fit, we first generate the weighted versions of X and Y X χ = [ σ ] - 1 · X (8.8a) Y χ = [ σ ] - 1 · Y . (8.8b) Then the equations of condition are X χ · a = Y χ (8.8c)

This preview has intentionally blurred sections. Sign up to view the full version.

– 27 – and the rest of the solution follows as with an unweighted fit, as before [ α χ ] = X T χ · X χ (8.8d) [ β χ ] = X T χ · Y χ (8.8e) a = [ α χ ] - 1 · [ β χ ] . (8.8f) Having calculated the derived coefficients a , we can calculate the residuals. In doing so we must recall that X χ and Y χ contain factors of 1 σ m and [ α χ ] - 1 contains factors of σ 2 m . With all this, we can write the chi-square fit predicted data values as Y χ = X χ · a (8.8g) and the chi-square residuals as δ Y χ = Y χ Y χ (8.8h) Because the data vector Y χ contains factors of 1 σ m , so do the residuals δ Y χ . You should, of course, always look at the residuals from the fit, so remember these scale factors affect the residual values! For example, if all σ m are identical and equal to σ , then Y χ = Y σ . If they don’t, then when you plot the residuals δ Y χ each one will have a different scale factor! Moving on, we have χ 2 = δ Y T χ · δ Y χ (8.8i) hatwider χ 2 = δ Y T χ · δ Y χ M N . (8.8j) Finally, we have the analogy of equations 8.3c and 8.5 expressed in matrix form as in equation 3.7: s a , intuit 2 = hatwider χ 2 diag { [ α χ ] - 1 } . (8.9) This intuitively-derived result is in contrast to the result derived from a formal derivation , which is the analogy to equation 8.4; again, it omits the hatwider χ 2 factor:
– 28 – s a , formal 2 = diag { [ α χ ] - 1 } . (8.10) This formally-derived result is what’s quoted in textbooks (e.g. NR equation 15.4.15, BR equation 7.25). It provides parameter errors that are independent of the datapoint residuals, and leads to the same difficulties discussed above for the weighted mean case. 8.3. Which equation—8.9 or 8.10? In most cases—but not all—we recommend that you use equation 8.9. Equation 8.9 is very reasonable. Suppose, for example, that the least-squares fit model is perfect and the only deviations from the fitted curve result from measurement error. Then by necessity we have s 2 σ 2 meas and hatwider χ 2 1. (We write “ ” instead of “=” because different experiments produce somewhat different values of s 2 because of statistical fluctuations; an average over zillions of experiments gives σ 2 = ( s 2 ) .) In this situation, though, equations 8.9 and 8.10 are identical. However, if the least-squares fit model is not correct , meaning that it doesn’t apply to the data, then the residuals will be larger than the intrinsic measurement errors, which will lead to larger values of χ 2 and hatwider χ 2 —which is the indicator of a poor fit. However, equation 8.9 is not a panacea. The numerical value of hatwider χ 2 is subject to statistical variation. If the number of datapoints M is small (or, more properly, if the number of degrees of freedom ( M N ) is small), then the fractional statistical variation in hatwider χ 2 is large and this affects the normalization inherent in equation 8.9. Alternatively, if you really do know the experimental errors equation 8.10 is appropriate.

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern