Work out if the relationship between 2 datasets is constant

47 Views Asked by At

I have 2 one-dimensional datasets, let's call them a and b. I want to know the correlation between a[n] and b[n], or if there is a correlation in the first place. What is the generic algorithm for doing this?

1

There are 1 best solutions below

0
On BEST ANSWER

Without knowing more about a and b it's hard to say what the most general algorithm is.

The best place to start would be a non-parametric, or rank-based, measure of correlation such as Spearman's $\rho$ or Kendall's $\tau$. Both measure the similarity of the vectors a and b by sorting the values they contain and comparing the ranks.

These are convenient because there are no parametric assumptions about your vectors a and b, i.e. they are not assumed to come from a Gaussian or any other distribution, and there are approximate significance tests that can be performed. Those significance tests will help you determine if there is correlation between the two vectors.