lr_pigmentation: Simulate LR Distributions for Pigmentation Traits

View source: R/lr_pigmentation.R

lr_pigmentationR Documentation

Simulate LR Distributions for Pigmentation Traits

Description

Simulates likelihood ratio (LR) distributions for combined pigmentation traits (hair, skin, and eye color) under both hypotheses. Uses pre-computed LRs from lr_compute_pigmentation.

Usage

lr_pigmentation(df, seed = 1234, nsim = 500)

Arguments

df

A data.frame with columns numerators, f_h_s_y, and LR. Typically output from lr_compute_pigmentation.

seed

Integer. Random seed for reproducibility. Default: 1234.

nsim

Integer. Number of LR values to simulate per hypothesis. Default: 500.

Details

The function samples LR values with probabilities proportional to:

  • H2 (Unrelated): Population frequencies (f_h_s_y)

  • H1 (Related): Conditioned probabilities (numerators)

This simulates the expected distribution of LRs when comparing the MP's traits against either random individuals (H2) or the true match (H1).

Value

A data.frame with two columns:

  • Unrelated: LR values simulated under H2 (sampling proportional to population frequencies)

  • Related: LR values simulated under H1 (sampling proportional to conditioned probabilities)

Deprecation

Soft-deprecated in mispitools 2.0. Combined pigmentation is generalised by nongenetic_feature (a categorical feature over the joint pigmentation classes). 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_reference_pop for generating population data, lr_compute_pigmentation for computing input LRs, plot_lr_distribution for visualization.

Examples

# Full workflow for pigmentation LRs
pop_data <- sim_reference_pop(n = 500, seed = 123)
conditioned <- compute_conditioned_prop(pop_data, 1, 1, 1, 0.01, 0.01, 0.01)
unconditioned <- compute_reference_prop(pop_data)
lrs <- lr_compute_pigmentation(conditioned, unconditioned)

# Simulate LR distribution
lr_dist <- lr_pigmentation(lrs, nsim = 500, seed = 456)
head(lr_dist)

# Visualize
plot_lr_distribution(lr_dist)

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