I'm still not pretty sure how I can understand the parameter 'width' in detecting peaks using scipy. Here's a histogram I'm considering:
If I set
peaks, _ = find_peaks(probsuc,width=4)
peak_prominences(probsuc, peaks, wlen=7)
Then the output looks like
(array([0.20229167, 0.25791667]), array([ 4, 39]), array([10, 45]))
However, if I set width=5, then there's only one peak detectable:
(array([0.20229167]), array([4]), array([10]))
And no peak could be detected if width=6. I'm wondering what width exactly means? (I do not quite understand the description on the documentation) If I want to detect the two major peaks on the histogram, is there a general strategy to set the value of width?
Thanks:)