Results 1 to 8 of 8

Thread: Quantifying distance between graphs

  1. #1

    Thread Starter
    New Member julie_miel's Avatar
    Join Date
    Jul 2007
    Posts
    6

    Talking Quantifying distance between graphs

    Hi all,
    I wanted a few opinions on a metric that I'm using to measure the "difference" between spectral plots. I have these spectral plots of grass, conifer and pinewood; wavelength on x-axis and reflectance% of material on y-axis.
    Visually, it is easy to see that pinewood is way too different from grass or conifer and grass is very similar to conifer except for a tiny “bump” near the near-infrared portion.
    Since the spectra are basically column vectors I can compute abs(mean(abs(spectra1) – abs(spectra2))) for all three.

    For normalized data, the respective mean distances are:
    dm(grass, conifer) = 0.0271; dm(grass, pinewood) = 0.1518 and dm(pinewood, conifer) = 0.1789
    So the more dm is closer to 0, the more similar the spectra are?

    Can I use this to mathematically say “this spectra is different by this measure from the other spectra”? Do I need more results from various other materials?
    Or do you think I must go back to textbook methods like Euclidean distance or Kullback-Leibler?

    Cheers.

  2. #2
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Quantifying distance between graphs

    Welcome to the forums.

    So, you need some means to quantify the differences between 2 plots and/or a test or something to determine when they are definitely different.

    A couple of issues:

    1. Can you post a (screen capture) sample of your graphs?
    2. Are you familiar with Fourier analysis? Parhaps it could help.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  3. #3

    Thread Starter
    New Member julie_miel's Avatar
    Join Date
    Jul 2007
    Posts
    6

    Re: Quantifying distance between graphs

    Hi krtxmrtz,
    Thanks very much.

    I've uploaded a spectral plot. I don't know if you're meant to see it from my profile page or somewhere else. Sorry, I'm so naive.

    We are studying Kullback-Leibler method in class and I didn't really understand why we cannot use something as simple as the average of the absolute difference or even Euclidean distance as a measure.

    What is the significance of the measure if I choose to perform Euclidean, or Kullback-Leibler or any other metrics for that matter?

    I'm not very familiar with Fourier's transform, unfortunately.
    Attached Images Attached Images  

  4. #4

    Thread Starter
    New Member julie_miel's Avatar
    Join Date
    Jul 2007
    Posts
    6

    Re: Quantifying distance between graphs

    >> I've uploaded a spectral plot. I don't know if you're meant to see it from my profile page or somewhere else.

    Oh well! :O)

  5. #5
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Quantifying distance between graphs

    If your question is what method you should use, unfortunately I'm afraid I can't help you as I'm not familiar with the Kullback-Leibler divergence method, but if they want you to use it... then go for it. When I have to compare 2 distributions I choose one method or another depending on the specific problem I'm dealing with. It depends on how you interpret the method so you have to understand the rationale. Btw forget about Fourier if you have not studied it yet.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  6. #6

    Thread Starter
    New Member julie_miel's Avatar
    Join Date
    Jul 2007
    Posts
    6

    Re: Quantifying distance between graphs

    So if I ask you for an opinion about the method:
    avg(abs(mean(abs(spectra1) – abs(spectra2))))

    Do you think I can use this figure to say if spectra1 is similar or not to spectra2?

    Thank you.

  7. #7
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Quantifying distance between graphs

    I think that your formula will work well, since I've seen the graphs you're working with. Visually it looks like most differences between graphs occur from simple stretching--that is, the same general pattern appears in each graph with a hump to start, levelling off, etc. etc., except that the height of each hump is specific to the type of material.

    However, if certain materials exhibit more differences than stretching, depending on the exact criteria you use, your function could produce some incorrect results. Say, for example, an extra, relatively large hump appears on the right half of a graph, but other than that the new material is very, very similar to the old. This could produce a difference value that's lower than it should be, since the new material is very different from the old in certain wavelengths, though its similarity in the other wavelengths could lead one to believe the two are very similar since your difference value for those wavelengths will be near zero.

    The type of function you use or devise really does depend upon the specifics of how each type of difference should be weighted in the overall difference calculation. Without knowing much about your application, it seems like stretching should be weighed less (or be a metric itself) than extra humps (which could also be a metric itself, where your overall metric is a combination of the two). Well, that's my opinion.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  8. #8

    Thread Starter
    New Member julie_miel's Avatar
    Join Date
    Jul 2007
    Posts
    6

    Re: Quantifying distance between graphs

    Hi Jemidiah,
    Thanks very much for your opinion.

    It was a coincidence that the materials I chose had their plots falling into a pattern. I took it up with my professor and well, he just said I must investigate further with various materials then!!

    But I really appreciate your comments: "However, if certain materials exhibit more differences than stretching, depending on the exact criteria you use, your function could produce some incorrect results"
    It gave me a different perspective, for now Thank you,

Posting Permissions

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



Click Here to Expand Forum to Full Width