create.model {CRABS}R Documentation

Computes the congruent class, i.e., the pulled rates.

Description

Computes the congruent class, i.e., the pulled rates.

Usage

create.model(
  func_spec0,
  func_ext0,
  times = seq(from = 0, to = 5, by = 0.005),
  func_p_spec = NULL,
  func_p_div = NULL
)

Arguments

func_spec0

The speciation rate function (measured in time before present).

func_ext0

The extinction rate function (measured in time before present).

times

the time knots for the piecewise-linear rate functions

func_p_spec

the pulled speciation rate function

func_p_div

the pulled net-diversification rate function

Value

A list of rate functions representing this congruence class.

Examples

lambda1 <- function(t) exp(0.3*t) - 0.5*t + 1
mu1 <- function(t) exp(0.3*t) - 0.2*t + 0.2

model1 <- create.model(lambda1, mu1, times = seq(0, 5, by = 0.005))

model1

data("primates_ebd")

lambda2 <- approxfun(primates_ebd[["time"]], primates_ebd[["lambda"]])
mu2 <- approxfun(primates_ebd[["time"]], primates_ebd[["mu"]])
model2 <- create.model(lambda2, mu2, primates_ebd[["time"]])

model2

[Package CRABS version 1.2.0 Index]