Description Usage Arguments Value Examples
View source: R/bd.likelihood.R
This function maximises the likelihood of the function bd.probability.extant and bd.probability.range using optim, either treating stratigraphic range and phylogenetic birth and death rates
independently (constrained = FALSE
) or constraining the parameters under the birth-death chronospecies model (constrained = TRUE
).
1 2 3 | est.bd.combined(tree, frs, b = 0.3, d = 0.1, b.star = 1, d.star = 0.1,
nd = 0.1, constrained = FALSE, constrained.p = 3, crown = FALSE,
rho = 1)
|
tree |
Phylo object of extant taxa (the function will remove any extinct taxa prior to calculating the likelihood) |
frs |
Dataframe of species ranges |
b |
Initial value for the phylogenetic birth rate |
d |
Initial value for the phylogenetic death rate. Must be < b |
b.star |
Initial value for the stratigraphic range birth rate |
d.star |
Initial value for the stratigraphic range death rate |
nd |
Net diversification (b - d). Must be > 0 |
constrained |
If FALSE fossil and phylogenetic rates are treated as independent. If TRUE rates are constrained under the birth-death chronospecies model |
constrained.p |
Number of parameters to be estimated under the constrained model. If p = 2 rates are equal for fossils and phylogenies (this is the equal rates model, a special case of the BD chronospecies model). If p = 3 rates are not equal but b - d = b.star - d.star (this the compatible rates BD chronospecies model) |
crown |
If TRUE the process is conditioned on the crown instead of the origin (default = F) |
rho |
Extant species sampling probability (default = 1) |
Named list including maximum likelihood estimates of diversification rate parameters.
Under the independent rates model (constrained = FALSE
) the function returns estimates of birth, death, birth.star and death.star.
Under the compatible rates model (constrained = TRUE, constrained.p = 3
) the function returns birth and birth.star estimates for the phylogeny and stratigraphic ranges, respectively, and a single diverification rate estimate.
Under the equal rates model (constrained = TRUE, constrained.p = 2
) the function returns a single set of birth and death rates applicable to both the phylogeny and stratigraphic ranges.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # simulate tree & assume complete sampling
t = TreeSim::sim.bd.taxa(100,1,1,0.1)[[1]]
# simulated mixed speciation
beta = 0.5
lambda.a = 0.1
frs <- FossilSim::sim.taxonomy(tree = t, beta = beta, lambda.a = 0.1)
# estimate birth & death rates
# The equal rates birth-death chronospecies model
out = est.bd.combined(t, frs, constrained = TRUE, constrained.p = 2)
# ML birth rate
out$par[1]
# ML death rate
out$par[2]
# The compatible rates birth-death chronospecies model
out = est.bd.combined(t, frs, constrained = TRUE, constrained.p = 3)
# ML birth rate
out$par[1]
# ML birth.star rate
out$par[2]
# ML death rate
out$par[1] - out$par[3]
# ML death.star rate
out$par[2] - out$par[3]
# The indpendent rates birth-death model
out = est.bd.combined(t, frs, constrained = FALSE)
# ML birth rate
out$par[1]
# ML birth.star rate
out$par[2]
# ML death rate
out$par[3]
# ML death.star rate
out$par[4]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.