allPairsLR {relSim} | R Documentation |
Compute the likehood ratio for all pairs of profiles in a database
Description
This function takes every pair of profiles in a database of profiles and computes
the likelihood ratio (LR) for a specific relationship given by nCode
. That means
there will be N(N-1)/2
LRs computed for N profiles.
Usage
allPairsLR(Profiles, listFreqs, nCode)
Arguments
Profiles |
an integer vector of stacked profiles representing the database. This vector has |
listFreqs |
is a set of allele frequencies representing a particular multiplex. The function assumes that that loci in the profiles
are in the same order as the loci in this list. The data structure is a |
nCode |
if |
Value
a NumericVector
containing the LRs. They are stored in sequential order so if for example there were three
profiles, then there are 3 possible LRs, and the result vector would contain the LRs for the profile pairs (1, 2),
(1, 3), and (2, 3).
Author(s)
James Curran
Examples
data("USCaucs")
N = 600
profs = relSim:::.randomProfiles(USCaucs$freqs, N)
system.time({lr = relSim:::allPairsLR(profs, USCaucs$freqs, 1)})
plot(density(log10(lr)))
mean(lr > 1) ## estimate the probability that the LR is incorrectly above 1