Usage
bd.densdep.optim(x,minK,maxK,discrete=TRUE,continuous=FALSE,lambdainit=2,
muinit=1,Kinit=0,Yule=FALSE,muset=0,rho=1,model=-1)
Arguments
x
Vector of speciation times in the phylogeny. Time is measured increasing going into the past with the present being time 0. x can be obtained from a phylogenetic tree using getx(TREE).
minK
Minimal value of K (when discrete=TRUE). Default is minK = (number of species).
maxK
Maximal value of K (when discrete=TRUE). Default is maxK = 1.5(number of species).
discrete
If discrete=TRUE, the likelihood function is maximized with K being an integer and the minimal size being minK and the maximal size being maxK.
continuous
If continuous=TRUE, the likelihood function is maximized with K being a continuous parameter. The function subplex is used for optimization and sometimes gets stuck at a non-optimal K. Thus it is recommended to also calculate with discrete=TRUE.
lambdainit
Initial lambda value for optimization when K is continuous (default is 2).
muinit
Initial mu value for optimization when K is continuous (default is 1).
Kinit
Initial K value for optimization when K is continuous (default is Kinit=0 which automatically sets Kinit=(number of species)+1).
Yule
Yule=FALSE is default. Yule=TRUE fixes mu=0, i.e. no extinction.
muset
muset=0 (default) maximizes over the whole parameter range. muset>0 means that the optimization is done over all mu>muset. muset
rho
rho=1 is default meaning all present-day species are sampled. 0=n has given rise to a sample of size n with probability 1. rho<-1 means that any number n,n+1,..,(-k) of present-day species may have given rise to a sample of size n with probability 1. rho>1 means that exactly rho>n present-day species gave rise to the sample n with probability 1.
model
model=-1 (default) is the density-dependent model. model=0 (only relevant for testing purposes) assumes that lambda is constant for number of species < K, and 0 for number of species >= K. model=0 is used for testing / comparing to constant rate model implemented in bd.shifts.optim.