Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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 have 3 visually similar graphs pictured below. They have similar peak patterns that are visible to the naked eye, but I want to compare their similarity mathematically.

I can sum each column to flatten the intensity present, giving you a line curve so the intensity need not be a factor necessarily.

I'm not sure what domain/strategy I should be looking at. I want to essentially measure the similarity of the curves, but since amplitude can vary to some extent, I'm not sure how that would be accounted for, and I'm frankly a bit out of my depths here and don't know exactly where to look.

Any help in direction would be most appreciated.

Picture of three similar graphs

share|cite|improve this question
Noisy data? Interesting... Any suspected distribution? Could use some statistic test to check against it (or just against one of them assuming it is 100% correct)... – vonbrand Feb 5 '13 at 2:13
I don't think I'd actually call this off topic here, but it wouldn't surprise me if you'd get better results asking it at – Micah Feb 5 '13 at 2:48
whats the graph of their differences look like? What is the way to measure how some function approximates another function? – Arjang Feb 5 '13 at 3:16

Ultimately, you have to decide what you mean by "similar", but here are a couple of ideas.

Let's suppose we want to compare two functions $p(t)$ and $q(t)$. I'm assuming that these two functions are defined over the same range of values, so it makes sense to compare $p(t)$ with $q(t)$ for all values of $t$. Suppose you know the function values at $n$ points, $t_1,t_2, \dots, t_n$.

Spaces of functions have many different "metrics" (ways of measuring the distance between functions). For your purpose, a reasonable one might be the $\ell_2$ metric. This says that $$ distance(p,q) = \sqrt{ \sum_{i=1}^n (p(t_i) - q(t_i))^2 }$$

In some fields, this would be called the root-mean-square difference between the functions.

Before doing this measurement, you might want to "normalize" the function values in some way, if you care more about trends than actual function values. The basic technique is described here:, and here:

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.