5 \title{Tree Simulation Under the Time-Dependent Birth--Death Models}
7 These two functions simulate phylogenies under any time-dependent
8 birth--death model. \code{lineage} generates a complete tree including
9 the species that go extinct; \code{rbdtree} generates a tree with only
10 the species until present; \code{drop.fossil} is a utility function to
11 remove the extinct species.
14 rlineage(birth, death, Tmax = 50, BIRTH = NULL,
15 DEATH = NULL, eps = 1e-6)
16 rbdtree(birth, death, Tmax = 50, BIRTH = NULL,
17 DEATH = NULL, eps = 1e-6)
18 drop.fossil(phy, tol = 1e-8)
21 \item{birth, death}{a numeric value or a (vectorized) function
22 specifying how speciation and extinction rates vary through time.}
23 \item{Tmax}{a numeric value giving the length of the simulation.}
24 \item{BIRTH, DEATH}{a (vectorized) function which is the primitive
25 of \code{birth} or \code{death}. This can be used to speed-up the
26 computation. By default, numerical integration is done.}
27 \item{eps}{a numeric value giving the time resolution of the
28 simulation; this may be increased (e.g., 0.001) to shorten
30 \item{phy}{an object of class \code{"phylo"}.}
31 \item{tol}{a numeric value giving the tolerance to consider a species
35 Both functions use continuous-time algorithms described in the
36 references. The models are time-dependent birth--death models as
37 described in Kendall (1948). Speciation (birth) and extinction (death)
38 rates may be constant or vary through time according to an \R function
39 specified by the user. In the latter case, \code{BIRTH} and/or
40 \code{DEATH} may be used if the primitives of \code{birth} and
41 \code{death} are known. In these functions time is the formal argument
42 and must be named \code{t}.
45 An object of class \code{"phylo"}.
48 Kendall, D. G. (1948) On the generalized ``birth-and-death''
49 process. \emph{Annals of Mathematical Statistics}, \bold{19}, 1--15.
51 Paradis, E. (2011) Time-dependent speciation and extinction from
52 phylogenies: a least squares approach. \emph{Evolution}, \bold{65},
55 \author{Emmanuel Paradis}
57 \code{\link{yule}}, \code{\link{yule.time}}, \code{\link{birthdeath}},
58 \code{\link{rtree}}, \code{\link{stree}}
61 plot(rlineage(0.1, 0)) # Yule process with lambda = 0.1
62 plot(rlineage(0.1, 0.05)) # simple birth-death process
63 b <- function(t) 1/(1 + exp(0.2*t - 1)) # logistic
64 layout(matrix(0:3, 2, byrow = TRUE))
65 curve(b, 0, 50, xlab = "Time", ylab = "")
67 segments(0, mu, 50, mu, lty = 2)
68 legend("topright", c(expression(lambda), expression(mu)),
70 plot(rlineage(b, mu), show.tip.label = FALSE)
71 title("Simulated with 'rlineage'")
72 plot(rbdtree(b, mu), show.tip.label = FALSE)
73 title("Simulated with 'rbdtree'")