Description Usage Arguments Details
View source: R/semicontinuousMixtureInterpretation.R
This computes the likelihood of a vector of alleles (allelesObserved) given a population of alleles (1 allele per individual, or with weights (populationWeights))
1 2 3 4 5 6 | estimateLog10LikelihoodNaive(
allelesThatExplain,
allelesInPopulation,
populationCounts = NULL,
correctionQuantile = 0.95
)
|
allelesThatExplain |
Vector of alleles that explain the mixture (treated as categorical variables) |
allelesInPopulation |
Vector of alleles in the population. When populationCounts is NULL, each allele is assumed to have a weight of 1 |
populationCounts |
vector of integers ; the number of times each allele (allelesInPopulation) is found; default: all weights are 1 |
correctionQuantile |
real number; the quantile used in the Clopper and Pearson correction (binomial). If <= 0, the frequency estimate is used. |
The likelihood can be computed two ways: Using the allele frequency correction of Clopper and Pearson (upper-bound taken from correctionQuantile) OR taking a simple point estimate (frequency).
This computes: log10 ( n! * f(a) * f(b), ... ) ) for n alleles of type: a, b, c, with frequencies f(a), f(b), ... Two alleles (p,q) this gives the standard formulation of 2pq
f(a) is the trickier part: with the simple point estimate it's computed using the allele frequency (union of observed and population alleles)
of quantile is sought, then the upper bound from the binomial is used eg, if you have an allele frequency of 1/100, and upper-bound is taken with the forensic standard being the upper-portion of the 95 CI
To make for less redundancy, allele counts can be used; eg, you can have 10 A alleles and 10 B alleles You can either give the function 10 As and 10 Bs (allelesInPopulation) or you can give it: allelesInPopulation=c("A", "B"), populationCounts=c(10, 10)
e.g., these are equivalent: 10**estimateLog10LikelihoodNaive(c("A", "B"), rep(LETTERS[1:10], 10), correctionQuantile = 0.95 10**estimateLog10LikelihoodNaive(c("A", "B"), LETTERS[1:10], populationCounts=rep(10, 10), correctionQuantile = 0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.