I was searching for a pre-made perl solution for performing peak-detection when I stumbled upon this post.

To anyone following in my footsteps know that the OP incorrectly represents information regarding the meaning of derivative and second derivatives.

Specifically the second derivative is not required nor necessarily useful in assisting with peak detection.

Second derivatives represent change to the rate of change of a series (in this context). Peak detection has little to nothing to do with such change to the rate of change (aka acceleration). Instead we are more interested in the first derivative, which is more analogous to rate of change of the originating series (aka velocity).

While performing any peak detection your goal is to capture the points in a series whereby the point has reached a local maximum or minimum. One can guesstimate that if velocity is not changing, and then subsequently reverses (changes sign) that this would likely represent a peak of some type. Further analysis using the series mean and standard deviation can help determine if this is in fact a meaningful peak to you or not (it's all circumstantial depending on your needs).

So the OP's suggestion that observing changing signs on the second derivative is not correct. Additionally while observing sign changes on the first derivative may prove useful, you will need to perform additional analysis to determine if it's the exact data you are looking for.


In reply to Re^4: Any idea for predicting the peak points in the graph by perl by gaimrox
in thread Any idea for predicting the peak points in the graph by perl by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.