I have a dataset of thousands of values arranged in one column. Over time, those values create a curve that resembles, say, a sine curve, moving up to a peak, down to a bottom point, and moving back up again.
Given the set of numbers, I want a formula that tells me the slope of the curve at that point. For example, if the six most recent points in the set are 44.9, 50.0, 53.0, 53.1, 50.0, 49.1 I want the formula to show that 49.1 is decreasing from the peak with a slight negative slope. Further, if the next six points are 47.5, 41.6, 35.4, 23.6, 11.5, -2.0, I want to show that -2.0 is around halfway between the peak and the bottom with a large negative slope.
How can I do this in calculus to get more accurate results than just taking the slope of the last few numbers?