as_lr_dist: Coerce to a Likelihood-Ratio Distribution Object

View source: R/lr_dist_s3.R

as_lr_distR Documentation

Coerce to a Likelihood-Ratio Distribution Object

Description

Wraps a sparse (\log_{10}\mathrm{LR}, P(\cdot\mid H_1), P(\cdot\mid H_2)) table in an lr_dist object so the decision- theoretic summary() and plot() methods can be applied. This is the low-level constructor; the model-aware lr_distribution() wrapper is added in a later release and produces the same class.

Usage

as_lr_dist(x)

Arguments

x

A data.frame or list with numeric components log10_lr, p_h1 and p_h2, all of the same length. Typically the output of the per-marker LR distribution engine.

Details

Each row is an atom of the discrete LR distribution: log10_lr is the log10 likelihood ratio, p_h1 its probability under H_1 (the person of interest is the missing person) and p_h2 its probability under H_2 (unrelated). +Inf / -Inf atoms (which arise under mutation = "none") are allowed and handled by the summaries with the limit 0\log 0 = 0.

Value

An object of class lr_dist (a data.frame with the three columns), suitable for summary.lr_dist() and plot.lr_dist().

See Also

summary.lr_dist(), plot.lr_dist()

Examples

d <- data.frame(
  log10_lr = c(-1, 0, 2),
  p_h1 = c(0.1, 0.3, 0.6),
  p_h2 = c(0.6, 0.3, 0.1)
)
x <- as_lr_dist(d)
summary(x)

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