ibdLoglik {forrel}R Documentation

Pairwise IBD likelihood

Description

Given genotype data from two individuals, computes the log-likelihood of a single set of IBD coefficients, either kappa = (\kappa_0, \kappa_1, \kappa_2) or the Jacquard coefficients delta = (\Delta_1, ..., \Delta_9). The ibdLoglikFUN version returns an efficient function for computing such likelihoods, suitable for optimisations such as in ibdEstimate().

Usage

ibdLoglik(x = NULL, ids = NULL, kappa = NULL, delta = NULL)

ibdLoglikFUN(x, ids, input = c("kappa", "kappa02", "delta"))

Arguments

x

A ped object or a list of such.

ids

A vector of ID labels.

kappa

A probability vector of length 3.

delta

A probability vector of length 9.

input

Either "kappa", "kappa02" or "delta". See Value.

Value

ibdLoglik() returns a single number; the total log-likelihood over all markers included.

ibdLoglikFUN() returns a function for computing such log-likelihoods. The function takes a single input vector p, whose interpretation depends on the input parameter:

Examples

# Siblings typed with 10 markers
x = nuclearPed(2) |> markerSim(N = 10, alleles = 1:4)

# Calculate log-likelihood at a single point
k = c(0.25, 0.5, 0.25)
ibdLoglik(x, ids = 3:4, kappa = k)

# Or first get a function, and then apply it
llFun = ibdLoglikFUN(x, ids = 3:4, input = "kappa")
llFun(k)



[Package forrel version 1.8.0 Index]