calc.nswaps: Calculates the number of swaps required to move from one...

Description Usage Arguments Details Value

Description

Calculates the number of swaps required to move from one order to another.

Usage

1
calc.nswaps(map1, map2)

Arguments

map1

Vector of marker positions or ranks.

map2

Vector of marker positions or ranks.

Details

This is intended to be used when comparing an estimated marker ordering to some perceived "truth". It is most likely to be useful when dealing with simulated data where the concept of truth makes most sense. It calculates the minimum number of single place swaps that would be needed to move from map1 to map2 and it does this by reverse engineering kendall's tau b correlation coefficient

τ=2(C-D)/N

where N is the total number of pairs of markers, C the number of concordant pairs and D the number of discordant pairs. If there are n markers then the total number of pairs N=nC_2 and C=N-D so D=0.5 nC_2(1-τ) and the minimum number of swaps is the minimum of D and N-D

Value

Scalar giving the number of swaps.


MDSMap documentation built on May 1, 2019, 6:51 p.m.