calcLR: Calculate the likelihood ratio

View source: R/calcLR.R

calcLRR Documentation

Calculate the likelihood ratio

Description

Takes a compitem object which represents some control item, and a compitem object which represents a recovered item, then uses information from a compcovar object, which represents the information from the population, to calculate a likelihood ratio (LR) as a measure of the evidence given by the observations for the same/different source propositions.

Usage

calcLR(control, recovered, background, method = c("mvn", "kde", "lindley"))

Arguments

control

a compitem object with the control item information.

recovered

a compitem object with the recovered item information.

background

a compcovar object with the population information.

method

a choice of the method used to calculate the LR. Presently there are three methods, "mvn" - multivariate normal approximation, "kde" - (multivariate) kernel density estimates and "lindely" which uses the method published by Lindley (1977).

Value

an estimate of the likelihood ratio

References

Aitken, C.G.G. & Lucy, D. (2004) Evaluation of trace evidence in the form of multivariate data. Applied Statistics: 53(1); 109-122.

Examples

data(glass)

controlMeasurements = subset(glass, item == "s1")
control = makeCompItem(item ~ logKO + logCaO + logFeO, 
                       data = controlMeasurements[1:6,])
recovered.1 = makeCompItem(item ~ logKO + logCaO + logFeO, 
                       data = controlMeasurements[7:12,])
recoveredMeasurements = subset(glass, item == "s2")
recovered.2 = makeCompItem(item ~ logKO + logCaO + logFeO,
                           data = recoveredMeasurements[7:12,])
                           
background = makeCompVar(item ~ logKO + logCaO + logFeO, data = glass)
                           
## Same source comparison using a multivariate normal (MVN) approximation
calcLR(control, recovered.1, background)

## Same source comparison using a multivariate kernel density estimate (MVK) approximation
calcLR(control, recovered.1, background, "kde")

## Different source comparison using a multivariate normal (MVN) approximation
calcLR(control, recovered.2, background)

## Different source comparison using a multivariate kernel density estimate (MVK) approximation
calcLR(control, recovered.2, background, "kde")


comparison documentation built on Aug. 25, 2023, 5:14 p.m.