mbd_main: Run the full mbd routine

Description Usage Arguments Details

View source: R/mbd_main.R

Description

Simulate an mbd process and infer parameters maximizing the likelihood

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
mbd_main(
  sim_pars,
  cond = 1,
  n_0 = 2,
  age = 10,
  tips_interval = c(n_0 * (cond > 0), Inf),
  seed,
  start_pars = c(0.3, 0.1, 1.5, 0.15),
  optim_ids = rep(TRUE, length(start_pars)),
  ml_steps = 2,
  missnumspec = 0,
  loglik_functions = mbd::mbd_loglik,
  project_folder = NULL,
  verbose = FALSE,
  q_threshold = 1e-04,
  maxiter = 10000
)

Arguments

sim_pars

vector of starting parameters:

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

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

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

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

cond

sets the conditioning

  • cond = 0: no conditioning;

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

n_0

the number of lineages at time equals zero.

age

the age of the tree.

tips_interval

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

seed

the seed

start_pars

starting parameter values for the ml process.

optim_ids

ids of the parameters you want to optimize.

ml_steps

number of increasing precision steps to adopt in the ml routine. Each step will increment the absolute and relative tolerances of the optimizer as well as the number of equations used by the likelihood function.

missnumspec

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

loglik_functions

the loglik_functions you want to use

project_folder

the folder when you want to save data and results

verbose

choose if you want to print the output or not

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.

maxiter

maximum number of subplex iterations

Details

mle inference


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