kendall2Lists: Calculate modified Kendall's tau distance

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Kendall's tau is equal to the number of adjunct pairwise exchanges required to convert one ranking into another. This modified version allows for partial lists to be compared.

Usage

1
2
Kendall2Lists(rank.a, rank.b, k.a, k.b, n, p = 0)
Kendall2Lists.c(rank.a, rank.b, k.a, k.b, n, p = 0)

Arguments

rank.a

A single top-k list

rank.b

A vector of matrix form of top-k list(s) to be compared to the list a

k.a

Value of k for rank.a

k.b

Value of k for rank.b

n

Total number of objects, numbered from 1 to n

p

Distance added for tied pair (potential problem when p != 0)

Details

There are two implementations available. Pure R code in kendall and a faster implementation using native C code kendall.c.

Value

Returns modified Kendall's tau distance against a for each list within b

Author(s)

Jie Ding <jding@jimmy.harvard.edu>

References

Lin, S., Ding, J. (2009) Integration of ranked lists via Cross Entropy Monte Carlo with applications to mRNA and microRNA studies. Biometrics 65, 9-18.

See Also

Spearman

Examples

1
2
3
4
5
set.seed(1234)
a <- sample(1:10, 10)
b <- sample(1:10, 10)
Kendall2Lists(a, b, 6, 6, 10)
Kendall2Lists.c(a, b, 6, 6, 10)

Example output

[1] 24
[1] 21

TopKLists documentation built on May 2, 2019, 4:41 p.m.