Does anybody know a way to reduce the number of data points from 146 points down to 45 points?. The User's Guide Part 2 discusses decimation. However, I have struggled to find an appropriate way to use the decimation feature. I start with a number of points that is about 3.24 times as large as the number of points I like to arrive at. It is important to reduce the variable to exactly 45 points, so that the variable can be used as a dependent variable in a multivariate curve fitting. The 146 points of this variable relate to a time period of 14 quarters (3.5 years). For the same time period I know 45 points for each of a number possible independent (explanatory) variables. All the points - the 145 of the dependent variable and the 45 of the dependent variables - are equally spread within the 3.5 year period.
The 45 points should represent the 146 points as good as possible. That is why, I was thinking about decimation by omission or smoothing.
Here's a simple example using decimation-by-omission and decimation by moving average:
make/O/N=146 big = sin(p*3*pi/145)// something "interesting" make/O/N=45 small = big[p*145/44]// decimation by omission make/O/N=45 bettersmall= mean(big,pnt2x(big,p*145/44-1), pnt2x(big,p*145/44+1))// 3 point mean decimation setscalex, 0,3.5,"",big,small,bettersmall display big,small,bettersmall
Thanks to both of you. With your advice I got what I was looking for. I discovered that the shape of the larger data set was maintained with the decimation method and also with the interpolation function, if I set the smoothing factor at zero. See the attached graph.
November 3, 2011 at 10:04 am - Permalink
make/O/N=45 small = big[p*145/44] // decimation by omission
make/O/N=45 bettersmall= mean(big,pnt2x(big,p*145/44-1), pnt2x(big,p*145/44+1)) // 3 point mean decimation
setscale x, 0,3.5,"",big,small,bettersmall
display big,small,bettersmall
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
November 3, 2011 at 10:06 am - Permalink
November 4, 2011 at 02:22 pm - Permalink