Learn R Programming

MasterBayes (version 2.58)

MLE.popsize: 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

References

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

See Also

MCMCped, popsize.loglik

Examples

Run this code
# 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
# }

Run the code above in your browser using DataLab