calcQualMLE | R Documentation |
Optimizing the likelihood function based on qualitative model (LRmix).
calcQualMLE(
nC,
samples,
popFreq,
refData = NULL,
condOrder = NULL,
knownRef = NULL,
prC = 0.05,
fst = 0,
prDcontr = NULL,
prDcommon = NULL,
steptol = 1e-06,
prDv0 = c(0.1, 0.35, 0.7),
maxIter = 10000
)
nC |
Number of contributors in model. Must be a constant. |
samples |
A List with samples which for each samples has locus-list elements with list elements adata and hdata. 'adata' is a qualitative (allele) data vector and 'hdata' is a quantitative (peak heights) data vector. |
popFreq |
A list of allele frequencies for a given population. |
refData |
Reference objects with (2-size) allele-vector given in list element [[i]][[s]]. |
condOrder |
Specify conditioning references from refData (must be consistent order). For instance condOrder=(0,2,1,0) means that we restrict the model such that Ref2 and Ref3 are respectively conditioned as 2. contributor and 1. contributor in the model. |
knownRef |
Specify known non-contributing references from refData (index). For instance knownRef=(1,2) means that reference 1 and 2 is known non-contributor in the hypothesis. This affectes coancestry correction. |
prC |
A numeric for allele drop-in probability. Can be a vector (must contain the marker names). Default is 0. |
fst |
The co-ancestry coefficient. Can be a vector (must contain the marker names). Default is 0. |
prDcontr |
assumed known dropout parameter for all contributors, NA means to be optimized. Must be a nC long vector if given. |
prDcommon |
vector indicating which contributors should share common drop-out parameter. Assign integers to contributors with common parameters. NA means not optimized. |
steptol |
Argument used in the nlm function for faster return from the optimization (tradeoff is lower accuracy). |
prDv0 |
Start values for fitting the drop-out probabilities (will be spanned if multidimensional) |
maxIter |
Maximum number of iterations for nlm |
ret A list(fit,model,nDone,delta,seed,prepareC) where fit is Maximixed likelihood elements for given model.
Oyvind Bleka
## Not run:
AT = 50 #analytical threshold
sep0 = .Platform$file.sep
popfn = paste(path.package("euroformix"),"FreqDatabases",paste0(kit,"_Norway.csv"),sep=sep0)
evidfn = paste(path.package("euroformix"),"examples",paste0(kit,"_3p.csv"),sep=sep0)
reffn = paste(path.package("euroformix"),"examples",paste0(kit,"_refs.csv"),sep=sep0)
popFreq = freqImport(popfn)[[1]] #population frequencies
samples = sample_tableToList(tableReader(evidfn)) #evidence samples
refData = sample_tableToList(tableReader(reffn)) #reference sample
dat = prepareData(samples,refData,popFreq,threshT=AT) #needed for qual method
condOrder = c(1,2,0) #assuming C1=ref1,C2=ref2
logLik1 = calcQualMLE(2,dat$samples,dat$popFreq,dat$refData,condOrder)$loglik
logLik2 = calcQualMLE(3,dat$samples,dat$popFreq,dat$refData,condOrder, prDcommon=c(1,1,2))$loglik
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.