View source: R/sim_reference_pop.R
| sim_reference_pop | R Documentation |
Generates a simulated population dataset with correlated pigmentation characteristics (hair color, skin color, eye color). The traits are simulated using conditional probability distributions that reflect realistic correlations between these characteristics.
sim_reference_pop(n = 1000, seed = 1234)
n |
Integer. Number of individuals to simulate. Default: 1000. |
seed |
Integer. Random seed for reproducibility. Default: 1234. |
Hair color categories:
Blonde/Light
Light brown
Medium brown
Dark brown
Black
The simulation uses conditional probability distributions where:
Hair color is sampled first from population frequencies
Skin color is sampled conditional on hair color
Eye color is sampled conditional on both hair and skin color
This captures realistic correlations (e.g., darker hair tends to co-occur with darker skin and eyes).
A data.frame with three columns:
hair_colour: Hair color category (1-5)
skin_colour: Skin color category (1-5)
eye_colour: Eye color category (1-5)
Categories are numbered 1 (lightest) to 5 (darkest).
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")}
compute_conditioned_prop for computing proportions,
compute_reference_prop for reference frequencies,
lr_pigmentation for pigmentation LR calculations.
# Simulate a population of 500 individuals
pop_data <- sim_reference_pop(n = 500, seed = 123)
head(pop_data)
# Check trait distributions
table(pop_data$hair_colour)
table(pop_data$skin_colour)
table(pop_data$eye_colour)
# Use for LR calculations
conditioned <- compute_conditioned_prop(pop_data, h = 1, s = 1, y = 1,
eh = 0.01, es = 0.01, ey = 0.01)
unconditioned <- compute_reference_prop(pop_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.