Learn R Programming

PBD (version 0.8)

pbd_loglik: Loglikelihood for protracted birth-death model of diversification

Description

pbd_loglik computes the loglikelihood of the parameters of the protracted speciation model given a set of branching times and number of missing species

Usage

pbd_loglik(
    pars1,
    pars1f = c(function(t,pars) {pars[1]},function(t,pars) {pars[2]},
function(t,pars) {pars[3]}, function(t,pars) {pars[4]}),
    pars2 = c(1,1,2,1,"lsoda"),
    brts,
    missnumspec = 0
)

Arguments

pars1
Vector of parameters: pars1[1] corresponds to b (= la_1 in Etienne & Rosindell R2012) = speciation initiation rate pars1[2] corresponds to mu_1 (= mu_g in Etienne & Rosindell 2012) = extinction rate of good species pars
pars1f
Vector of functions how the rates depend on time, default functions are constant functions of the parameters in pars1: pars1f[1] corresponds to time-dependence of b (= la_1 in Etienne & Rosindell R2012) = speciation initiation rate p
pars2
Vector of model settings: pars2[1] {set the conditioning on non-extinction of the clade (1) or not (0) } pars2[2] {sets whether the likelihood is for the branching times (0) or the phylogeny (1) } pars2[3]
brts
A set of branching times of a phylogeny, all positive
missnumspec
The number of species that are in the clade but missing in the phylogeny

Value

  • The loglikelihood

See Also

pbd_ML

Examples

Run this code
pbd_loglik(pars1 = c(0.2,0.1,1,0.1), pars2 = c(1,1,2,0,"lsoda"),brts = 1:10)

Run the code above in your browser using DataLab