+ Reply to Thread
Results 1 to 11 of 11

First, Second & Third Derivatives from a Curve

  1. #1
    Registered User
    Join Date
    04-29-2015
    Location
    Edinburgh, UK
    MS-Off Ver
    Microsoft Office 2013
    Posts
    19

    First, Second & Third Derivatives from a Curve

    Hi all!

    This might be more of a mathematical problem, but I have all my data in excel and thought maybe there is something I could use in Excel to help me out with this one. I have been struggling with this for awhile so I will be extremely grateful if something could point me in the right direction! =)

    I basically have a curve (which I do not have the formula for as it is made up of 23 data points as collected over a year - gradually increasing and then decreasing), and need to derive the first, second and third derivatives. I have attached a sample Excel dataset of 1 year, consisting of 23 data points, with this thread.

    In addition, for an example of what I am trying to achieve, I have also attached a screenshot (scientific paper) of what a first, second and third derivative should be looking like. I have so far just calculated rate of change for 2 consecutive points (ie. [NDVI2-NDVI1] / [DayOfYear2-DayOfYear1] ), and done that for the entire dataset but all I am getting is a line that is fairly flat and decreasing.

    Please do let me know what I should be doing. Any help would be greatly appreciated! Thank you so much! =)
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: First, Second & Third Derivatives from a Curve

    You can* try to approximate your derivative by difference quotient on your data, then second as difference quotient on first etc.
    See attached

    Note that I used scatterplot rather than lineplot You have constant difference between dates (16 days) but anywau it is easier to plot for instance values and 1st deriv on one plot (with secondary Y axis)

    *but I'd recommend to collect more data especially in ranges when main relationship changes (especially around days 340, 345 and so on).
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    04-29-2015
    Location
    Edinburgh, UK
    MS-Off Ver
    Microsoft Office 2013
    Posts
    19

    Re: First, Second & Third Derivatives from a Curve

    Hi Kaper,

    I would love to have more data points but unfortunately this is a satellite dataset that samples only once every 16 days! Thank you so much for your help! Greatly appreciate it. =)

    Best wishes,
    Xu

  4. #4
    Registered User
    Join Date
    04-29-2015
    Location
    Edinburgh, UK
    MS-Off Ver
    Microsoft Office 2013
    Posts
    19

    Re: First, Second & Third Derivatives from a Curve

    Hi Kaper,

    I was just wondering if there was any way of ascertaining where the NDVI and first derivative intersects?

    Thank you so much for your help so far. Greatly appreciated.

    Best wishes,
    Xu

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: First, Second & Third Derivatives from a Curve

    ? but what for ? are you trying to solve some differential equation?
    and if you treat this literally, for your data never intersect (as NDVI range is 0.16 ; 0.83, while first derivative -0.025 ; 0.006)
    Last edited by Kaper; 06-22-2015 at 08:19 AM.

  6. #6
    Registered User
    Join Date
    04-29-2015
    Location
    Edinburgh, UK
    MS-Off Ver
    Microsoft Office 2013
    Posts
    19

    Re: First, Second & Third Derivatives from a Curve

    I am trying to find the intersects so as to ascertain when the growing season begins and when the growing season ends (as in the example of the 3 screenshots of graphs posted above).

  7. #7
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: First, Second & Third Derivatives from a Curve

    Unfortunately, picture is illegible (at least at my computer)
    But to answer that question you shall not check crossing, but where 1st derivative reaches 0 (and changes sign from + to -). See what I marked in the attachment to original post.
    To find what is the day you can write formula in (say) J3:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy it down to J23
    the local maximum will be estimated that way.

    But despite excel displays it with several decimal digits it is only (!) rough estimation.

  8. #8
    Registered User
    Join Date
    04-29-2015
    Location
    Edinburgh, UK
    MS-Off Ver
    Microsoft Office 2013
    Posts
    19

    Re: First, Second & Third Derivatives from a Curve

    Untitled.png

    Hi Kaper,

    Sorry you couldn't see the picture properly - I've uploaded it with this reply just in case. That was very useful - thank you! However, according to this picture I just just uploaded which I got from a research paper, I need to know where the intersection point is between the original curve and the first derivative curve to find out, at least, where the start of the growing season is. Bonus if I can use the 2nd and 3rd derivatives as well! But from the looks of it my 2nd and 3rd derivate curves don't look too usefu

    Thanks again for your help! =)

  9. #9
    Registered User
    Join Date
    06-16-2015
    Location
    USA
    MS-Off Ver
    MS Office 2010
    Posts
    28

    Re: First, Second & Third Derivatives from a Curve

    Hello,

    A possible solution to your problem could be instead of graphing a line, graph the points and then draw a line of best fit, and with that you can see the equation of the line. given the equation of the line, you could find the first, second, and third derivatives. This is not the most accurate, but could provide a solution to the problem.

    -Bryan

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: First, Second & Third Derivatives from a Curve

    A point of clarification: If I understand correctly, you are not really looking for points of "intersection" (as noted by Kaper, the 1st derivative does not really "intersect" the original function). What you are looking for are the "interesting" points of the function, which seem to be defined as the 1) Max and Min of the 1st derivative, 2) Max and Min of the 2nd derivative, 3) Max and Min of the 3rd derivative.

    I found this kind of interesting: http://phenology.cr.usgs.gov/methods_deriving.php According to the USGS, there are many different ways to approach these kinds of problems. Kaper "proposed" a simple approach using numeric derivatives. As Kaper shows in post 7, we can use linear interpolation to find individual points assuming that each point of the curve is connected by a straight line.

    bbhockey also makes a good suggestion. Another approach would be to select a suitable mathematical equation/model, then find the derivatives of that equation. The challenge here will be in choosing the equation/model. Since each "derivative" seems to become more complex than the previous derivative, a simple polynomial does not seem appropriate. Perhaps something rooted in Fourier transforms?

    You say that you pulled these pictures from a research paper. How did these researchers perform these calculations? Did they perform a regression/correlation followed by some calculus to take the derivatives, or did they use numeric derivatives the way Kaper is suggesting?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  11. #11
    Registered User
    Join Date
    06-16-2015
    Location
    USA
    MS-Off Ver
    MS Office 2010
    Posts
    28

    Re: First, Second & Third Derivatives from a Curve

    Also, You mention that you are getting a line that is flat and decreasing. That is exqactly what you should be getting finding the first derivative. i.e. if the equation of a line is x^2, the derivative would be x, which is a flat line. In this case, it is shaped like a polynomial, meaning there is some type of x^2 in the original equation, which means the derivative is a flat line

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 02-19-2015, 02:00 PM
  2. Find exact formula of a curve and fix the bumps in the curve
    By twobox in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 01-16-2015, 12:25 PM
  3. [SOLVED] How to display duplicates derivatives in the same row
    By orehovka in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-11-2014, 12:18 PM
  4. Graph a curve, then enter data to generate new similar curve
    By denphi03 in forum Excel Charting & Pivots
    Replies: 11
    Last Post: 11-03-2013, 05:33 PM
  5. derivatives of a cubic spline
    By johnboy12 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2008, 02:49 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1