est.bd.ranges: 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.range using optim (Nelder-Mead option)

Usage

1
2
est.bd.ranges(b, d, frs, lower.b = 0.001, upper.b = 10, lower.d = 0.001,
  upper.d = 10, crown = FALSE)

Arguments

b

Initial value for birth rate

d

Initial value for death rate

frs

Dataframe of species ranges

lower.b

Lower birth rate

upper.b

Upper birth rate

lower.d

Lower death rate

upper.d

Upper death rate

crown

If TRUE assume the process begins at the first speciation event and not the origin (default = FALSE)

Value

Named list including maximum likelihood estimates of birth and death rate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# simulate tree & assume complete sampling
t = TreeSim::sim.bd.taxa(100,1,1,0.1)[[1]]
beta = 0.5
lambda.a = 0.1
frs <- FossilSim::sim.taxonomy(tree = t, beta = beta, lambda.a = 0.1)
# estimate birth & death rates
birth = runif(1)
death = runif(1)
out = est.bd.ranges(birth, death, frs)
# ML birth rate
out$par[1]
# ML death rate
out$par[2]

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