parentChildLikelihood: Parent-child pedigree likelihoods

View source: R/fEstimate.R

parentChildLikelihoodR Documentation

Parent-child pedigree likelihoods

Description

Fast likelihood computation of pedigrees in which the only genotyped individuals are a (noninbred) parent and their (possibly inbred) child. In this case the pedigree information is fully captured by the inbreeding coefficient f of the child, enabling efficient calculations by vectorising over the markers.

Usage

parentChildLikelihood(x, parent = NULL, child = NULL, f = NULL, check = TRUE)

Arguments

x

A ped object with exactly two typed members.

parent

ID of parent; identified automatically if missing.

child

ID of child; identified automatically if missing.

f

Inbreeding coefficient of child, calculated with ribd::inbreeding() if missing.

check

A logical indicating whether to check parent and child in x.

Value

A numeric vector with per-marker likelihoods P(parent & child genotypes | f).

Examples


db = NorwegianFrequencies[1:10]

# Simulate genotypes for a child of first cousins, and his mother
x = cousinPed(1, child = TRUE) |> profileSim(ids = 8:9, markers = db)

plot(x, hatched = typedMembers)

liks = parentChildLikelihood(x)

# Compare with standard likelihood calculation, requiring loop breaking etc.
stopifnot(all.equal(liks, pedprobr::likelihood(x)))

# bench::mark(parentChildLikelihood(x), pedprobr::likelihood(x))


forrel documentation built on June 28, 2026, 5:07 p.m.