est.bd.extant: Maximum likelihood estimation of birth and death rates for a...

Description Usage Arguments Value Examples

View source: R/bd.likelihood.R

Description

This function maximises the likelihood of the function bd.probability.extant using optim (Nelder-Mead option)

Usage

1
2
est.bd.extant(b, d, tree, lower.b = 0.001, upper.b = 10, lower.d = 0.001,
  upper.d = 10, crown = FALSE, rho = 1)

Arguments

b

Initial value for birth rate

d

Initial value for death rate. Must be < b

tree

Phylo object of extant taxa (the function will remove any extinct taxa prior to calculating the likelihood)

lower.b

Lower birth rate

upper.b

Upper birth rate

lower.d

Lower death rate

upper.d

Upper death rate

crown

If TRUE the process is conditioned on the crown (default = F)

rho

Extant species sampling probability (default = 1)

Value

Named list including maximum likelihood estimates of birth and death rate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# simulate tree
t = TreeSim::sim.bd.taxa(100,1,1,0.1)[[1]]
# estimate birth & death rates
birth = runif(1)
death = runif(1, 0, birth)
out = est.bd.extant(birth, death, t)
# ML birth rate
out$par[1]
# ML death rate
out$par[2]

rachelwarnock/fbdR documentation built on Aug. 23, 2019, 3:39 a.m.