Description Usage Arguments Value Examples
View source: R/bd.likelihood.R
This function maximises the likelihood of the function bd.probability.range using optim (Nelder-Mead option)
1 2 | est.bd.ranges(b, d, frs, lower.b = 0.001, upper.b = 10, lower.d = 0.001,
upper.d = 10, crown = FALSE)
|
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) |
Named list including maximum likelihood estimates of birth and death rate
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]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.