Title: | Forensic Colors |
---|---|
Description: | An open source software package written in R statistical language. It consist in a set of tools to compute likelihood ratios based on pigmentation traits. Also, it allows computing conditional probabilities for unidentified individuals based on missing person characteristics. A set of tailored plots are incorporated to analyze likelihood ratio distributions. |
Authors: | Franco Marsico [aut, cre], Thore Egeland [aut] |
Maintainer: | Franco Marsico <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.0 |
Built: | 2025-02-21 05:16:21 UTC |
Source: | https://github.com/marsicofl/forensicolors |
This function calculates the Likelihood Ratios (LRs) for each combination of hair colour,
skin colour, and eye colour between two datasets. It assumes one dataset (conditioned
)
contains numerators and the other (unconditioned
) contains denominators.
compute_LRs(conditioned, unconditioned)
compute_LRs(conditioned, unconditioned)
conditioned |
A dataframe with at least the columns 'hair_colour', 'skin_colour', 'eye_colour', and 'numerators'. |
unconditioned |
A dataframe with at least the columns 'hair_colour', 'skin_colour', 'eye_colour', and 'f_h_s_y'. |
A dataframe with the merged data and computed LRs.
data <- simRef() conditioned <- conditionedProp(data, 1, 1, 1, 0.01, 0.01, 0.01) unconditioned <- refProp(data) compute_LRs(conditioned, unconditioned)
data <- simRef() conditioned <- conditionedProp(data, 1, 1, 1, 0.01, 0.01, 0.01) unconditioned <- refProp(data) compute_LRs(conditioned, unconditioned)
This function calculates the conditioned proportions for pigmentation traits for UP, when UP is MP. It considers error rates for observations of hair color, skin color, and eye color.
conditionedProp(data, h, s, y, eh, es, ey)
conditionedProp(data, h, s, y, eh, es, ey)
data |
A data.frame containing the characteristics of UPs. |
h |
An integer representing the MP's hair color. |
s |
An integer representing the MP's skin color. |
y |
An integer representing the MP's eye color. |
eh |
A numeric value representing the error rate for observing hair color. |
es |
A numeric value representing the error rate for observing skin color. |
ey |
A numeric value representing the error rate for observing eye color. |
A numeric vector containing the conditioned proportion (numerator) for each individual in the dataset. These values are calculated based on the probability of observing the given combination of characteristics in the MP, compared to each UP.
This function plots the weighted distribution of the log10 of likelihood ratios (LR), using the probabilities provided in 'numerators' for H1 and 'f_h_s_y' for H2 as weights. The densities are shown for two hypotheses, H1 and H2.
plotLR(data)
plotLR(data)
data |
A dataframe that must contain the columns 'LR', 'numerators', and 'f_h_s_y'. |
A ggplot object showing the weighted density plot.
data <- forensicolors::simRef() conditioned <- conditionedProp(data, 1, 1, 1, 0.01, 0.01, 0.01) unconditioned <- forensicolors:::refProp(data) likelihoods <- forensicolors:::compute_LRs(conditioned, unconditioned) plotLR(likelihoods)
data <- forensicolors::simRef() conditioned <- conditionedProp(data, 1, 1, 1, 0.01, 0.01, 0.01) unconditioned <- forensicolors:::refProp(data) likelihoods <- forensicolors:::compute_LRs(conditioned, unconditioned) plotLR(likelihoods)
This function creates a dataframe that lists every unique combination of hair colour, skin colour, and eye colour in the provided dataset, along with the proportion of occurrences of each combination.
refProp(data)
refProp(data)
data |
A data.frame containing the characteristics of individuals. |
A data.frame with columns for hair_colour, skin_colour, eye_colour, and f_h_s_y.
data <- simRef(1000) refProp(data)
data <- simRef(1000) refProp(data)
This function simulates a dataset representing physical characteristics (hair color, skin color, eye color) of a hypothetical population, based on conditional probability distributions. The size of the simulated population can be adjusted by the user.
simRef(n = 1000, seed = 1234)
simRef(n = 1000, seed = 1234)
n |
The number of individuals in the simulated population. |
seed |
Selected seed for simulations. |
A data.frame
with three columns: hair_colour, skin_colour, and eye_colour,
each representing the respective characteristics of each individual in the sample population.
The hair color is simulated based on predefined probabilities, and skin and eye colors
are generated conditionally based on the hair color.
simRef(1000) # Generates a data frame with 1000 entries based on the defined distributions.
simRef(1000) # Generates a data frame with 1000 entries based on the defined distributions.