user1364183
user1364183

Reputation: 101

how to find the similarity between two curves and the score of similarity?

I have two data sets (t,y1) and (t,y2). These data sets visually look same but their is some time delay or magnitude shift. i want to find the similarity between the two curves (giving the score of similarity 1 for approximately similar curves and 0 for not similar curves). Some curves are seem to be different because of oscillation in data. so, i am searching for the method to find the similarity between the curves. i already tried gradient command in Matlab to find the slope of the curve at each time step and compared it. but it is not giving me satisfactory results. please anybody suggest me the method to find the similarity between the curves.

Thanks in Advance

enter image description here

Upvotes: 10

Views: 18996

Answers (4)

Arvind Kumar
Arvind Kumar

Reputation: 66

  1. Kolmongrov Smirnov Test (kstest2 function in Matlab)
  2. Chi Square Test
  3. to measure similarity there is a measure called MIC: Maximal information coefficient. It quantifies the information shared between 2 data or curves.

Upvotes: 1

Xun
Xun

Reputation: 79

The dv and dc distance in the following paper may solve your problem. http://bioinformatics.oxfordjournals.org/content/27/22/3135.full

Upvotes: 0

xbob.ym
xbob.ym

Reputation: 521

For time series data similarity measurement, one traditional solution is DTW (Dynamic Time Warpping)

Upvotes: 6

KiwiBarns
KiwiBarns

Reputation: 111

This answer assumes your y1 and y2 are signals rather than curves. The latter I would try to parametrise with POLYFIT.

If they really look the same, but are shifted in time (and not wrapped around) then you can:

y1n=y1/norm(y1);
y2n=y2/norm(y2);
normratio=norm(y1)/norm(y2);
c=conv2(y1n,y2n,'same');
[val ind]=max(c);

ind will indicate the time shift and normratio the difference in magnitude. Both can be used as features for your similarity metric. I assume however your signals actually vary by more than just timeshift or magnitude in which case some sort of signal parametrisation may be a better choice and then building a metric on those parameters.

Without knowing anything about your data I would first try with AR (assuming things as typical as FFT or PRINCOMP won't work).

Upvotes: 6

Related Questions