Savitzky-Golay smoothing, part 3
Eighteen months ago, I posted the first two parts of a planned series on Savitzky-Golay smoothing.
Savitzky-Golay smoothing, part 1 pointed out that
femr2's
original "Savitzky-Golay" acceleration curve was not obtained using true Savitzky-Golay differentiation.
Savitzky-Golay smoothing, part 2 described Savitzky-Golay differentiation and smoothing in some detail, explaining the historical importance of some details that don't matter so much today.
This long-delayed third part of the series will explore two technical points in greater detail. From part 2:
For many applications, the most questionable choice is the decision to give equal weight to the squared error at each point. Most methods give less weight to the error at points farther away from the center of the window.
...snip...
this feature of Savitzky-Golay smoothing may give too much influence to outliers or noise at the extremes of a window. It also creates lag when wide windows are used to smooth a time series for position that may have resulted from sudden changes in acceleration.
That could be of concern when analyzing video of building collapses. To find out whether it's a problem, we'd have to understand the purposes of the analysis.
It's been hard to identify any possible purpose for the various acceleration curves produced by
femr2's video analysis, but
we recently saw several of those curves being used to argue against David Chandler's claim that WTC7 "transitioned from rest to freefall essentially instantly". The person who did that soon
regretted his introduction of those curves into that debate, but this incident shows why we can't judge the usefulness of an analysis without considering its intended purpose(s).
As shown below, none of the cited curves (including NIST's as well as
femr2's) provide any real evidence against Chandler's claim. For the purpose of arguing against a near-instantaneous transition from rest to freefall, those curves are worse than useless: Their mathematical names and spurious detail can mislead even well-intentioned individuals into thinking those acceleration curves show something meaningful about the abruptness of the transition to freefall. They do not.
To demonstrate the uselessness of those particular acceleration curves for this particular purpose, I will introduce a counterexample in the form of yet another acceleration curve, motivated by this observation from part 1:
(In this graph, I've stuck with best-fit polynomials of degree n=2. As can be seen in the other graphs, raising the degree to n=3 has very little effect on the graph. That tells us the additional features seen when the degree is raised still further, to n=4, are probably artifacts of the smoothing process interacting with noise in the signal. It might even tell us more, but I'll save that for later.)
It's later now.
The fact that Savitzky-Golay differentiation and smoothing of
femr2's position data for the northwest corner of WTC7 is essentially unaffected by raising the polynomial degree from 2 to 3 suggests the position data might be explained by piecewise constant (step) accelerations.
Consider, for example, the thick blue acceleration curve in this graph:
That stepwise curve, if accurate, might support David Chandler's belief in a sudden transition from rest to free fall.
The red line is
femr2's original "Savitzky-Golay" curve, which appears to have been derived by iterating the SG algorithm instead of computing the second derivative in one pass. (As explained in parts 1 and 2, those two processes are not equivalent.) That red curve, if accurate, might argue against David Chandler's claim.
Those are two very different curves, and you might think they have very different implications for Chandler's claim.
Those two curves are of comparable accuracy. The stepwise acceleration curve is a little more accurate overall, but its superior accuracy doesn't show up until 13 seconds and later (using
femr2's time coordinates). Its accuracy between 12 and 13 seconds could be improved by moving the stepwise transitions slightly earlier in time, but I chose to use moderately round numbers:
Code:
t < 12.4s 0 ft/s^2 (at rest)
12.4s <= t < 12.7s -32 ft/s^2 (free fall)
12.7s <= t < 13.2s -40 ft.s^2 (over-g)
13.2s <= t < 14.7s -32 ft/s^2 (free fall)
14.7s <= t < 15.4s -18 ft/s^2
15.4s <= t < 15.8s -25 ft/s^2
15.8s <= t < 16.0s -10 ft/s^2
16.0s <= t < 16.5s -8 ft/s^2
16.5s <= t +12 ft/s^2
The thin green line shows the acceleration curve computed from
femr2's position data using true Savitzky-Golay differentiation with best-fit polynomials of degree 2 and 61 data points per window.
The medium purple line looks like a smoothed version of the green line, but it was computed via true Savitzky-Golay differentiation
from the positional data implied by the blue stepwise acceleration curve. (With piecewise constant accelerations, those positions can be computed analytically via double integration.)
That purple line approximates the green (SG) line remarkably well. Yet the purple line was derived from position data that were known to match a perfectly stepwise acceleration. That means the green (SG) line is quite similar to what we'd expect to get out of the Savitzky-Golay algorithm if
femr2's position data were produced by perfectly instantaneous transitions between rest and free fall,
et cetera. That means the green line, showing true Savitzky-Golay differentiation of the positional data
femr2 extracted from the Dan Rather video,
is consistent with David Chandler's claim.
If
femr2 had provided us with an adequate description of the process he used to derive his original "Savitzky-Golay" curve (the red line), we could have applied his process to the positional data implied by the blue stepwise curve, thereby obtaining a similarly direct confirmation that
femr2's original "Savitzky-Golay" curve is unable to rule out Chandler's claim. Since
femr2 has expressed his delight in obstructing my attempts to understand his process, I will just say this:
- The iterated SG femr2 appears to have used doubles the effective width of his convolution window while giving more weight to points in the center of that extended window than to points near its edges. (This is why femr2's process yields results that differ from true Savitzky-Golay differentiation and smoothing.)
- The doubling of the effective window size worsens the lag and smearing problems I noted in part 2, while giving more weight to the window's central points tends to lessen those same problems.
- Comparing femr2's original "Savitzky-Golay" curve (the red line) to a true Savitzky-Golay curve (the green line), it looks as though femr2's curve has smeared the onset of free fall over a longer period of time than has the true Savitzky-Golay curve with 61 points per window.
- That conclusion is supported by the greater accuracy of the true Savitzky-Golay curve (as reported below).
Throughout this thread, many have lamented the absence of error analysis. We did some worst-case error analysis near the beginning of the thread, but those analyses addressed only the worst-case errors for a single point within a time series. So far as I recall, no one has ever posted an error analysis that compares the overall accuracy of different acceleration curves.
The most straightforward way to check the accuracy of an acceleration curve obtained by numerical differentiation from positional data is to use numerical integration to compute the positional data implied by the acceleration curve, and compare those computed positions to the actual positional data the acceleration curve purports to model.
For the three acceleration curves I've been discussing here, that error analysis yields these results:
Overall,
femr2's original "Savitzky-Golay" curve is the least accurate of the three curves. The stepwise acceleration curve is a little more accurate. The true Savitzky-Golay acceleration curve is easily the most accurate of the three.
Does that mean the true Savitzky-Golay curve provides evidence against Chandler's claim that the transition from rest to free fall was abrupt? No. As shown by the purple curve in the first graph, Savitzky-Golay differentiation and smoothing will smear any abrupt changes in acceleration over a period of time that's roughly proportional to the window size. That means Savitzky-Golay acceleration curves are completely useless if your purpose is to refute Chandler's claim or to argue that NIST's estimated 2.25s of approximate free fall is incorrect.
Does that mean Chandler or NIST were right?
Not at all.
What it does mean is this: Those who have been using Savitzky-Golay curves to argue against Chandler or NIST have been relying upon a fallacious argument.