Defines functions make.cache.bd.t make.bd.t

Documented in make.bd.t

make.bd.t <- function(tree, functions, sampling.f=NULL,
                      unresolved=NULL, control=list(),
                      truncate=FALSE, spline.data=NULL) {
  cache <- make.cache.bd.t(tree, functions, unresolved, sampling.f,
                           truncate, spline.data)
  all_branches <- make.all_branches.t.dtlik(cache, control,
  rootfunc <- make.rootfunc.t(cache, rootfunc.bd.ode)
  const <- cache$const
  ll <- function(pars, condition.surv=TRUE, intermediates=FALSE) {
    ans <- all_branches(pars, intermediates)
    rootfunc(ans, pars, condition.surv, intermediates, const)
  class(ll) <- c("bd.t", "bd", "dtlik.t", "dtlik", "function")

make.cache.bd.t <- function(tree, functions, unresolved, sampling.f,
                            truncate, spline.data) {
  cache <- make.cache.bd.ode(tree, sampling.f, unresolved)
  if ( !is.null(cache$unresolved) )
    stop("Cannot do time-varying birth-death with unresolved clades")
  cache$info$ml.default <- "subplex"
  update.cache.t(cache, functions,
                 nonnegative=TRUE, truncate=truncate, with.q=FALSE,

Try the diversitree package in your browser

Any scripts or data that you put into this service are public.

diversitree documentation built on May 29, 2024, 4:38 a.m.