Turns a likelihood ratio into the probability of the first hypothesis,
which needs a prior. A large ratio with a small prior can still leave that
probability low; reading the ratio as the probability is the prosecutor's
fallacy. See proof("lrpost").
Arguments
- lr
Likelihood ratios: positive numbers.
- prior
The prior probability of the first hypothesis, strictly
between 0 and 1: one value, or one per ratio, matched to lr by name
when both are named with unique names.
Value
The posterior probabilities.
Examples
lrpost(lr = 1e6, prior = 1 / 5e6)
#> [1] 0.1666667