|
I'm trying to find data step code that would perform smoothing of an X,Y
series of data via cubic spline interpolation (or a similar spline
interpolation). I'm trying to replicate the smoothing done by
the "INTERPOL=SM<0-99>" option to the SYMBOL statement in SAS graph. I
know there are a couple of procedures that can do this, but I want to
perform the smoothing in a data step, continuously re-evaluating the y=f(x)
function as each new record (i.e., set of X,Y values) is input. I would
take a crack at writing it myself, but I must admit that I don't completely
understand the mechanics of this procedure. My goal is to smooth the data
sufficiently in order to identify local min and max values (where the first
derivative is zero) and points of inflection (where the second derivative
is zero).
The data series are a fixed period counter (X) ranging from 1 to n, where
it's always true that (0 < x1 < x2 < ... < xn), and an oscillating
indicator that ranges between 0 and 15 (Y). The Y values are very noisy
(which is why I'm looking for a good smoothing function). I want to find a
solution that doesn't lag significantly, as a moving average approach would
do. At the lowest level of X represented in the data, there can only be
one value of Y.
Any and all help or suggestions will be greatly appreciated. Thank you.
Regards,
William
|