### Example 1: Siblings
# Create pedigree and simulate 100 markers
x = nuclearPed(2) |> markerSim(N = 100, alleles = 1:4, seed = 123)
x
# Estimate kappa (expectation: (0.25, 0.5, 0.25)
k = ibdEstimate(x, ids = 3:4)
k
# Visualise estimate
showInTriangle(k, labels = TRUE)
# Contour plot of the log-likelihood function
ibdEstimate(x, ids = 3:4, contourPlot = TRUE)
### Example 2: Full sib mating
y = fullSibMating(1) |>
markerSim(ids = 5:6, N = 1000, alleles = 1:10, seed = 123)
# Estimate
ibdEstimate(y, param = "delta")
# Exact coefficient by `ribd`:
ribd::condensedIdentity(y, 5:6, simplify = FALSE)
Run the code above in your browser using DataLab