0

I am attempting to identify point at which upward and downward trends with data sets start and end, these trends can happen at any given point within the X axis. For example with the given data set, we can see that an upward trend started from point x = 1 until x = 10, subsequently after that we had a downward trend from x = 11 until x = 20 and from then on an upward trend. Surely there is a mathematical way to accomplish this?

x = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
y = [2,5,7,9,10,13,16,18,21,22,21,20,19,18,17,14,10,9,7,5,7,9,10,12,13,15,16,17,22,27]

thanks in advance

godzilla
  • 3,005
  • 7
  • 44
  • 60
  • it is not a duplicate at all, similar yes, this one is asking for point at which up trends and down trends start and stop – godzilla Jun 11 '14 at 12:43

1 Answers1

0

Are you saying you want to find the rate in change of your value (y) for a given property (x)? If so, then this is the differential of y with respect to x. You can look at some examples given at this post:

How do I compute derivative using Numpy?

Community
  • 1
  • 1
jonnybazookatone
  • 2,188
  • 15
  • 21
  • but will that give me the points at which the uptrend or down trend starts? – godzilla Jun 11 '14 at 13:03
  • Yes, as you would see a change from a positive gradient (up trend) to a negative gradient (down trend). In theory, a continuous curve would have the transition when the differential is zero. – jonnybazookatone Jun 11 '14 at 13:13
  • if it is not too much to ask can you produce a sample with the data set above please? – godzilla Jun 11 '14 at 21:36