MLE.popsize: Maximum Likelihood Estimation of the Unsampled Population...

MLE.popsizeR Documentation

Maximum Likelihood Estimation of the Unsampled Population Size

Description

Finds the MLE for the number of unsampled males and/or females following Nielsen et al. (2001). The size of the unsampled population can vary over time and space, and genotyping error is accomodated using the CERVUS model of genotyping error (Kalinwoski et al. 2006).

Usage

MLE.popsize(X.list, USdam=FALSE, USsire=FALSE, nUS=NULL, 
   ped=NULL, shrink=NULL)

Arguments

X.list

list of design matrices for each offspring derived using getXlist

USdam

logical or character; if TRUE a single undiferentiated population of unsampled females exists. If USdam is a character vector it must have the same length as the number of offspring (length(X.list$X)) with factor levels representing sub-populations (in time or space) over which the number of unsampled females vary.

USsire

logical or character; if TRUE a single undiferentiated population of unsampled males exists. if USsire is a character vector it must either have the same length as the number of offspring (length(X.list$X)) with factor levels representing sub-populations (in time or space) over which the number of unsampled males vary, or alternatively "USdam", in which case the unsampled male and female populations are constrained to be equal.

nUS

optional starting vector for the size of the unsampled population. Parmeters for the unsampled female population come before the male population.

ped

optional pedigree with id, dam and sire in ech column

shrink

optional scalar for the variance defining the ridge-regression likelihood penalisation.

Value

nUS

vector of MLE's for the size of the unsampled population. Lower bound is 1e-5 for numerical stability.

C

large sample variance-covariance matrix of nUS MLE's

Note

Nielsen's original model does not account for genotyping error, and estimation of the unsampled population size is VERY sensitive to the level of genotyping error. This function implements a commonly used approxiamtion for genotyping error that ignores pedigree information. For many problems this approximation seems valid, but appears to break down when estimating the size of the unsampled population size. Bayesian estimation of the unsampled population size (see MCMCped) that uses an exact solution for genotyping error is more robust.

Author(s)

Jarrod Hadfield j.hadfield@ed.ac.uk

References

Nielsen. R. et.al Genetics (2001) 157 4 1673-1682

See Also

MCMCped, popsize.loglik

Examples

## Not run: 
data(WarblerP)
data(WarblerG)

GdP<-GdataPed(WarblerG)
res1<-expression(varPed("offspring", restrict=0))

PdP<-PdataPed(formula=list(res1), data=WarblerP, USsire=TRUE, USdam=TRUE)

X.list<-getXlist(PdP=PdP, GdP=GdP, E2=0.02)

nUS<-MLE.popsize(X.list, USsire=TRUE, USdam=TRUE)
nUS

## End(Not run)

MasterBayes documentation built on June 22, 2022, 5:06 p.m.