Click or drag to resize

BivariateKendallTauTest Method

Performs a Kendall concordance test for association.

Namespace:  Meta.Numerics.Statistics
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: 4.1.4
Syntax
public static TestResult KendallTauTest(
	IReadOnlyList<double> x,
	IReadOnlyList<double> y
)

Parameters

x
Type: System.Collections.GenericIReadOnlyListDouble
The values of the first variable.
y
Type: System.Collections.GenericIReadOnlyListDouble
The values of the second variable.

Return Value

Type: TestResult
The result of the test.
Exceptions
ExceptionCondition
ArgumentNullExceptionx or y is .
DimensionMismatchExceptionx and y do not contain the same number of entries.
InsufficientDataExceptionThere are fewer than two entries in the sample.
Remarks

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 the difference and not its magnitude, it is not skewed by outliers exhibiting very large changes, nor by cases where the degree of difference changes over the ranges 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.

Because it examines 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.

See Also