Sign up ×

I've got a problem about comparing 2 sets of data.

Now i have 2 sets of data, say set A and set B. What i am going to do is :

1.) plot a line graph based on set A's data

2.) plot another line graph based on set B's data and overlay it on set A's graph.

My problem is that set B's data can be much larger ( or smaller ) than set A's data. But the purpose of drawing these graphs is to compare the pattern of this 2 graphs, which means that i need to multiply or divide every data in set B by a factor, say N, so that the resulting graph will lay in similar range ( get them overlaid ). My problem will be how to find this N. Currently i am just getting this N in this way :

1.) Find Average A, the average of the maximum value and minimum value of set A

2.) Find Average B, the average of the maximum value and minimum value of set B

3.) divided B by A to get N.

However i find the result of this way is not very good. Is there any better algorithm to compare 2 sets of data and find such an N?

share|improve this question
I would have a read around Cross Validated and if you can't find an answer, ask this there. – AakashM Jul 9 '12 at 8:28

2 Answers 2

You could create a best fit line for each set of data and then compute the cosine similarity between the two lines.

This will only work if each data set is linear.

share|improve this answer

How about using central moving average by calculating Moving average for both data sets and then divide them. Moving average essentially smoothens spikes.

share|improve this answer

Your Answer


