ELR: Expected LR of a pairwise kinship test

View source: R/ELR.R

ELRR Documentation

Expected LR of a pairwise kinship test

Description

Calculates the exact likelihood ratio of a pairwise kinship test, implementing formulas of Egeland & Slooten (2016).

Usage

ELR(x, true = x, ids = leaves(x), L1, L2 = NULL, rho = NULL)

Arguments

x

An hypothesised pedigree connecting two individuals.

true

The true relationship between the two individuals.

ids

A vector containing the names of the two individuals. Note: These must occur in both x and true.

L1

The number of alleles at the first locus.

L2

The number of alleles at the second locus, or NULL (default).

rho

(If L2 is not NULL.) A numeric vector of recombination fractions. Values outside the interval [0, 0.5] will raise an error.

Value

A single number, the expected LR.

References

Egeland, T. and Slooten, K. (2016). The likelihood ratio as a random variable for linked markers in kinship analysis. Int J Legal Med.

Examples

#############################
# Fig. 2 of Egeland & Slooten
#############################

rhos = seq(0, 0.5, length = 11)

dat = cbind(
  Grand = ELR(linearPed(2), ids = c(1,5), L1 = 10, L2 = 30, rho = rhos),
  Half = ELR(halfSibPed(), ids = c(4,5), L1 = 10, L2 = 30, rho = rhos),
  Uncle = ELR(avuncularPed(), ids = c(3,6), L1 = 10, L2 = 30, rho = rhos))

matplot(rhos, dat, type = "l",  lwd = 2, ylab = "E[LR]", ylim = c(0, 8))
legend("bottomleft", legend = colnames(dat), lty = 1:3, col = 1:3, lwd = 2)




magnusdv/ribd documentation built on March 29, 2024, 5:20 a.m.