congruent.models {CRABS}R Documentation

Create a set of congruent models

Description

Create a set of congruent models

Usage

congruent.models(
  model,
  mus = NULL,
  lambdas = NULL,
  keep_ref = TRUE,
  ode_solver = TRUE
)

Arguments

model

The reference model. An object of class "CRABS"

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

ode_solver

Whether to use a numerical ODE solver to solve for lambda

Value

An object of class "CRABSset"

Examples


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

[Package CRABS version 1.2.0 Index]