1166:
The
Kendall tau distance between two rankings is the number of pairs that are in different order in the two rankings. For example, the Kendall tau distance between 0 3 1 6 2 5 4 and 1 0 3 6 4 2 5 is four because the pairs 0-1, 3-1, 2-4, 5-4 are in different order in the two rankings, but all other
817:
1298:
2108:
In order to calculate the
Kendall tau distance between these two rankings, pair each person with every other person and count the number of times the values in list 1 are in the opposite order of the values in list 2.
1493:
elements respectively), then triangular inequality is not guaranteed. The triangular inequality fails sometimes also in cases where there are repetitions in the lists. So then we are not dealing with a metric anymore.
392:
1086:
952:
669:
1825:
2950:
2331:
596:
1728:
1644:
3043:
1391:
2807:
2744:
641:
27:
that counts the number of pairwise disagreements between two ranking lists. The larger the distance, the more dissimilar the two lists are. Kendall tau distance is also called
1911:
464:
428:
2996:
1151:
2840:
1445:
1418:
1121:
1014:
987:
880:
853:
538:
511:
99:
72:
2009:
1957:
1342:
2892:
2701:
1852:
1563:
1536:
1195:
2866:
1491:
1468:
661:
484:
1163:
Kendall tau distance in
Rankings: A permutation (or ranking) is an array of N integers where each of the integers between 0 and N-1 appears exactly once.
104:
3652: — A website that calculates the Kendall tau distance between two interactive ranking lists and shows the pairwise disagreements between the lists.
3430:
3425:
1506:
1200:
3542:
3559:
1497:
Generalised versions of
Kendall tau distance have been proposed to give weights to different items and different positions in the ranking.
3665:
3675:
2272:
Since there are four pairs whose values are in opposite order, the
Kendall tau distance is 4. The normalized Kendall tau distance is
2811:
1020:
886:
3670:
3515:
Chan, Timothy M.; Pătraşcu, Mihai (2010). "Counting
Inversions, Offline Orthogonal Range Counting, and Related Problems".
1735:
35:
algorithm would take to place one list in the same order as the other list. The
Kendall tau distance was created by
2897:
2015:
For example comparing the rankings A>B>C>D and A>B>C>D the distance is 0 the correlation is 1.
2278:
545:
1649:
3435:
1571:
3004:
1347:
2749:
812:{\displaystyle K_{d}(\tau _{1},\tau _{2})=\sum _{\{i,j\}\in P,i<j}{\bar {K}}_{i,j}(\tau _{1},\tau _{2})}
3568:
3520:
2709:
3680:
601:
2105:
Here person A is tallest and third-heaviest, B is the second -tallest and fourth-heaviest and so on.
2018:
Comparing the rankings A>B>C>D and D>C>B>A the distance is 6 the correlation is -1
1857:
24:
3525:
2021:
Comparing the rankings A>B>C>D and B>D>A>C the distance is 3 the correlation is 0
3573:
433:
397:
3626:
3586:
2963:
1126:
3470:
2818:
1423:
1396:
1099:
992:
965:
858:
831:
516:
489:
77:
50:
3685:
3538:
1971:
1919:
1306:
2809:. Then, the problem of computing the Kendall tau distance reduces to computing the number of
3618:
3578:
3530:
2871:
1157:
2679:
1830:
1541:
1514:
1173:
36:
2845:
1473:
1450:
646:
469:
3659:
2336:
A value of 0.4 indicates that 40% of pairs differ in ordering between the two lists.
3590:
3517:
Proceedings of the Twenty-First Annual ACM-SIAM Symposium on
Discrete Algorithms
3455:
32:
3649:
3534:
3609:
3582:
2957:
1293:{\displaystyle {\frac {K_{d}}{{\frac {1}{2}}n(n-1)}}={\frac {2K_{d}}{n(n-1)}}}
1965:
The distance between equals is 0, the correlation between equals is 1.
3644:
1538:) must not be confused with the Kendall tau rank correlation coefficient (
3630:
3490:
3557:
Fagin, R.; Kumar, R.; Sivakumar, D. (2003). "Comparing top k lists".
2386:"""Compute the Kendall tau distance."""
3622:
387:{\displaystyle K_{d}(\tau _{1},\tau _{2})=|\{(i,j):i<j,\vee \}|.}
2345:
2029:
Suppose one ranks a group of five people by height and by weight:
1156:
Kendall tau distance can also be defined as the total number of
2952:. There are several algorithms for calculating this number.
663:
is the list size) if one list is the reverse of the other.
3607:
Kendall, M. (1938). "A New
Measure of Rank Correlation".
3491:"calculating the number of "inversions" in a permutation"
3645:
Online software: computes
Kendall's tau rank correlation
31:
since it is equivalent to the number of swaps that the
1501:
Comparison to Kendall tau rank correlation coefficient
828:
is the set of unordered pairs of distinct elements in
604:
598:
will be equal to 0 if the two lists are identical and
3007:
2966:
2900:
2874:
2848:
2821:
2752:
2712:
2682:
2281:
1974:
1922:
1860:
1833:
1738:
1652:
1574:
1544:
1517:
1476:
1453:
1426:
1399:
1350:
1309:
1203:
1176:
1129:
1102:
1081:{\displaystyle {\bar {K}}_{i,j}(\tau _{1},\tau _{2})}
1023:
995:
968:
947:{\displaystyle {\bar {K}}_{i,j}(\tau _{1},\tau _{2})}
889:
861:
834:
672:
649:
548:
519:
492:
472:
436:
400:
107:
80:
53:
47:The Kendall tau ranking distance between two lists
3037:
2990:
2944:
2886:
2860:
2834:
2801:
2738:
2695:
2325:
2003:
1951:
1905:
1846:
1819:
1722:
1638:
1557:
1530:
1485:
1462:
1439:
1412:
1385:
1336:
1303:If Kendall tau distance function is performed as
1292:
1189:
1145:
1115:
1080:
1008:
981:
946:
874:
847:
811:
655:
635:
590:
532:
505:
478:
458:
422:
386:
93:
66:
3436:Kemeny–Young maximum-likelihood voting rule
2431:"Both lists have to be of equal length"
1959:. (The normalised distance is between 0 and 1)
1820:{\displaystyle K_{c}=1-2K_{n},K_{n}=(1-K_{c})/2}
2746:, it is possible to rename the items such that
2703:memory, which is inefficient for large arrays.
8:
3469:Ravi Kumar and Sergei Vassilvitskii (2010).
2945:{\displaystyle \tau _{2}(i)>\tau _{2}(j)}
732:
720:
666:Kendall tau distance may also be defined as
373:
155:
2326:{\displaystyle {\frac {4}{5(5-1)/2}}=0.4.}
2011:, the correlation between reversals is -1
591:{\displaystyle K_{d}(\tau _{1},\tau _{2})}
3572:
3524:
3025:
3017:
3006:
2965:
2927:
2905:
2899:
2873:
2847:
2826:
2820:
2757:
2751:
2730:
2717:
2711:
2687:
2681:
2306:
2282:
2280:
1993:
1973:
1941:
1921:
1874:
1868:
1859:
1838:
1832:
1809:
1800:
1778:
1765:
1743:
1737:
1723:{\displaystyle K_{d}=(1-K_{c})(n(n-1))/4}
1712:
1679:
1657:
1651:
1607:
1601:
1579:
1573:
1549:
1543:
1522:
1516:
1475:
1452:
1431:
1425:
1404:
1398:
1374:
1361:
1349:
1308:
1261:
1251:
1217:
1210:
1204:
1202:
1181:
1175:
1134:
1128:
1107:
1101:
1069:
1056:
1037:
1026:
1025:
1022:
1000:
994:
973:
967:
935:
922:
903:
892:
891:
888:
866:
860:
839:
833:
800:
787:
768:
757:
756:
719:
703:
690:
677:
671:
648:
605:
603:
579:
566:
553:
547:
524:
518:
497:
491:
471:
441:
435:
405:
399:
376:
355:
333:
311:
289:
261:
239:
217:
195:
150:
138:
125:
112:
106:
85:
79:
58:
52:
3602:. Charles Griffin & Company Limited.
3426:Kendall tau rank correlation coefficient
3001:A more advanced algorithm requires time
2344:A naive implementation in Python (using
2111:
2031:
1507:Kendall tau rank correlation coefficient
3447:
3431:Spearman's rank correlation coefficient
1639:{\displaystyle K_{c}=1-4K_{d}/(n(n-1))}
3472:Generalized Distances between Rankings
3038:{\displaystyle O(n{\sqrt {\log {n}}})}
1916:The distance is a value between 0 and
1386:{\displaystyle K(\tau _{1},\tau _{2})}
2802:{\displaystyle \tau _{1}=(1,2,3,...)}
1962:The correlation is between -1 and 1.
1300:and therefore lies in the interval .
7:
3560:SIAM Journal on Discrete Mathematics
1170:The normalized Kendall tau distance
2739:{\displaystyle \tau _{1},\tau _{2}}
3049:Here is a basic C implementation.
2340:Computing the Kendall tau distance
1968:The distance between reversals is
14:
2842:—the number of index pairs
636:{\textstyle {\frac {1}{2}}n(n-1)}
1511:The Kendall tau distance (
466:are the rankings of the element
2368:normalised_kendall_tau_distance
1906:{\displaystyle 2K_{d}/(n(n-1))}
1568:They are related by
3032:
3011:
2985:
2970:
2939:
2933:
2917:
2911:
2796:
2766:
2303:
2291:
1990:
1978:
1938:
1926:
1900:
1897:
1885:
1879:
1806:
1787:
1709:
1706:
1694:
1688:
1685:
1666:
1633:
1630:
1618:
1612:
1380:
1354:
1331:
1313:
1284:
1272:
1242:
1230:
1075:
1049:
1031:
941:
915:
897:
806:
780:
762:
709:
683:
630:
618:
585:
559:
453:
447:
417:
411:
377:
370:
367:
361:
345:
339:
323:
317:
301:
295:
282:
276:
273:
267:
251:
245:
229:
223:
207:
201:
188:
170:
158:
151:
144:
118:
1:
1167:pairs are in the same order.
1096:are in the opposite order in
2956:A simple algorithm based on
1565:) used in statistics.
459:{\displaystyle \tau _{2}(i)}
423:{\displaystyle \tau _{1}(i)}
1854:is the normalised distance
3702:
3666:Covariance and correlation
3535:10.1137/1.9781611973075.15
2991:{\displaystyle O(n\log n)}
1504:
1146:{\displaystyle \tau _{2}.}
25:metric (distance function)
16:Metric to compare ordering
3676:Comparison of assessments
3583:10.1137/S0895480102412856
2835:{\displaystyle \tau _{2}}
1732:Or simpler by
1440:{\displaystyle \tau _{2}}
1413:{\displaystyle \tau _{1}}
1116:{\displaystyle \tau _{1}}
1009:{\displaystyle \tau _{2}}
982:{\displaystyle \tau _{1}}
962:are in the same order in
875:{\displaystyle \tau _{2}}
848:{\displaystyle \tau _{1}}
533:{\displaystyle \tau _{2}}
506:{\displaystyle \tau _{1}}
94:{\displaystyle \tau _{2}}
67:{\displaystyle \tau _{1}}
21:Kendall tau rank distance
3600:Rank Correlation Methods
3051:
2350:
2004:{\displaystyle n(n-1)/2}
1952:{\displaystyle n(n-1)/2}
1337:{\displaystyle K(L1,L2)}
2676:However, this requires
3456:"Sorting Applications"
3039:
2992:
2946:
2888:
2887:{\displaystyle i<j}
2862:
2836:
2803:
2740:
2697:
2327:
2099:C>D>A>B>E
2076:A>B>C>D>E
2005:
1953:
1907:
1848:
1821:
1724:
1640:
1559:
1532:
1487:
1464:
1441:
1414:
1387:
1338:
1294:
1191:
1147:
1117:
1082:
1010:
983:
948:
876:
849:
813:
657:
637:
592:
534:
507:
480:
460:
424:
388:
95:
68:
3040:
2993:
2947:
2889:
2863:
2837:
2804:
2741:
2698:
2696:{\displaystyle n^{2}}
2328:
2006:
1954:
1908:
1849:
1847:{\displaystyle K_{n}}
1822:
1725:
1641:
1560:
1558:{\displaystyle K_{c}}
1533:
1531:{\displaystyle K_{d}}
1488:
1465:
1442:
1415:
1388:
1339:
1295:
1192:
1190:{\displaystyle K_{n}}
1148:
1118:
1083:
1011:
984:
949:
877:
850:
814:
658:
638:
593:
535:
508:
481:
461:
425:
389:
96:
69:
3671:Statistical distance
3598:Kendall, M. (1948).
3005:
2964:
2898:
2872:
2846:
2819:
2750:
2710:
2680:
2279:
1972:
1920:
1858:
1831:
1736:
1650:
1572:
1542:
1515:
1474:
1451:
1447:are the rankings of
1424:
1397:
1348:
1307:
1201:
1174:
1127:
1100:
1021:
993:
966:
887:
859:
832:
670:
647:
602:
546:
517:
490:
470:
434:
398:
105:
78:
51:
29:bubble-sort distance
2861:{\displaystyle i,j}
2706:Given two rankings
3035:
2988:
2942:
2884:
2858:
2832:
2799:
2736:
2693:
2323:
2001:
1949:
1903:
1844:
1817:
1720:
1636:
1555:
1528:
1486:{\displaystyle L2}
1483:
1463:{\displaystyle L1}
1460:
1437:
1410:
1383:
1334:
1290:
1187:
1143:
1113:
1078:
1006:
979:
944:
872:
845:
809:
754:
653:
633:
588:
530:
503:
476:
456:
420:
384:
91:
64:
3544:978-0-89871-701-3
3057:<stdbool.h>
3030:
2315:
2270:
2269:
2103:
2102:
1288:
1246:
1225:
1034:
900:
765:
715:
656:{\displaystyle n}
613:
479:{\displaystyle i}
3693:
3634:
3603:
3594:
3576:
3549:
3548:
3528:
3512:
3506:
3505:
3503:
3501:
3486:
3480:
3479:
3477:
3466:
3460:
3459:
3452:
3415:
3412:
3409:
3406:
3403:
3400:
3397:
3394:
3391:
3388:
3385:
3382:
3379:
3376:
3373:
3370:
3367:
3364:
3361:
3358:
3355:
3352:
3349:
3346:
3343:
3340:
3337:
3334:
3331:
3328:
3325:
3322:
3319:
3316:
3313:
3310:
3307:
3304:
3301:
3298:
3295:
3292:
3289:
3286:
3283:
3280:
3277:
3274:
3271:
3268:
3265:
3262:
3259:
3256:
3253:
3250:
3247:
3244:
3241:
3238:
3235:
3232:
3229:
3226:
3223:
3220:
3217:
3214:
3211:
3208:
3205:
3202:
3199:
3196:
3193:
3190:
3187:
3184:
3181:
3178:
3175:
3172:
3169:
3166:
3163:
3160:
3157:
3154:
3151:
3148:
3145:
3142:
3139:
3136:
3133:
3130:
3127:
3124:
3121:
3118:
3115:
3112:
3109:
3106:
3103:
3100:
3097:
3094:
3091:
3088:
3085:
3082:
3079:
3076:
3073:
3070:
3067:
3064:
3061:
3058:
3055:
3044:
3042:
3041:
3036:
3031:
3029:
3018:
2997:
2995:
2994:
2989:
2951:
2949:
2948:
2943:
2932:
2931:
2910:
2909:
2893:
2891:
2890:
2885:
2867:
2865:
2864:
2859:
2841:
2839:
2838:
2833:
2831:
2830:
2808:
2806:
2805:
2800:
2762:
2761:
2745:
2743:
2742:
2737:
2735:
2734:
2722:
2721:
2702:
2700:
2699:
2694:
2692:
2691:
2672:
2669:
2666:
2663:
2660:
2657:
2654:
2651:
2648:
2645:
2642:
2639:
2636:
2633:
2630:
2627:
2624:
2621:
2618:
2615:
2612:
2609:
2606:
2603:
2600:
2597:
2594:
2591:
2588:
2585:
2582:
2579:
2576:
2573:
2570:
2567:
2564:
2561:
2558:
2555:
2552:
2549:
2546:
2543:
2540:
2537:
2534:
2531:
2528:
2525:
2522:
2519:
2516:
2513:
2510:
2507:
2504:
2501:
2498:
2495:
2492:
2489:
2486:
2483:
2480:
2477:
2474:
2471:
2468:
2465:
2462:
2459:
2456:
2453:
2450:
2447:
2444:
2441:
2438:
2435:
2432:
2429:
2426:
2423:
2420:
2417:
2414:
2411:
2408:
2405:
2402:
2399:
2396:
2393:
2390:
2387:
2384:
2381:
2378:
2375:
2372:
2369:
2366:
2363:
2360:
2357:
2354:
2332:
2330:
2329:
2324:
2316:
2314:
2310:
2283:
2112:
2032:
2010:
2008:
2007:
2002:
1997:
1958:
1956:
1955:
1950:
1945:
1912:
1910:
1909:
1904:
1878:
1873:
1872:
1853:
1851:
1850:
1845:
1843:
1842:
1826:
1824:
1823:
1818:
1813:
1805:
1804:
1783:
1782:
1770:
1769:
1748:
1747:
1729:
1727:
1726:
1721:
1716:
1684:
1683:
1662:
1661:
1645:
1643:
1642:
1637:
1611:
1606:
1605:
1584:
1583:
1564:
1562:
1561:
1556:
1554:
1553:
1537:
1535:
1534:
1529:
1527:
1526:
1492:
1490:
1489:
1484:
1469:
1467:
1466:
1461:
1446:
1444:
1443:
1438:
1436:
1435:
1419:
1417:
1416:
1411:
1409:
1408:
1392:
1390:
1389:
1384:
1379:
1378:
1366:
1365:
1343:
1341:
1340:
1335:
1299:
1297:
1296:
1291:
1289:
1287:
1267:
1266:
1265:
1252:
1247:
1245:
1226:
1218:
1215:
1214:
1205:
1196:
1194:
1193:
1188:
1186:
1185:
1158:discordant pairs
1152:
1150:
1149:
1144:
1139:
1138:
1122:
1120:
1119:
1114:
1112:
1111:
1087:
1085:
1084:
1079:
1074:
1073:
1061:
1060:
1048:
1047:
1036:
1035:
1027:
1015:
1013:
1012:
1007:
1005:
1004:
988:
986:
985:
980:
978:
977:
953:
951:
950:
945:
940:
939:
927:
926:
914:
913:
902:
901:
893:
881:
879:
878:
873:
871:
870:
854:
852:
851:
846:
844:
843:
818:
816:
815:
810:
805:
804:
792:
791:
779:
778:
767:
766:
758:
753:
708:
707:
695:
694:
682:
681:
662:
660:
659:
654:
642:
640:
639:
634:
614:
606:
597:
595:
594:
589:
584:
583:
571:
570:
558:
557:
539:
537:
536:
531:
529:
528:
512:
510:
509:
504:
502:
501:
485:
483:
482:
477:
465:
463:
462:
457:
446:
445:
429:
427:
426:
421:
410:
409:
393:
391:
390:
385:
380:
360:
359:
338:
337:
316:
315:
294:
293:
266:
265:
244:
243:
222:
221:
200:
199:
154:
143:
142:
130:
129:
117:
116:
100:
98:
97:
92:
90:
89:
73:
71:
70:
65:
63:
62:
3701:
3700:
3696:
3695:
3694:
3692:
3691:
3690:
3656:
3655:
3641:
3623:10.2307/2332226
3606:
3597:
3556:
3553:
3552:
3545:
3526:10.1.1.208.2715
3519:. p. 161.
3514:
3513:
3509:
3499:
3497:
3489:Ionescu, Vlad.
3488:
3487:
3483:
3475:
3468:
3467:
3463:
3454:
3453:
3449:
3444:
3422:
3417:
3416:
3413:
3410:
3407:
3404:
3401:
3398:
3395:
3392:
3389:
3386:
3383:
3380:
3377:
3374:
3371:
3368:
3365:
3362:
3359:
3356:
3353:
3350:
3347:
3344:
3341:
3338:
3335:
3332:
3329:
3326:
3323:
3320:
3317:
3314:
3311:
3308:
3305:
3302:
3299:
3296:
3293:
3290:
3287:
3284:
3281:
3278:
3275:
3272:
3269:
3266:
3263:
3260:
3257:
3254:
3251:
3248:
3245:
3242:
3239:
3236:
3233:
3230:
3227:
3224:
3221:
3218:
3215:
3212:
3209:
3206:
3203:
3200:
3197:
3194:
3191:
3188:
3185:
3182:
3179:
3176:
3173:
3170:
3167:
3164:
3161:
3158:
3155:
3152:
3149:
3146:
3143:
3140:
3137:
3134:
3131:
3128:
3125:
3122:
3119:
3116:
3113:
3110:
3107:
3104:
3101:
3098:
3095:
3092:
3089:
3086:
3083:
3080:
3077:
3074:
3071:
3068:
3065:
3062:
3059:
3056:
3053:
3003:
3002:
2962:
2961:
2923:
2901:
2896:
2895:
2870:
2869:
2844:
2843:
2822:
2817:
2816:
2753:
2748:
2747:
2726:
2713:
2708:
2707:
2683:
2678:
2677:
2674:
2673:
2670:
2667:
2664:
2661:
2658:
2655:
2652:
2649:
2646:
2643:
2640:
2637:
2634:
2631:
2628:
2625:
2622:
2619:
2616:
2613:
2610:
2607:
2604:
2601:
2598:
2595:
2592:
2589:
2586:
2583:
2580:
2577:
2574:
2571:
2568:
2565:
2562:
2559:
2556:
2553:
2550:
2547:
2544:
2541:
2538:
2535:
2532:
2529:
2526:
2523:
2520:
2517:
2514:
2511:
2508:
2505:
2502:
2499:
2496:
2493:
2490:
2487:
2484:
2481:
2478:
2475:
2472:
2469:
2466:
2463:
2460:
2457:
2454:
2451:
2448:
2445:
2442:
2439:
2436:
2433:
2430:
2427:
2424:
2421:
2418:
2415:
2412:
2409:
2406:
2403:
2400:
2397:
2394:
2391:
2388:
2385:
2382:
2379:
2376:
2373:
2370:
2367:
2364:
2361:
2358:
2355:
2352:
2342:
2287:
2277:
2276:
2081:Rank by weight
2058:Rank by height
2027:
2014:
1970:
1969:
1918:
1917:
1864:
1856:
1855:
1834:
1829:
1828:
1796:
1774:
1761:
1739:
1734:
1733:
1675:
1653:
1648:
1647:
1597:
1575:
1570:
1569:
1545:
1540:
1539:
1518:
1513:
1512:
1509:
1503:
1472:
1471:
1449:
1448:
1427:
1422:
1421:
1400:
1395:
1394:
1370:
1357:
1346:
1345:
1305:
1304:
1268:
1257:
1253:
1216:
1206:
1199:
1198:
1177:
1172:
1171:
1130:
1125:
1124:
1103:
1098:
1097:
1065:
1052:
1024:
1019:
1018:
996:
991:
990:
969:
964:
963:
931:
918:
890:
885:
884:
862:
857:
856:
835:
830:
829:
796:
783:
755:
699:
686:
673:
668:
667:
645:
644:
600:
599:
575:
562:
549:
544:
543:
520:
515:
514:
493:
488:
487:
468:
467:
437:
432:
431:
401:
396:
395:
351:
329:
307:
285:
257:
235:
213:
191:
134:
121:
108:
103:
102:
81:
76:
75:
54:
49:
48:
45:
37:Maurice Kendall
17:
12:
11:
5:
3699:
3697:
3689:
3688:
3683:
3678:
3673:
3668:
3658:
3657:
3654:
3653:
3647:
3640:
3639:External links
3637:
3636:
3635:
3617:(1/2): 81–89.
3604:
3595:
3574:10.1.1.86.3234
3567:(1): 134–160.
3551:
3550:
3543:
3507:
3495:Stack overflow
3481:
3461:
3446:
3445:
3443:
3440:
3439:
3438:
3433:
3428:
3421:
3418:
3052:
3047:
3046:
3034:
3028:
3024:
3021:
3016:
3013:
3010:
2999:
2987:
2984:
2981:
2978:
2975:
2972:
2969:
2960:requires time
2941:
2938:
2935:
2930:
2926:
2922:
2919:
2916:
2913:
2908:
2904:
2883:
2880:
2877:
2857:
2854:
2851:
2829:
2825:
2798:
2795:
2792:
2789:
2786:
2783:
2780:
2777:
2774:
2771:
2768:
2765:
2760:
2756:
2733:
2729:
2725:
2720:
2716:
2690:
2686:
2351:
2341:
2338:
2334:
2333:
2322:
2319:
2313:
2309:
2305:
2302:
2299:
2296:
2293:
2290:
2286:
2268:
2267:
2265:
2262:
2259:
2255:
2254:
2252:
2249:
2246:
2242:
2241:
2239:
2236:
2233:
2229:
2228:
2226:
2223:
2220:
2216:
2215:
2210:
2207:
2204:
2200:
2199:
2194:
2191:
2188:
2184:
2183:
2181:
2178:
2175:
2171:
2170:
2165:
2162:
2159:
2155:
2154:
2149:
2146:
2143:
2139:
2138:
2136:
2133:
2130:
2126:
2125:
2122:
2119:
2116:
2101:
2100:
2097:
2094:
2091:
2088:
2085:
2082:
2078:
2077:
2074:
2071:
2068:
2065:
2062:
2059:
2055:
2054:
2051:
2048:
2045:
2042:
2039:
2036:
2026:
2023:
2000:
1996:
1992:
1989:
1986:
1983:
1980:
1977:
1948:
1944:
1940:
1937:
1934:
1931:
1928:
1925:
1902:
1899:
1896:
1893:
1890:
1887:
1884:
1881:
1877:
1871:
1867:
1863:
1841:
1837:
1816:
1812:
1808:
1803:
1799:
1795:
1792:
1789:
1786:
1781:
1777:
1773:
1768:
1764:
1760:
1757:
1754:
1751:
1746:
1742:
1719:
1715:
1711:
1708:
1705:
1702:
1699:
1696:
1693:
1690:
1687:
1682:
1678:
1674:
1671:
1668:
1665:
1660:
1656:
1635:
1632:
1629:
1626:
1623:
1620:
1617:
1614:
1610:
1604:
1600:
1596:
1593:
1590:
1587:
1582:
1578:
1552:
1548:
1525:
1521:
1505:Main article:
1502:
1499:
1482:
1479:
1459:
1456:
1434:
1430:
1407:
1403:
1382:
1377:
1373:
1369:
1364:
1360:
1356:
1353:
1333:
1330:
1327:
1324:
1321:
1318:
1315:
1312:
1286:
1283:
1280:
1277:
1274:
1271:
1264:
1260:
1256:
1250:
1244:
1241:
1238:
1235:
1232:
1229:
1224:
1221:
1213:
1209:
1184:
1180:
1154:
1153:
1142:
1137:
1133:
1110:
1106:
1077:
1072:
1068:
1064:
1059:
1055:
1051:
1046:
1043:
1040:
1033:
1030:
1016:
1003:
999:
976:
972:
943:
938:
934:
930:
925:
921:
917:
912:
909:
906:
899:
896:
882:
869:
865:
842:
838:
808:
803:
799:
795:
790:
786:
782:
777:
774:
771:
764:
761:
752:
749:
746:
743:
740:
737:
734:
731:
728:
725:
722:
718:
714:
711:
706:
702:
698:
693:
689:
685:
680:
676:
652:
632:
629:
626:
623:
620:
617:
612:
609:
587:
582:
578:
574:
569:
565:
561:
556:
552:
540:respectively.
527:
523:
500:
496:
475:
455:
452:
449:
444:
440:
419:
416:
413:
408:
404:
383:
379:
375:
372:
369:
366:
363:
358:
354:
350:
347:
344:
341:
336:
332:
328:
325:
322:
319:
314:
310:
306:
303:
300:
297:
292:
288:
284:
281:
278:
275:
272:
269:
264:
260:
256:
253:
250:
247:
242:
238:
234:
231:
228:
225:
220:
216:
212:
209:
206:
203:
198:
194:
190:
187:
184:
181:
178:
175:
172:
169:
166:
163:
160:
157:
153:
149:
146:
141:
137:
133:
128:
124:
120:
115:
111:
88:
84:
61:
57:
44:
41:
15:
13:
10:
9:
6:
4:
3:
2:
3698:
3687:
3684:
3682:
3679:
3677:
3674:
3672:
3669:
3667:
3664:
3663:
3661:
3651:
3648:
3646:
3643:
3642:
3638:
3632:
3628:
3624:
3620:
3616:
3612:
3611:
3605:
3601:
3596:
3592:
3588:
3584:
3580:
3575:
3570:
3566:
3562:
3561:
3555:
3554:
3546:
3540:
3536:
3532:
3527:
3522:
3518:
3511:
3508:
3496:
3492:
3485:
3482:
3474:
3473:
3465:
3462:
3457:
3451:
3448:
3441:
3437:
3434:
3432:
3429:
3427:
3424:
3423:
3419:
3050:
3026:
3022:
3019:
3014:
3008:
3000:
2982:
2979:
2976:
2973:
2967:
2959:
2955:
2954:
2953:
2936:
2928:
2924:
2920:
2914:
2906:
2902:
2881:
2878:
2875:
2855:
2852:
2849:
2827:
2823:
2814:
2813:
2793:
2790:
2787:
2784:
2781:
2778:
2775:
2772:
2769:
2763:
2758:
2754:
2731:
2727:
2723:
2718:
2714:
2704:
2688:
2684:
2349:
2347:
2339:
2337:
2320:
2317:
2311:
2307:
2300:
2297:
2294:
2288:
2284:
2275:
2274:
2273:
2266:
2263:
2260:
2257:
2256:
2253:
2250:
2247:
2244:
2243:
2240:
2237:
2234:
2231:
2230:
2227:
2224:
2221:
2218:
2217:
2214:
2211:
2208:
2205:
2202:
2201:
2198:
2195:
2192:
2189:
2186:
2185:
2182:
2179:
2176:
2173:
2172:
2169:
2166:
2163:
2160:
2157:
2156:
2153:
2150:
2147:
2144:
2141:
2140:
2137:
2134:
2131:
2128:
2127:
2123:
2120:
2117:
2114:
2113:
2110:
2106:
2098:
2095:
2092:
2089:
2086:
2083:
2080:
2079:
2075:
2072:
2069:
2066:
2063:
2060:
2057:
2056:
2052:
2049:
2046:
2043:
2040:
2037:
2034:
2033:
2030:
2024:
2022:
2019:
2016:
2012:
1998:
1994:
1987:
1984:
1981:
1975:
1966:
1963:
1960:
1946:
1942:
1935:
1932:
1929:
1923:
1914:
1894:
1891:
1888:
1882:
1875:
1869:
1865:
1861:
1839:
1835:
1814:
1810:
1801:
1797:
1793:
1790:
1784:
1779:
1775:
1771:
1766:
1762:
1758:
1755:
1752:
1749:
1744:
1740:
1730:
1717:
1713:
1703:
1700:
1697:
1691:
1680:
1676:
1672:
1669:
1663:
1658:
1654:
1627:
1624:
1621:
1615:
1608:
1602:
1598:
1594:
1591:
1588:
1585:
1580:
1576:
1566:
1550:
1546:
1523:
1519:
1508:
1500:
1498:
1495:
1480:
1477:
1457:
1454:
1432:
1428:
1405:
1401:
1375:
1371:
1367:
1362:
1358:
1351:
1328:
1325:
1322:
1319:
1316:
1310:
1301:
1281:
1278:
1275:
1269:
1262:
1258:
1254:
1248:
1239:
1236:
1233:
1227:
1222:
1219:
1211:
1207:
1182:
1178:
1168:
1164:
1161:
1159:
1140:
1135:
1131:
1108:
1104:
1095:
1091:
1070:
1066:
1062:
1057:
1053:
1044:
1041:
1038:
1028:
1017:
1001:
997:
974:
970:
961:
957:
936:
932:
928:
923:
919:
910:
907:
904:
894:
883:
867:
863:
840:
836:
827:
824:
823:
822:
819:
801:
797:
793:
788:
784:
775:
772:
769:
759:
750:
747:
744:
741:
738:
735:
729:
726:
723:
716:
712:
704:
700:
696:
691:
687:
678:
674:
664:
650:
627:
624:
621:
615:
610:
607:
580:
576:
572:
567:
563:
554:
550:
541:
525:
521:
498:
494:
473:
450:
442:
438:
414:
406:
402:
381:
364:
356:
352:
348:
342:
334:
330:
326:
320:
312:
308:
304:
298:
290:
286:
279:
270:
262:
258:
254:
248:
240:
236:
232:
226:
218:
214:
210:
204:
196:
192:
185:
182:
179:
176:
173:
167:
164:
161:
147:
139:
135:
131:
126:
122:
113:
109:
86:
82:
59:
55:
42:
40:
38:
34:
30:
26:
22:
3681:Permutations
3614:
3608:
3599:
3564:
3558:
3516:
3510:
3498:. Retrieved
3494:
3484:
3471:
3464:
3450:
3048:
2810:
2705:
2675:
2343:
2335:
2271:
2212:
2196:
2167:
2151:
2107:
2104:
2028:
2020:
2017:
2013:
1967:
1964:
1961:
1915:
1913:see above)
1731:
1567:
1510:
1496:
1344:instead of
1302:
1169:
1165:
1162:
1155:
1093:
1089:
959:
955:
825:
820:
665:
542:
46:
28:
20:
18:
3500:24 February
2644:ndisordered
2602:logical_and
2566:logical_and
2542:ndisordered
33:bubble sort
3660:Categories
3610:Biometrika
3442:References
3276:&&
3246:&&
3063:kendallTau
2958:merge sort
2868:such that
2812:inversions
2554:logical_or
43:Definition
3650:QuickVote
3569:CiteSeerX
3521:CiteSeerX
3345:normalize
3023:
2980:
2925:τ
2903:τ
2824:τ
2755:τ
2728:τ
2715:τ
2298:−
1985:−
1933:−
1892:−
1794:−
1756:−
1701:−
1673:−
1625:−
1592:−
1429:τ
1402:τ
1372:τ
1359:τ
1279:−
1237:−
1132:τ
1105:τ
1067:τ
1054:τ
1032:¯
998:τ
971:τ
933:τ
920:τ
898:¯
864:τ
837:τ
798:τ
785:τ
763:¯
736:∈
717:∑
701:τ
688:τ
625:−
577:τ
564:τ
522:τ
495:τ
439:τ
403:τ
353:τ
331:τ
327:∧
309:τ
287:τ
280:∨
259:τ
237:τ
233:∧
215:τ
193:τ
136:τ
123:τ
83:τ
56:τ
3686:Distance
3420:See also
3054:#include
2452:meshgrid
2264:2 < 5
2261:4 < 5
2251:1 < 5
2248:3 < 5
2238:1 < 2
2235:3 < 4
2225:4 < 5
2222:2 < 5
2209:4 > 2
2206:2 < 4
2193:4 > 1
2190:2 < 3
2180:3 < 5
2177:1 < 5
2164:3 > 2
2161:1 < 4
2148:3 > 1
2145:1 < 3
2135:3 < 4
2132:1 < 2
2053:ranking
3631:2332226
3591:6249357
2536:values2
2530:argsort
2512:values1
2506:argsort
2416:values2
2401:values1
2380:values2
2374:values1
2025:Example
1393:(where
1088:= 1 if
954:= 0 if
643:(where
3629:
3589:
3571:
3541:
3523:
3372:return
3324:return
2894:while
2641:return
2482:arange
2464:arange
2407:assert
2353:import
2348:) is:
2258:(D,E)
2245:(C,E)
2232:(C,D)
2219:(B,E)
2203:(B,D)
2187:(B,C)
2174:(A,E)
2158:(A,D)
2142:(A,C)
2129:(A,B)
2124:Count
2121:Weight
2118:Height
2035:Person
1827:where
821:where
394:where
3627:JSTOR
3587:S2CID
3476:(PDF)
3342:float
3078:short
3069:short
2356:numpy
2346:NumPy
23:is a
3539:ISBN
3502:2017
3282:<
3270:>
3252:>
3240:<
3210:<
3162:<
3126:bool
2921:>
2879:<
2623:<
2611:>
2587:>
2575:<
2321:0.4.
2115:Pair
1470:and
1420:and
1123:and
1092:and
989:and
958:and
855:and
748:<
513:and
430:and
349:<
305:>
255:>
211:<
180:<
74:and
19:The
3619:doi
3579:doi
3531:doi
3408:2.0
3393:len
3384:len
3363:len
3360:int
3351:int
3327:abs
3213:len
3183:for
3165:len
3141:for
3099:int
3090:len
3087:int
3060:int
3020:log
2977:log
2815:in
2635:sum
2410:len
2395:len
2365:def
1197:is
486:in
101:is
3662::
3625:.
3615:30
3613:.
3585:.
3577:.
3565:17
3563:.
3537:.
3529:.
3493:.
3411:);
3375:kt
3354:kt
3336:);
3312:++
3300:||
3291:if
3222:++
3174:++
2671:))
2638:()
2629:))
2596:np
2593:),
2560:np
2548:np
2524:np
2500:np
2491:))
2476:np
2473:),
2458:np
2446:np
2422:==
2383:):
2362:np
2359:as
1646:,
1160:.
39:.
3633:.
3621::
3593:.
3581::
3547:.
3533::
3504:.
3478:.
3458:.
3414:}
3405:/
3402:)
3399:1
3396:-
3390:(
3387:*
3381:(
3378:/
3369:{
3366:)
3357:,
3348:(
3339:}
3333:v
3330:(
3321:}
3318:}
3315:;
3309:v
3306:)
3303:b
3297:a
3294:(
3288:;
3285:y
3279:y
3273:x
3267:x
3264:=
3261:b
3258:;
3255:y
3249:y
3243:x
3237:x
3234:=
3231:a
3228:{
3225:)
3219:j
3216:;
3207:j
3204:;
3201:1
3198:+
3195:i
3192:=
3189:j
3186:(
3180:{
3177:)
3171:i
3168:;
3159:i
3156:;
3153:0
3150:=
3147:i
3144:(
3138:;
3135:b
3132:,
3129:a
3123:;
3120:0
3117:=
3114:v
3111:,
3108:j
3105:,
3102:i
3096:{
3093:)
3084:,
3081:y
3075:,
3072:x
3066:(
3045:.
3033:)
3027:n
3015:n
3012:(
3009:O
2998:.
2986:)
2983:n
2974:n
2971:(
2968:O
2940:)
2937:j
2934:(
2929:2
2918:)
2915:i
2912:(
2907:2
2882:j
2876:i
2856:j
2853:,
2850:i
2828:2
2797:)
2794:.
2791:.
2788:.
2785:,
2782:3
2779:,
2776:2
2773:,
2770:1
2767:(
2764:=
2759:1
2732:2
2724:,
2719:1
2689:2
2685:n
2668:1
2665:-
2662:n
2659:(
2656:*
2653:n
2650:(
2647:/
2632:.
2626:b
2620:b
2617:,
2614:a
2608:a
2605:(
2599:.
2590:b
2584:b
2581:,
2578:a
2572:a
2569:(
2563:.
2557:(
2551:.
2545:=
2539:)
2533:(
2527:.
2521:=
2518:b
2515:)
2509:(
2503:.
2497:=
2494:a
2488:n
2485:(
2479:.
2470:n
2467:(
2461:.
2455:(
2449:.
2443:=
2440:j
2437:,
2434:i
2428:,
2425:n
2419:)
2413:(
2404:)
2398:(
2392:=
2389:n
2377:,
2371:(
2318:=
2312:2
2308:/
2304:)
2301:1
2295:5
2292:(
2289:5
2285:4
2213:X
2197:X
2168:X
2152:X
2096:5
2093:2
2090:1
2087:4
2084:3
2073:5
2070:4
2067:3
2064:2
2061:1
2050:E
2047:D
2044:C
2041:B
2038:A
1999:2
1995:/
1991:)
1988:1
1982:n
1979:(
1976:n
1947:2
1943:/
1939:)
1936:1
1930:n
1927:(
1924:n
1901:)
1898:)
1895:1
1889:n
1886:(
1883:n
1880:(
1876:/
1870:d
1866:K
1862:2
1840:n
1836:K
1815:2
1811:/
1807:)
1802:c
1798:K
1791:1
1788:(
1785:=
1780:n
1776:K
1772:,
1767:n
1763:K
1759:2
1753:1
1750:=
1745:c
1741:K
1718:4
1714:/
1710:)
1707:)
1704:1
1698:n
1695:(
1692:n
1689:(
1686:)
1681:c
1677:K
1670:1
1667:(
1664:=
1659:d
1655:K
1634:)
1631:)
1628:1
1622:n
1619:(
1616:n
1613:(
1609:/
1603:d
1599:K
1595:4
1589:1
1586:=
1581:c
1577:K
1551:c
1547:K
1524:d
1520:K
1481:2
1478:L
1458:1
1455:L
1433:2
1406:1
1381:)
1376:2
1368:,
1363:1
1355:(
1352:K
1332:)
1329:2
1326:L
1323:,
1320:1
1317:L
1314:(
1311:K
1285:)
1282:1
1276:n
1273:(
1270:n
1263:d
1259:K
1255:2
1249:=
1243:)
1240:1
1234:n
1231:(
1228:n
1223:2
1220:1
1212:d
1208:K
1183:n
1179:K
1141:.
1136:2
1109:1
1094:j
1090:i
1076:)
1071:2
1063:,
1058:1
1050:(
1045:j
1042:,
1039:i
1029:K
1002:2
975:1
960:j
956:i
942:)
937:2
929:,
924:1
916:(
911:j
908:,
905:i
895:K
868:2
841:1
826:P
807:)
802:2
794:,
789:1
781:(
776:j
773:,
770:i
760:K
751:j
745:i
742:,
739:P
733:}
730:j
727:,
724:i
721:{
713:=
710:)
705:2
697:,
692:1
684:(
679:d
675:K
651:n
631:)
628:1
622:n
619:(
616:n
611:2
608:1
586:)
581:2
573:,
568:1
560:(
555:d
551:K
526:2
499:1
474:i
454:)
451:i
448:(
443:2
418:)
415:i
412:(
407:1
382:.
378:|
374:}
371:]
368:)
365:j
362:(
357:2
346:)
343:i
340:(
335:2
324:)
321:j
318:(
313:1
302:)
299:i
296:(
291:1
283:[
277:]
274:)
271:j
268:(
263:2
252:)
249:i
246:(
241:2
230:)
227:j
224:(
219:1
208:)
205:i
202:(
197:1
189:[
186:,
183:j
177:i
174::
171:)
168:j
165:,
162:i
159:(
156:{
152:|
148:=
145:)
140:2
132:,
127:1
119:(
114:d
110:K
87:2
60:1
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.