Skip to main content
. 2020 Feb 17;20(4):1084. doi: 10.3390/s20041084
Algorithm 1 TVD
Input:
SEQ1, SEQ2: two time sequential synopses
μ: adjusting parameter
Output:
TVD: distance value
1:  Length of sequential synopses: n = SEQ1.length
2:  Manhattan distance of SEQ1 and SEQ2: manhattan = 0
3:  Maximum Manhattan distance: max = 0
4:  Vector of the difference of SEQ1 and SEQ2: diff
5:  e, where ek=1, k[1, 2, , n]
6:  for i in n do
7:   absi=Math.abs(SEQ1iSEQ2i)
8:   manhattan+= absi
9:   diffi=SEQ1iSEQ2i
10:   if absi>max then
11:    max= absi
12:   end if
13: end for
14: DISvalue=1manhattannmaxμ
15: DIStrend=pearson(diff, e)
16: TVD= DISvalueDIStrend
17: return TVD