# Because its the datapoints at large x that matter for

• Lesson Plan
• 66

This preview shows pages 49–51. Sign up to view the full content.

because it’s the datapoints at large x that matter for determining the slope. The solid line is the weighted MARS fit. This is satisfying because the points at large x cluster around it instead of lying to one side, and the points at small x (which have comparable residuals to the others) don’t (and intuitively shouldn’t) matter as much. Our intuition, as well as the math in equation 13.4, tells us that the weighted MARS is the appropriate choice. This is valid for not only this example, but for any combination of functions such as the general case formulated in equations 12.1. 13.2. The General Technique for Weighted MARS Fitting By being clever with weights w m we can formulate a general technique for weighted MARS fitting 8 . Consider chi-square fitting the function y = a · f ( x ), in which a is an N -long vector of unknown parameters and f ( x ) a set of N basis functions. In § 12.1 we reviewed the definition of χ 2 and the resulting equations for minimization; this discussion culminated in equation 12.2 in which we included a weight w m , specified by the user to accomplish some particular objective. We repeat that equation here: M - 1 summationdisplay m =0 w m f n ( x m y m σ 2 m = 0 . (13.5) Here our objective is reproduce the spirit of equation 13.4, in which all dependence Δ y m (but not on f n or σ 2 m ) is removed so that the sum is the multifunction equivalent of equivalent of equation 13.4. To accomplish this, we simply choose w m = 1 | Δ y m | . (13.6) So weighted MARS fitting is just another version of the sliding weight technique of § 12.1. 8 It is fortunate that weighted MARS, instead of median, fitting is what we want. Otherwise we could not formulate the solution using w m because, when y depends on more than one function of x , one would need a separate weight for each function—and that is completely incompatible with the general least-squares approach.

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

– 50 – 13.3. Implementation, a Caution, and When To Stop Iterating Implementation: To implement MARS fitting, you include a factor w 1 / 2 m in the diagonal ele- ments of equation 8.6. Begin with w m = 1 and iterate. A caution: You might get too close to one point, making its Δ y m,central 0. Then in equation 13.6 w m,central →∞ and your solution goes crazy. You can build in a limit to take the lesser value, i.e. something like w m = (10 9 < 1 / | Δ y m | ) ( < means “whichever is smaller”). When to stop? You might think that all you need to do is keep track of the minimum value of | Δ y m | and stop when this minimum value stops changing by very much. In my experience, this doesn’t work very well. It’s far better to keep tract of the corrections to each and every parameter that are derived on successive iterations. When you reach convergence, these corrections will asymptotically approach zero. 13.4. Errors in the Derived Parameters In conventional least squares, you use the covariance matrix and the variance of the datapoints, as in equation 3.7. This is definitely not what you want here. For example, suppose you have a singly wildly discrepant datapoint and evaluate σ 2 in the usual way. Then the sum Δ y 2
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