lr_age: Likelihood Ratio for Age Variable

View source: R/lr_age.R

lr_ageR Documentation

Likelihood Ratio for Age Variable

Description

Simulates age observations and optionally computes likelihood ratios (LRs) under either H1 (unidentified person is the missing person) or H2 (unidentified person is not the missing person).

Ages are categorized into two groups based on whether they fall within the missing person's estimated age range:

  • T1: Age within range (MPa - MPr) to (MPa + MPr)

  • T0: Age outside range

Usage

lr_age(
  MPa = 40,
  MPr = 6,
  UHRr = 1,
  gam = 0.07,
  numsims = 1000,
  epa = 0.05,
  erRa = epa,
  H = 1,
  modelA = c("uniform", "custom")[1],
  LR = FALSE,
  seed = 1234,
  nsims = NULL
)

Arguments

MPa

Numeric. Missing person's estimated age in years. Default: 40.

MPr

Numeric. Age range tolerance (plus/minus years). The matching interval is (MPa - MPr) to (MPa + MPr). Default: 6.

UHRr

Numeric. Additional uncertainty range for the unidentified person's age estimation. Default: 1.

gam

Numeric. Gamma parameter for age uncertainty scaling. The uncertainty interval is age +/- (gam * age + UHRr). Default: 0.07.

numsims

Integer. Number of simulations to perform. Default: 1000.

epa

Numeric (0-1). Error rate for age categorization. Default: 0.05.

erRa

Numeric (0-1). Error rate in the reference/database. Defaults to epa.

H

Integer (1 or 2). Hypothesis to simulate under:

  • 1: H1 (Related) - Unidentified person IS the missing person

  • 2: H2 (Unrelated) - Unidentified person is NOT the missing person

Default: 1.

modelA

Character. Reference age distribution model:

  • "uniform": Assumes uniform age distribution (default)

  • "custom": Uses empirical frequencies from simulations

LR

Logical. If TRUE, compute and return LR values. Default: FALSE.

seed

Integer. Random seed for reproducibility. Default: 1234.

nsims

Deprecated. Use numsims instead.

Details

Under H1 (Related): Age is sampled to fall within the MP's range with probability (1 - erRa), outside with probability erRa.

Under H2 (Unrelated): Age is sampled uniformly from 1-80, then categorized.

LR Calculation (uniform model):

  • LR(T1) = (1 - epa) / P(T1), where P(T1) = 2*MPr/80

  • LR(T0) = epa / P(T0), where P(T0) = 1 - P(T1)

Value

A data.frame with columns:

  • group: Age group classification ("T1" or "T0")

  • age: Simulated age value

  • UHRmin: Lower bound of uncertainty interval

  • UHRmax: Upper bound of uncertainty interval

  • LRa: Likelihood ratio (only if LR = TRUE)

Deprecation

Soft-deprecated in mispitools 2.0. This feature is generalised by nongenetic_feature (a continuous feature); collapsing the population grid to two cells (within tolerance vs outside) reproduces the T1 / T0 LR exactly. The legacy function still works for the 2.0 release-candidate cycle and will be removed afterwards.

References

Marsico FL, et al. (2023). "Likelihood ratios for non-genetic evidence in missing person cases." Forensic Science International: Genetics, 66, 102891. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.fsigen.2023.102891")}

See Also

nongenetic_feature for the unified replacement, sim_lr_prelim for unified preliminary LR simulations, lr_sex, lr_hair_color for other variables.

Examples

# Simulate under H1 (related)
sim_h1 <- lr_age(MPa = 40, MPr = 6, H = 1, numsims = 100)
table(sim_h1$group)

# Simulate under H2 with LR values
sim_h2 <- lr_age(MPa = 40, MPr = 6, H = 2, numsims = 100, LR = TRUE)
head(sim_h2)

# Narrower age range (more discriminating)
sim_narrow <- lr_age(MPa = 35, MPr = 3, numsims = 500, LR = TRUE)
summary(sim_narrow$LRa)

mispitools documentation built on Aug. 26, 2026, 1:08 a.m.