Is there a way to quantify the 'unsortedness' of a given vector/1D array with respect to a reference vector.?

45 Views Asked by At

I've been working on a statistical learning problem and seem to have hit a roadblock. It's basically regarding somehow measuring how randomized or unsorted a given vector is, with respect to a reference vector.

E.g if the reference vector has 5 elements of the orientation: X = ABCDE, then is there a function that could return a score s for some Y = BDCAE with respect to X?

i.e Something like: f(ABCDE, ABCDE) = 0 (or 1)

f(BDCAE , ABCDE) = s

In case there is some straightforward way to do it, could you kindly let me know if we can have weight for each element as well, as in {A: w1, B: w2, ....}?

Thank you in advance.

1

There are 1 best solutions below

1
On

Is the Kendall Tau distance close to what you need?

http://en.wikipedia.org/wiki/Kendall_tau_distance