MTH
lsfit_2008.pdf

# Functionsbecause you just have to convert back again

• Lesson Plan
• 66

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

functions—because you just have to convert back again and do the error propagation after-the-fact instead of letting the least-squares process do it for you. 5.2. The covariance in our numerical example Apply equation 5.2 to obtain the covariance matrix for our numerical example: ncov = 1 . 989848 . 969717 . 989848 1 . 993808 . 969717 . 993808 1 . (5.4) The off-diagonal elements are huge . This is the reason why our derived coefficients have such large uncertainties. Note, however, that the fitted predicted fit is a good fit even with these large uncertaintis. In this seemingly innocuous example we have an excellent case of a poor choice of zero point for the independent variable (the time). The reason is clear upon a bit of reflection. We are fitting for y = A 0 + A 1 t + A 2 t 2 . The coefficient A 0 is the y -intercept and A 1 is the slope. Inspection of Figure 4.1 makes it very clear that an error in the slope has a big effect on the y -intercept. Now we retry the example, making the zero point of the time equal to the mean of all the times, that is we set ( time m = time m 8). We get the same fitted line, but the derived coefficients are completely different—and amazingly better! We get A = 188 . 625 18 . 500 0 . 87500 (5.5a)

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

– 17 – σ A = 3 . 58 1 . 00 0 . 559 . (5.5b) In redefining the origin of the independent variable, we have made the zero intercept completely independent of the slope: changing the slope has no affect at all on the intercept. You can see this from the normalized covariance matrix, which has become ncov = 1 0 0 . 78086881 0 1 0 0 . 78086881 0 1 , (5.6) which is nice, but not perfect: Our step is partial because the second-order coefficient A 2 affects A 0 because, over the range of [( time 8) = 3 +3], the quantity [ A 2 Σ( time m 8) 2 ] is always positive and is thereby correlated with A 0 . We could complete the process of orthogonalization by following the prescription in BR chapter 7.3, which discusses the general technique of orthogonalizing the functions in least-squares fitting. The general case is a royal pain, analytically speaking, so much so that we won’t even carry it through for our example. But for numerical work you accomplish the orthogonalization using Singular Value Decomposition (SVD), which is of course trivial in IDL ( § 11). For some particular cases, standard pre-defined functions are orthogonal. For example, if t m is a set of uniformly spaced points between ( 1 1) and you are fitting a polynomial, then the appropriate orthogonal set is Legendre polynomials. This is good if your only goal is to represent a bunch of points by a polynomial function, because the coefficients of low-order polynomials are independent of the higher ones. However, it’s more work and, moreover, often you are interested in the coefficients for specific functions that don’t happen to be orthogonal; in such cases, you should just forge ahead.
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