BivariateSampleKendallTauTest Method |
Namespace: Meta.Numerics.Statistics
Exception | Condition |
---|---|
InsufficientDataException | Count is less than two. |
Kendall's τ is a non-parametric and robust test of association between two variables. It simply measures the number of cases where an increase in one variable is associated with an increase in the other (concordant pairs), compared with the number of cases where an increase in one variable is associated with a decrease in the other (discordant pairs).
Because τ depends only on the sign of a change and not its magnitude, it is not skewed by outliers exhibiting very large changes, nor by cases where the degree of change in one variable associated with a given change in the other changes over the range of the variables. Of course, it may still miss an association whose sign changes over the range of the variables. For example, if data points lie along a semi-circle in the plane, an increase in the first variable is associated with an increase in the second variable along the rising arc and and decrease in the second variable along the falling arc. No test that looks for single-signed correlation will catch this association.
Because it examine all pairs of data points, the Kendall test requires O(N2) operations. It is thus impractical for very large data sets. While not quite as robust as the Kendall test, the Spearman test is a good fall-back in such cases.