3

In time series we can find peak (min and max values). There are algorithms to find peaks. My question is:

In python are there libraries for peak detection in time series data? or something in R using RPy?

mrk
  • 8,059
  • 3
  • 56
  • 78
  • I think the question refers to the peak concept from statistical analysis, such as http://stackoverflow.com/questions/1713335/peak-finding-algorithm-for-python-scipy – user4815162342 Nov 22 '12 at 21:43
  • 1
    Hmm, peak detection is just a fancier phrasing of extrema-detections, there are multiple algorithm for local and global extrema detections. so as long as the OP doesn't elaborate on the specific needs you can't suggest anything. (simplex, evolutionary, monte-carlo ... which base-alorithm for which use-case?) – Don Question Nov 22 '12 at 22:05
  • https://gist.github.com/250860 – vladr Nov 23 '12 at 05:10
  • Duplicate of https://stackoverflow.com/questions/1713335/peak-finding-algorithm-for-python-scipy – Basj Apr 09 '21 at 07:14

1 Answers1

1

Calculate the derivation of your sample points, for example for every 5 points (THRESHOLD!) calculate the slope of the five points with Least squares methods (search on wiki if you dont know what it is. Any lineair regression function uses it). And when this slope is almost (THRESHOLD!) zero there is a peak.

Niels
  • 482
  • 1
  • 5
  • 18
  • What to the "THRESHOLD!"s mean in your answer and, ignoring them, is what you suggest different from finding the max or min values of a series of values? – martineau Nov 22 '12 at 23:35