We say that two pairs (x_i,y_i) and (x_j,y_j) are
concordant if the ranks of both elements agree, or x_i>x_j and y_i>y_j or if x_i and y_i. We say that two pairs (x_i,y_i) and (x_j,y_j) are discordant, if the ranks of both elements disagree, or if x_i>x_j and y_i or if x_i and y_i>y_j. If x_i=x_j or y_i=y_j, the pair is neither concordant nor discordant. Let (x_1,y_1), (x_2,y_2), \ldots, (x_n,y_n) be a set of observations of two possibly dependent random vectors and . Define
Kendall tau rank correlation coefficient \tau as : \tau=\frac{N_C-N_D}{n(n-1)/2}, where N_C is the number of concordant pairs and N_D is the number of discordant pairs. Somers’
D of with respect to is defined as D_{YX}=\tau(X,Y)/\tau(X,X). Note that Kendall's tau is symmetric in and , whereas Somers’
D is asymmetric in and . As \tau(X,X) quantifies the number of pairs with unequal values, Somers’
D is the difference between the number of concordant and discordant pairs, divided by the number of pairs with values in the pair being unequal. ==Somers’
D for distribution==