missingPersonLR: Likelihood ratio calculation for missing person...

View source: R/missingPersonLR.R

missingPersonLRR Documentation

Likelihood ratio calculation for missing person identification


This is a wrapper function for kinshipLR() for the special case of missing person identification. A person of interest (POI) is matched against a reference dataset containing genotypes of relatives of the missing person.


missingPersonLR(reference, missing, poi = NULL, verbose = TRUE, ...)



A ped object with attached markers.


The ID label of the missing member of reference.


A singleton object, or NULL. If NULL, and missing is genotyped, this data is extracted and used as poi.


A logical.


Optional parameters to be passed on to kinshipLR().


Note that this function accepts two forms of input:

  1. With poi a typed singleton. This is the typical use case, when you want to compute the LR for some person of interest.

  2. With poi = NULL, but missing being genotyped. The data for missing is then extracted as a singleton POI. This is especially useful in simulation procedures, e.g., for simulating the LR distribution of the true missing person.

See Examples for illustrations of both cases.


The LRresult object returned by kinshipLR(), but without the trivial H2:H2 comparison.


# Example: Identification of a missing grandchild

# Database with 5 STR markers (increase to make more realistic)
db = NorwegianFrequencies[1:5]

# Pedigree with missing person (MP); grandmother is genotyped
x = linearPed(2) |>
  relabel(old = 5, new = "MP") |>
  profileSim(markers = db, ids = "2", seed = 123)

### Scenario 1: Unrelated POI --------------------

# Generate random unrelated profile
poi = singleton("POI") |>
  profileSim(markers = db, seed = 1234)

# Compute LR
lr = missingPersonLR(x, missing = "MP", poi = poi)

### Scenario 2: POI is the missing person --------
# A small simulation example

# Simulate profiles for MP conditional on the grandmother
N = 10
y = profileSim(x, N = N, ids = "MP", seed = 12345)

# Compute LRs for each sim
LRsims = lapply(y, missingPersonLR, missing = "MP", verbose = FALSE)

# Plot distribution
LRtotal = sapply(LRsims, function(a) a$LRtotal)

# LRs for each marker
LRperMarker = sapply(LRsims, function(a) a$LRperMarker)

# Overlaying marker-wise density plots (requires tidyverse)
# library(tidyverse)
# t(LRperMarker) |> as_tibble() |> pivot_longer(everything()) |>
#   ggplot() + geom_density(aes(value, fill = name), alpha = 0.6)

forrel documentation built on Nov. 19, 2023, 5:14 p.m.