MTH
lsfit_2008.pdf

# The least squares fitted quantities are in the matrix

• Lesson Plan
• 66

This preview shows pages 12–16. Sign up to view the full content.

The least-squares fitted quantities are in the matrix a (equation 2.5), which we obtain in IDL with

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

– 13 – a = XXI ## XY . (4.6) In IDL we denote the matrix of predicted values y m by YBAR , which is YBAR = X ## a , (4.7) and we can also define the residuals in Y as DELY = Y YBAR . (4.8) In IDL we denote s 2 in equations 3.1 and 3.6 by s sq and write s sq = transpose ( DELY )## DELY / ( M N ) , (4.9a) or s sq = total ( DELY 2) / ( M N ) . (4.9b) It is always a good idea to plot all three quantities (the measured values Y , the fitted values YBAR , and the residuals DELY ) to make sure your fit looks reasonable and to check for bad datapoints. To get the error in the derived coefficients we need a way to select the diagonal elements of a matrix. Obviously, any N × N matrix has N diagonal elements; a convenient way to get them is diag elements of XXI = XXI [( N + 1 ) indgen ( N )] . (4.10) In IDL, we define the variances of the N derived coefficients by vardc (think of “ var iances of d erived c oefficients”). You can get this as in equation 3.7 from 1 vardc = s sq XXI [( N + 1 ) indgen ( N )] . (4.11) 1 If you used equation 4.9a instead of 4.9b, then IDL considers s sq an array and you need to use a # instead of a * in this equation.
– 14 – 4.3. Discussion of the numerical example For this numerical example, the solution (the array of derived coefficients) is a = 96 . 6250 4 . 5000 0 . 8750 (4.12a) and the errors in the derived coefficients [the square root of the σ 2 ’s of the derived coefficients, i.e. [ σ 2 n ] 1 / 2 or, in IDL, sqrt ( vardc ) in equations 4.11] are: σ A = 34 . 012 9 . 000 0 . 5590 . (4.12b) These results look horrible : the uncertainties are large fractions of the derived coefficients, The reason: we have specifically chosen an example with terrible covariance. And the great thing is this can be fixed easily (at least in this case—certainly not always), without taking more data! 5. THE COVARIANCE MATRIX AND ITS NORMALIZED COUNTERPART First we provide a general discussion, then we apply it to the above numerical example. 5.1. Definition of the normalized covariance (or correlation) matrix The variances in the derived coefficients are obtained from the diagonal elements of XXI . The off-diagonal elements represent the covariances between the derived coefficients. Covariance means, specifically, the degree to which the uncertainty in one derived coefficient affects the uncertainty in another derived coefficient. Because the covariance matrix elements relate pairwise to the various coefficients, the units of the matrix elements are all different. This makes it convenient to reduce all the matrix elements to a standard set of units—namely, no units at all. So before discussing the covariance matrix per se , we first discuss its normalized counterpart.

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

– 15 – The normalized covariance matrix 2 ncov is derived from XXI by dividing each element by the square root of the product of the corresponding diagonal elements. Let ncov be the normalized covariance matrix; then ncov ik = XXI ik XXI ii XXI kk . (5.1)
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