compute_conditioned_prop: Compute Conditioned Proportions for Pigmentation Traits

View source: R/compute_conditioned_prop.R

compute_conditioned_propR Documentation

Compute Conditioned Proportions for Pigmentation Traits

Description

Calculates the conditioned proportions (numerator probabilities) for pigmentation trait combinations given the missing person's characteristics. These proportions represent P(observed traits | H1), accounting for observation errors.

Usage

compute_conditioned_prop(data, h, s, y, eh, es, ey)

Arguments

data

A data.frame with columns hair_colour, skin_colour, and eye_colour, typically output from sim_reference_pop.

h

Integer (1-5). Missing person's hair color category.

s

Integer (1-5). Missing person's skin color category.

y

Integer (1-5). Missing person's eye color category.

eh

Numeric (0-1). Error rate for observing hair color.

es

Numeric (0-1). Error rate for observing skin color.

ey

Numeric (0-1). Error rate for observing eye color.

Details

The function calculates the probability of observing each trait combination given the MP's true characteristics and the error rates. Higher probabilities are assigned to combinations matching the MP's traits, while combinations with mismatches have probabilities proportional to the error rates.

Value

A data.frame with the original trait columns plus:

  • numerators: Conditioned probability for each combination, normalized to sum to 1

Only unique combinations are returned.

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

sim_reference_pop for generating the input data, compute_reference_prop for reference proportions, lr_compute_pigmentation for computing LRs.

Examples

# Generate reference population
pop_data <- sim_reference_pop(n = 500, seed = 123)

# Compute conditioned proportions for MP with traits (1,1,1)
cond_prop <- compute_conditioned_prop(
  pop_data,
  h = 1, s = 1, y = 1,
  eh = 0.01, es = 0.01, ey = 0.01
)
head(cond_prop)

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