C# fast chart aproximate comparison algorithm -
i have 2 series of values. showing them in chart, quite similar (they have same behavior, when 1 grows, other 1 grows, when 1 has small values, other has small values; but: may occur 1 growing , other descending). important not have strictly same values. interested in general behavior of these 2 charts.
right now, comparing them doing average on both graphs, , building 2 bool arrays. when value above average, corresponding value in bool[] true, otherwise false. compare these 2 bool[], using hamming distance. algorithm works, not wished work. (it doesn't detect matches between charts).
does have idea of better algorithm performing operation?
thank you.
a simple way of calculating distance between 2 lists of numbers calculate sum of squares of differences between them. used quite in statistics.
double sum = 0.0; (int = 0; < n; i++) { double diff = a[i] - b[i]; sum += diff*diff; } but fundamental question is, kind of statement expecting such analysis.
another possibility calculate correlation coefficient between 2 series. coefficient of +1 means 2 series fit 100%, 0 means there no apparent relation between 2 series , -1 means pure opposite of each other.
Comments
Post a Comment