Usage
pbd_ML(
brts,
initparsopt = c(0.2,0.1,1),
idparsopt = 1:length(initparsopt),
idparsfix = NULL,
parsfix = NULL,
exteq = 1,
parsfunc = c(function(t,pars) {pars[1]},function(t,pars) {pars[2]},
function(t,pars) {pars[3]}, function(t,pars) {pars[4]}),
missnumspec = 0,
cond = 1,
btorph = 1,
soc = 2,
methode = "lsoda",
n_low = 0,
n_up = 0,
tol = c(1E-6, 1E-6, 1E-6),
maxiter = 1000 * round((1.25)^length(idparsopt)),
optimmethod = 'subplex',
verbose = TRUE
)
Arguments
brts
A set of branching times of a phylogeny, all positive
initparsopt
The initial values of the parameters that must be optimized
idparsopt
The ids of the parameters that must be optimized, e.g. 1:4 for all parameters.
The ids are defined as follows:
id == 1 corresponds to b (speciation-initiation rate)
id == 2 corresponds to mu_1 (extinction rate of good species)
id == 3 corresponds to la_1 (speciation-completion rate)
id == 4 corresponds to mu_2 (extinction rate of incipient species)
idparsfix
The ids of the parameters that should not be optimized, e.g. c(2,4) if mu_1 and mu_2
should not be optimized, but only b and la_1. In that case idparsopt must be c(1,3).
parsfix
The values of the parameters that should not be optimized
exteq
Sets whether incipient species have the same (1) or different (0) extinction rate as good species.
If exteq = 0, then idparsfix and idparsopt should together have all parameters 1:4
parsfunc
Specifies functions how the rates depend on time, default functions are constant functions
missnumspec
The number of species that are in the clade but missing in the phylogeny
cond
Conditioning:
cond == 0 : conditioning on stem or crown age
cond == 1 : conditioning on stem or crown age and non-extinction of the phylogeny
cond == 2 : conditioning on stem or crown age and number of extant taxa
btorph
Sets whether the likelihood is for the branching times (0) or the phylogeny (1)
soc
Sets whether the first element of the branching times is the stem (1) or the crown (2) age
methode
Sets which method should be used in the ode-solver. Default is 'lsoda'.
See package deSolve for details.
n_low
Sets the lower bound of the number of species on which conditioning should be done when cond = 2. Set this to 0 when conditioning should be done on precisely the number of species (default)
n_up
Sets the upper bound of the number of species on which conditioning should be done when cond = 2. Set this to 0 when conditioning should be done on precisely the number of species (default)
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
optimmethod
Method used in optimization of the likelihood. Current default is 'subplex'. Alternative is 'simplex' (default of previous versions)
verbose
if TRUE, explanatory text will be shown