# The following example demonstrates the effect on LRs of uncertainty from a small reference db
# We sample a small reference db and compute LRs with estimated frequencies
data(freqsNLsgmplus)
fr.true <- freqsNLsgmplus
# sample a small db
n <- 1e2
x <- sample.profiles(n,fr.true)
x.char <- profiles.to.chars(x,two.cols.per.locus = TRUE)
# estimate frequencies
fr.hat <- list()
for (L in names(fr.true)){
f0.tab <- table(x.char[,paste(L,c(".1",".2"),sep = "")])
fr.hat[[L]] <- setNames(as.vector(f0.tab)/(2*n),names(f0.tab))
}
# not all alleles are seen in the sample, so the ladders don't line up
# rmp(x,fr.hat) # reallly wrong!
fr.hat <- recode.freqs(freqs = fr.hat,along.with = fr.true) # fix
plot(log10(rmp(x)),log10(rmp(x,freqs = fr.hat)))
abline(a=0,b=1)
Run the code above in your browser using DataLab