Description Usage Arguments Value Examples
View source: R/congruent.models.R
Create a set of congruent models
1 | congruent.models(model, mus = NULL, lambdas = NULL, keep_ref = TRUE)
|
model |
The reference model. An object of class "ACDC" |
mus |
A list of extinction-rate functions |
lambdas |
A list of speciation-rate functions |
keep_ref |
Whether or not to keep the reference model in the congruent set |
An object of class "ACDCset"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(primates_ebd)
lambda <- approxfun(primates_ebd$time, primates_ebd$lambda)
mu <- approxfun(primates_ebd$time, primates_ebd$mu)
## A reference model
times <- seq(0, max(primates_ebd$time), length.out = 500)
model <- create.model(lambda, mu, times = times)
mu1 <- lapply(c(0.5, 1.5, 3.0), function(m) function(t) m)
model_set1 <- congruent.models(model, mus = mu1)
model_set1
lambda0 <- lambda(0.0) ## Speciation rates must all be equal at the present
bs <- c(0.0, 0.01, 0.02)
lambda1 <- lapply(bs, function(b) function(t) lambda0 + b*t)
model_set2 <- congruent.models(model, lambdas = lambda1)
model_set2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.