From: John D'Errico on 3 Feb 2010 10:45 "Ryan " <rr2box42(a)gmail.com> wrote in message <hkc1tu$nru$1(a)fred.mathworks.com>... > Thanks everyone for the replies. I was in the middle of replying confusedly to Jon because I'm running r2009b too and my smooth.m doesn't have that note nor subfunctions for either weighting algorithm. Then I realized that my smooth.m is about 1,000,000 years old, because a colleague "thoughtfully" packaged one with a program he wrote a few years ago, and I've got that program's directory on the path. So I feel silly about that... > > Nevertheless, why do we want to use the square roots of the weights anyway? I've been consulting several references throughout my current project (including Cleveland, 1979 referenced in smooth.m), and I haven't seen such a recommendation so far. > > Again, thanks everyone for your time and helpfulness. It all depends on how the implementation is written. Suppose that you are given a weight vector w. What do these weights mean? How are they to be interpreted? Let us look first in the context of a sum of squares, as for a linear (or nonlinear) regression. Here we will form the sum of the square of the residuals. What does it mean for one point to have a weight of 2? Typically this is equivalent to having replicated that point, so that effectively we have TWO points at that location. In terms of a sum of squares of residuals though, this means that we must multiply the residuals by sqrt(2) for that data point. When we square the weighted residuals that effectively means we have doubled the contribution of that point to the total sum os squares. Instead, suppose we wanted to minimize the sum of absolute values of the residuals? Now we would NOT take the square root of the weights, because absolute value does not square its argument. So without even looking at the expression inside this smoothing tool, my guess is we are looking at a sum of squares of residuals, therefore the sqrt. HTH, John
From: Ryan on 4 Feb 2010 10:49 Thanks, John, that certainly does help, and makes a lot of sense. I'm still not sure if it's the right thing to do in this instance. I need to take a closer look but it seems to me like the Matlab algorithm differs from that described in the literature. Either way, I agree that your explanation is probably at the root of the difference. Cheers, Ryan
First
|
Prev
|
Pages: 1 2 Prev: Filter and maximal graylevel Next: [speed up] vectorized find() for sorted data? |