KendallTau
✖
KendallTau
gives Kendall's rank correlation matrix for the multivariate symbolic distribution dist.
gives the Kendall rank correlation for the multivariate symbolic distribution dist.
Details

- KendallTau[v1,v2] gives Kendall's rank correlation coefficient
between v1 and v2.
- Kendall's
is a measure of monotonic association based on the relative order of consecutive elements in the two lists.
- Kendall's
between
and
is given by
, where
is the number of concordant pairs of observations,
is the number of discordant pairs,
is the number of ties involving only the
variable, and
is the number of ties involving only the
variable.
- A concordant pair of observations
and
is one such that both
and
or both
and
. A discordant pair of observations is one such that
and
or
and
.
- The tie-corrected version of Kendall's
returned is sometimes referred to as Kendall's
, or tau-b.
- The arguments v1 and v2 can be any real‐valued vectors of equal length.
- For a matrix m with
columns, KendallTau[m] is a
×
matrix of the rank‐correlations between columns of m.
- For an
×
matrix m1 and an
×
matrix m2, KendallTau[m1,m2] is a
×
matrix of the rank‐correlations between columns of m1 and columns of m2.
- KendallTau[dist,i,j] is the probability of concordance minus the probability of discordance Probability[(x1-x2)(y1-y2)>0,{{x1,y1}disti,j,{x2,y2}disti,j}]-Probability[(x1-x2)(y1-y2)<0,{{x1,y1}disti,j,{x2,y2}disti,j}] where disti,j is the
marginal of dist.
- KendallTau[dist] gives a matrix
where the
entry is given by KendallTau[dist,i,j].
Examples
open allclose allBasic Examples (4)Summary of the most common use cases

https://wolfram.com/xid/0k8aytrlbs44d-gugb6d

https://wolfram.com/xid/0k8aytrlbs44d-fulot0


https://wolfram.com/xid/0k8aytrlbs44d-9un6t

https://wolfram.com/xid/0k8aytrlbs44d-hz9gv1


https://wolfram.com/xid/0k8aytrlbs44d-bv14aj

https://wolfram.com/xid/0k8aytrlbs44d-ce2wv

https://wolfram.com/xid/0k8aytrlbs44d-i51zwj

Compute Kendall's for a bivariate distribution:

https://wolfram.com/xid/0k8aytrlbs44d-f7dh9d

https://wolfram.com/xid/0k8aytrlbs44d-mzz2lg


https://wolfram.com/xid/0k8aytrlbs44d-nwpxl1

Scope (7)Survey of the scope of standard use cases
Data (4)
Exact input yields exact output:

https://wolfram.com/xid/0k8aytrlbs44d-eta06h

Approximate input yields approximate output:

https://wolfram.com/xid/0k8aytrlbs44d-bxeync


https://wolfram.com/xid/0k8aytrlbs44d-04fgr


https://wolfram.com/xid/0k8aytrlbs44d-kt50m4

SparseArray data can be used:

https://wolfram.com/xid/0k8aytrlbs44d-gighjo

Distributions and Processes (3)
Kendall's matrix for a continuous multivariate distribution:

https://wolfram.com/xid/0k8aytrlbs44d-fnv00k


https://wolfram.com/xid/0k8aytrlbs44d-tekwa

Kendall's matrix for derived distributions:

https://wolfram.com/xid/0k8aytrlbs44d-c3a9y


https://wolfram.com/xid/0k8aytrlbs44d-cy97of

https://wolfram.com/xid/0k8aytrlbs44d-etkwz


https://wolfram.com/xid/0k8aytrlbs44d-hxjash

https://wolfram.com/xid/0k8aytrlbs44d-gm1a47


https://wolfram.com/xid/0k8aytrlbs44d-edj4ah

Kendall's matrix for a random process at times
and
:

https://wolfram.com/xid/0k8aytrlbs44d-hv1ygl

Applications (4)Sample problems that can be solved with this function
Kendall's is typically used to detect linear dependence between two vectors:

https://wolfram.com/xid/0k8aytrlbs44d-fhbudj
The absolute magnitude of tends to 1 given strong linear dependence:

https://wolfram.com/xid/0k8aytrlbs44d-rv8j1

The value tends to 0 for linearly independent vectors:

https://wolfram.com/xid/0k8aytrlbs44d-bo8mij

Kendall's can be used to measure linear association:

https://wolfram.com/xid/0k8aytrlbs44d-d9hc8

https://wolfram.com/xid/0k8aytrlbs44d-bmf8jn

Kendall's can only detect monotonic association:

https://wolfram.com/xid/0k8aytrlbs44d-7nvfr

https://wolfram.com/xid/0k8aytrlbs44d-nazb6e

https://wolfram.com/xid/0k8aytrlbs44d-j9qi3

https://wolfram.com/xid/0k8aytrlbs44d-gtfa0z

HoeffdingD can be used to detect other dependence structures:

https://wolfram.com/xid/0k8aytrlbs44d-jor85u

A series of factors was measured in 506 Boston suburbs with the intention of determining how these factors are related to home price. Significant correlations among factors such as nitrogen oxide concentration and median home price serve as a reminder that correlation does not imply causation:

https://wolfram.com/xid/0k8aytrlbs44d-393icd


https://wolfram.com/xid/0k8aytrlbs44d-m2ro2p

https://wolfram.com/xid/0k8aytrlbs44d-eyz3fx
A scatter plot matrix comparing the percentage of non-retail businesses, nitrogen oxide concentration, and median home value:

https://wolfram.com/xid/0k8aytrlbs44d-jmvxe

Kendall's matrix for the scatter plot matrix:

https://wolfram.com/xid/0k8aytrlbs44d-bgan7z

KendallTauTest suggests home values drop with increasing nitrogen oxide concentrations:

https://wolfram.com/xid/0k8aytrlbs44d-ei3usk

Properties & Relations (8)Properties of the function, and connections to other functions
Kendall's ranges from -1 to 1 for high negative and high positive association, respectively:

https://wolfram.com/xid/0k8aytrlbs44d-fvojjd

https://wolfram.com/xid/0k8aytrlbs44d-cp90d4


https://wolfram.com/xid/0k8aytrlbs44d-mp4oro

Kendall's matrix is symmetric:

https://wolfram.com/xid/0k8aytrlbs44d-31bc2

https://wolfram.com/xid/0k8aytrlbs44d-mmzf9d

The diagonal elements of Kendall's matrix are 1:

https://wolfram.com/xid/0k8aytrlbs44d-o1vsb7

https://wolfram.com/xid/0k8aytrlbs44d-h7qlge

Kendall's is related to SpearmanRho:

https://wolfram.com/xid/0k8aytrlbs44d-hbkym
SpearmanRho tends to be about
given weak linear association:

https://wolfram.com/xid/0k8aytrlbs44d-mts4te

Use KendallTauTest to test for independence:

https://wolfram.com/xid/0k8aytrlbs44d-l4v2w

https://wolfram.com/xid/0k8aytrlbs44d-eetjj

Alternatively, use IndependenceTest to automatically select an appropriate test:

https://wolfram.com/xid/0k8aytrlbs44d-kv172

Kendall's will attain 1 or -1 if the variables are perfectly monotonically related:

https://wolfram.com/xid/0k8aytrlbs44d-xln2s

https://wolfram.com/xid/0k8aytrlbs44d-dde2tx


https://wolfram.com/xid/0k8aytrlbs44d-gm71p


https://wolfram.com/xid/0k8aytrlbs44d-kylhyv

This is in contrast to Correlation, which strictly measures linear association:

https://wolfram.com/xid/0k8aytrlbs44d-f40mz2


https://wolfram.com/xid/0k8aytrlbs44d-m22vt

Kendall's for a continuous bivariate distribution:

https://wolfram.com/xid/0k8aytrlbs44d-bfewud

https://wolfram.com/xid/0k8aytrlbs44d-ewdode


https://wolfram.com/xid/0k8aytrlbs44d-grblhu


https://wolfram.com/xid/0k8aytrlbs44d-hqcqde

Kendall's for discrete distributions accounts for the distribution of ties:

https://wolfram.com/xid/0k8aytrlbs44d-xeczx

https://wolfram.com/xid/0k8aytrlbs44d-mewcqm


https://wolfram.com/xid/0k8aytrlbs44d-ck6mtm

https://wolfram.com/xid/0k8aytrlbs44d-frwxj

https://wolfram.com/xid/0k8aytrlbs44d-68hk3

Compare to a simulated value with and without corrections for ties:

https://wolfram.com/xid/0k8aytrlbs44d-ev6nh6

https://wolfram.com/xid/0k8aytrlbs44d-016xf


https://wolfram.com/xid/0k8aytrlbs44d-e15ep0


https://wolfram.com/xid/0k8aytrlbs44d-cm4yha

Wolfram Research (2012), KendallTau, Wolfram Language function, https://reference.wolfram.com/language/ref/KendallTau.html.
Text
Wolfram Research (2012), KendallTau, Wolfram Language function, https://reference.wolfram.com/language/ref/KendallTau.html.
Wolfram Research (2012), KendallTau, Wolfram Language function, https://reference.wolfram.com/language/ref/KendallTau.html.
CMS
Wolfram Language. 2012. "KendallTau." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KendallTau.html.
Wolfram Language. 2012. "KendallTau." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KendallTau.html.
APA
Wolfram Language. (2012). KendallTau. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KendallTau.html
Wolfram Language. (2012). KendallTau. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KendallTau.html
BibTeX
@misc{reference.wolfram_2025_kendalltau, author="Wolfram Research", title="{KendallTau}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/KendallTau.html}", note=[Accessed: 04-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_kendalltau, organization={Wolfram Research}, title={KendallTau}, year={2012}, url={https://reference.wolfram.com/language/ref/KendallTau.html}, note=[Accessed: 04-April-2025
]}