mbd_loglik: Calculates the likelihood for a multiple birth-death process

Description Usage Arguments Value Author(s)

View source: R/mbd_loglik.R

Description

mbd_loglik provides the likelihood for a process in which multiple births (from different parents) at the same time are possible, along with usual sympatric speciation and extinction events.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
mbd_loglik(
  pars,
  brts,
  n_0 = 2,
  cond = 1,
  missnumspec = 0,
  lx = mbd::default_lx(brts = brts, missnumspec = missnumspec),
  tips_interval = c(n_0 * (cond > 0), Inf),
  q_threshold = 0.001,
  fortran = TRUE
)

Arguments

pars

vector of parameters:

  • pars[1] is lambda, the sympatric speciation rate;

  • pars[2] is mu, the extinction rate;

  • pars[3] is nu, the multiple allopatric speciation trigger rate;

  • pars[4] is q, the single-lineage speciation probability;

brts

A set of branching times of a phylogeny.

n_0

the number of lineages at time equals zero.

cond

sets the conditioning

  • cond = 0: no conditioning;

  • cond = 1: conditioning on stem or crown age and non-extinction of the phylogeny;

missnumspec

The number of species that are in the clade, but missing in the phylogeny.

lx

it is the number of ODEs considered for the computation.

tips_interval

sets tips boundaries constrain on simulated dataset. It works only if cond == 1, otherwise it must be set to c(0, Inf).

q_threshold

adds a threshold for the evaluation of q. This is due because you never want q to actually be equal to zero or one.

fortran

Set it to TRUE if you want to use FORTRAN routine.

Value

The function returns the natural logarithm of the likelihood for the process.

Author(s)

Giovanni Laudanno


Giappo/mbd documentation built on March 3, 2020, 3:36 a.m.