Measuring Sequence Similarity with Absolute Differences

  • Thread starter Thread starter onako
  • Start date Start date
onako
Messages
86
Reaction score
0
Hi all,

I'm faced with the following problem (it involves two equally large number sequences, or vectors; therefore, it might be considered as a problem of number theory, I guess; please move it to appropriate place if you think differently):
Given two sequences, for example:
A=[1, 2, 4, 6, 7, 2, 1];
B=[1, 2, 4, 7, 8, 2, 1];
Give an algorithm that should express the entrywise similarity/closeness of the sequences by a certain number. For the above sequeces, A and B are similar(differ in two entries); the sequence C might have all 5's and is still more similar to A than sequence D with all 100's...
I thought of the following:
<br /> \sum |a_i-b_i|<br />
Other proposals are very welcome. Many thanks
 
Physics news on Phys.org
There are many. Typical ones involve powers of the abs. value of the difference, where the exponent 2 is most often used. (Look up lp, especially p=2. You are describing p=1.).
 

Similar threads

Back
Top