# bd.time

From ape v3.0-2
0th

Percentile

##### Time-Dependent Birth-Death Models

This function fits a used-defined time-dependent birth-death model.

##### Usage
bd.time(phy, birth, death, BIRTH = NULL, DEATH = NULL,
ip, lower, upper, fast = FALSE, boot = 0, trace = 0)
##### Details

Details on how to specify the birth and death functions and their primitives can be found in the help page of yule.time.

The model is fitted by minimizing the least squares deviation between the observed and the predicted distributions of branching times. These computations rely heavily on numerical integrations. If fast = FALSE, integrations are done with R's integrate function. If fast = TRUE, a faster but less accurate function provided in ape is used. If fitting a complex model to a large phylogeny, a strategy might be to first use the latter option, and then to use the estimates as starting values with fast = FALSE.

##### Value

A list with the following components:

• par
{a vector of estimates with names taken from the parameters in the specified functions.}SSthe minimized sum of squares.convergenceoutput convergence criterion from nlminb.messageid.iterationsid.evaluationsid.

##### References

Paradis, E. (2011) Time-dependent speciation and extinction from phylogenies: a least squares approach. Evolution, 65, 661--672.

ltt.plot, birthdeath, yule.time

##### Examples
set.seed(3)
tr <- rbdtree(0.1, 0.02)
bd.time(tr, 0, 0) # fits a simple BD model
bd.time(tr, 0, 0, ip = c(.1, .01)) # 'ip' is useful here
## the classic logistic:
birth.logis <- function(a, b) 1/(1 + exp(-a*t - b))
bd.time(tr, birth.logis, 0, ip = c(0, -2, 0.01))
## slow to get:
## $par ## a b death ## -0.003486961 -1.995983179 0.016496454 ## ##$SS
## [1] 20.73023
Documentation reproduced from package ape, version 3.0-2, License: GPL (>= 2)

### Community examples

Looks like there are no examples yet.