Différenciate Plot Action – central derivative

DataGraph Forums Technical Support Support Desk Différenciate Plot Action – central derivative

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14254
    Jean-Yves Le Stang
    Participant

      Hello,

      In the screen capture below featuring the result of the three main derivative methods of DG, at the last row, the central derivative is negative while the function is still increasing and the forward and backward derivatives are both positive. Things get “back to normal” if I add another row (depending on the value inserted in the new last row).

      From the Knowledge Database, I guess this may be due to  the fact that there is no (i+1) values to support the calculation. Can you further explain ?

      Or does-it mean that even when the central derivative method is selected, the last row value should be calculated using the backward derivative method.

       

      Derivative vieaw

      #14280
      david
      Moderator

        A better name for the central derivative might be “second order” or “quadratic”.

        What the method does is that it uses three points, fits them with a quadratic polynomial and uses the derivative of the polynomial as an approximation of the derivative at the point. Centered refers to using the point on the left and right as well as the point at the given row to fit the quadratic equation. At the beginning and the end there is a problem. In those cases it still uses three points but needs to go two points to the right or left. This is happening in this case.

        explanation

        In this case the x values are not uniform. I took the time stamp and the values from the Value column and did the accumulation. I drew the quadratic polynomial that fits those three points. The slopes of the second and third point match what is in your table. I added the tangent lines at each point.

        In a sense the data is trending down at the last point. The last point is larger than the previous point, so in terms of a one sided difference it is still growing, but when you look at it in terms of the actual time values and how big the gap is between the last two time values the trend is reversing.

        This is fundamentally a problem with high order interpolation when you have noise. I don’t know if this is noise/outlier in your data set.

        Switching to a first order approximation (left or right sided) at the ends has a different problem. If your data really is smooth the one sided derivatives are a lot less accurate at the ends, so the result will look like there is a change when there is none. For example the case where the underlying data is exactly a second degree polynomial. The central derivative will be exact but the one sided derivatives will have an error at the edges. Using the the method I used at the edges will however be exact for that case.

        #14281
        Jean-Yves Le Stang
        Participant

          Many thanks for the time you spent explaining this phenomenon – this is understood.

          For your information, the unusual period between the two last timestamps was noise, not outliers.

          Have a nice day

           

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.

        DataGraph Forums Technical Support Support Desk Différenciate Plot Action – central derivative