Usage
dd_SR_ML(brts, initparsopt = c(0.5, 0.1, 2 * (1 + length(brts) + missnumspec),
2 * (1 + length(brts) + missnumspec), max(brts)/2), parsfix = NULL, idparsopt
= c(1:3, 6:7), idparsfix = NULL, idparsnoshift = (1:7)[c(-idparsopt,
(-1)^(length(idparsfix) != 0) * idparsfix)], res = 10 * (1 + length(brts) +
missnumspec), ddmodel = 1, missnumspec = 0, cond = TRUE, btorph = 1,
allbp = FALSE, tol = c(1E-3,1E-4,1E-6), maxiter = 1000 * round((1.25)^
length(idparsopt)))
Arguments
brts
A set of branching times of a phylogeny, all positive
initparsopt
The initial values of the parameters that must be optimized
parsfix
The values of the parameters that should not be optimized
idparsopt
The ids of the parameters that must be optimized, e.g. 1:7 for all parameters.
The ids are defined as follows:
id == 1 corresponds to lambda (speciation rate) before the shift
id == 2 corresponds to mu (extinction rate) before the shift
id == 3 cor
idparsfix
The ids of the parameters that should not be optimized, e.g. c(1,3,4,6) if lambda and K
should not be optimized, but only mu. In that case idparsopt must be c(2,5,7). The default is to fix all parameters
not specified in idparsopt.
idparsnoshift
The ids of the parameters that should not shift;
This can only apply to ids 4, 5 and 6, e.g. idparsnoshift = c(4,5) means that lambda and mu have the same values before and after tshift
res
sets the maximum number of species for which a probability must be computed, must be larger than 1 + length(brts)
ddmodel
sets the model of diversity-dependence:
ddmodel == 1 : linear dependence in speciation rate
ddmodel == 2 : exponential dependence in speciation rate
ddmodel == 3 : linear dependence in extinction rate
ddmodel == 4 : exponential dependence in extinctio
missnumspec
The number of species that are in the clade but missing in the phylogeny
cond
Conditioning on non-extinction of the phylogeny (TRUE or FALSE)
btorph
Sets whether the likelihood is for the branching times (0) or the phylogeny (1)
allbp
Sets whether a search should be done with various initial conditions, with tshift at each of the branching points (TRUE/FALSE)
tol
Sets the tolerances in the optimization. Consists of:
reltolx = relative tolerance of parameter values in optimization
reltolf = relative tolerance of function value in optimization
abstolx = absolute tolerance of parameter values in optimization
maxiter
Sets the maximum number of iterations in the optimization