Learn R Programming

PBD (version 0.9)

pbd_ML: Maximization of loglikelihood under protracted birth-death model of diversification

Description

Likelihood maximization for protracted birth-death model of diversification

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",
   tol = c(1E-4, 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
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 t
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.
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

Value

  • bgives the maximum likelihood estimate of b
  • mu_1gives the maximum likelihood estimate of mu_1
  • la_1gives the maximum likelihood estimate of la_1
  • mu_2gives the maximum likelihood estimate of mu_2
  • loglikgives the maximum loglikelihood
  • dfgives the number of estimated parameters, i.e. degrees of feedom
  • convgives a message on convergence of optimization; conv = 0 means convergence

See Also

pbd_loglik

Examples

Run this code
pbd_ML(1:10,initparsopt = c(0.2,0.01,0.3), exteq = 1)

Run the code above in your browser using DataLab