MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working with hyperspectral image data in R, so I have subset an image to a region of 5000 pixels, each containing a vector 254 bands in length.

I would like to cluster this data in order to try and map regions with similar surface composition.

Due to differences in surface reflectance, if I plot two pixels, where for example: x=1:254, y=0:1 (reflectance)

They may have very similar shape (values across all bands) but be vertically offset from one another due to the overall reflectance of the surface.

For my region I have a mean spectrum, and each pixel contains a vector of 254 residual values. I can't use Euclidean distance to compare vectors, because it will change depending on the overall reflectance, so I'm not sure if there's a more appropriate measure to use that will give me a better comparison.

Apologies for my novice question.

*Edit: This question is also posted at:

share|cite|improve this question
I think your question might get a helpful answer sooner on although I am not sure. (If you do post there, then please leave a link here to the new question.) – Yemon Choi Aug 16 '13 at 16:51
Dear @EJA: I added some tags which I hope are relevant to the question. – Ricardo Andrade Aug 17 '13 at 3:25
Thank you both very much, for the suggestions and edits. – EJA Aug 19 '13 at 14:48
up vote 1 down vote accepted

A good place to start would be the Wasserstein metric.

share|cite|improve this answer
Thanks for your suggestion, I'll look into it! – EJA Aug 19 '13 at 14:46

if the vertical offset is approximately the same within a vector, then it would be a simple strategy to subtract the mean value in order to 'normalize' the vectors before calculating Euclidean distances.

Yet another approach could be to work with the vectors of differences of 'adjacent' coordinate values, which reduces the dimension of vectors by 1.

These methods are low hanging fruits; maybe they already suffice to solve your problem.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.