Navigation

Operators and Keywords

Function List:

C++ API

: kendall (x)
: kendall (x, y)

Compute Kendall’s tau.

For two data vectors x, y of common length n, Kendall’s tau is the correlation of the signs of all rank differences of x and y; i.e., if both x and y have distinct entries, then

         1
tau = -------   SUM sign (q(i) - q(j)) * sign (r(i) - r(j))
      n (n-1)   i,j

in which the q(i) and r(i) are the ranks of x and y, respectively.

If x and y are drawn from independent distributions, Kendall’s tau is asymptotically normal with mean 0 and variance (2 * (2n+5)) / (9 * n * (n-1)).

kendall (x) is equivalent to kendall (x, x).

See also: ranks, spearman.

Package: octave