cml {mixstock}R Documentation

Mixed stock analysis by conditional maximum likelihood

Description

Find the conditional maximum likelihood estimate (assuming marker frequencies in the sources are exactly equal to the sample frequencies) of the contributions of different sources to a mixed stock

Usage

cml(x, start.type="lsolve", fuzz=0, bounds=1e-4,
ndepfac=1000,method="L-BFGS-B",lower=NULL,upper=NULL,
ndeps=NULL,
control=NULL,debug=FALSE,transf="part",grad=cml.grad,...)

Arguments

x a list with elements mixsamp (a vector of the sampled markers in the mixed stock) and sourcesamp (a matrix, with markers in rows and sources in columns, of markers in the source samples)
grad function giving the gradient of the likelhood
start.type starting values to use: equal (equal contributions from each source); random (multinomial sample with equal probabilities); rand2 (sample out of a transformed normal distribution); a number between 1 and the number of sources; that source starts with 0.95 contribution and the rest start with 0.05/(R-1); default lsolve, the linear solution to the problem
fuzz min. value (1-min is the max.) for starting contributions
bounds (bounds,1-bounds) are the lower and upper bounds for mle calculations
ndepfac factor for computing numerical derivatives; numerical derivative stepsize is computed as bounds/ndepfac [OBSOLETE with gradient function?]
method optimization method, to be passed to optim
debug produce debugging output?
lower lower bound
upper upper bound
ndeps scaling factor for optimization
control other control arguments to optim
transf (character) "full": use arctan transform to transform (-Inf,Inf) to (0,1) or vice versa; "part": don't; "none"; no transform
... other arguments to mle or optim (e.g. hessian=FALSE to suppress (slow) hessian calculation, etc.)

Details

By default, uses mle which in turn uses optim with method="L-BFGS-B" to do bounded optimization

Value

an object of class mixstock.est, containing the results of the fit

Author(s)

Ben Bolker

Examples

true.freq <- matrix(c(0.65,0.33,0.01,0.01,
                      0.33,0.65,0.01,0.01),ncol=2)
true.contrib <- c(0.9,0.1)
x <- simmixstock0(true.freq,true.contrib,50,100,1004)
cml.est <- cml(x)
cml.est

[Package mixstock version 0.9 Index]