(1) | \rho_{xy} = \frac{1}{n} \sum_{i=1}^n {\rm sgn}(x_i - \bar x) \, {\rm sgn}(y_i - \bar y) = \frac{C - H}{ C + H} |
where C + H = n and
C = {\sum}_{i \neq j} \{ {\rm sgn(x_i - \bar x)} = {\rm sgn(y_i - \bar y)} \} — number of pairs with the same sign of deviation from the mean value
H = {\sum}_{i \neq j} \{ {\rm sgn(x_i - \bar x)} \neq {\rm sgn(y_i - \bar y)} \} — number of pairs with the opposite sign of deviation from the mean value