X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=man%2Fyule.time.Rd;h=be82f70159e623f07dec0f205a7de84347f80978;hb=fb6a06e39b9c580b39c76fd95e950144e818f45d;hp=4bbe9526e6440145c3fca64b799aef619f9bade7;hpb=42bf3d36a0a2a5edd0071739ad346ae9009abffa;p=ape.git diff --git a/man/yule.time.Rd b/man/yule.time.Rd index 4bbe952..be82f70 100644 --- a/man/yule.time.Rd +++ b/man/yule.time.Rd @@ -44,12 +44,18 @@ yule.time(phy, birth, BIRTH = NULL, root.time = 0, opti = "nlm", start = 0.01) the log-likelihood function. } \value{ - An object of class "yule" (see \code{\link{yule}}). + An object of class \code{"yule"} (see \code{\link{yule}}). +} +\author{Emmanuel Paradis} +\references{ + Hubert, N., Paradis, E., Bruggemann, H. and Planes, S. (2011) Community + assembly and diversification in Indo-Pacific coral reef + fishes. \emph{Ecology and Evolution}, \bold{1}, 229--277. } -\author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}} \seealso{ \code{\link{branching.times}}, \code{\link{ltt.plot}}, - \code{\link{birthdeath}}, \code{\link{yule}}, \code{\link{yule.cov}} + \code{\link{birthdeath}}, \code{\link{yule}}, \code{\link{yule.cov}}, + \code{\link{bd.time}} } \examples{ ### define two models... @@ -63,14 +69,18 @@ birth.step <- function(l1, l2, Tcl) { # 2 rates with one break-point BIRTH.logis <- function(t) log(exp(-a*t) + exp(b))/a + t BIRTH.step <- function(t) { - if (t <= Tcl) return(t*l1) - Tcl*l1 + (t - Tcl)*l2 + out <- numeric(length(t)) + sel <- t <= Tcl + if (any(sel)) out[sel] <- t[sel] * l1 + if (any(!sel)) out[!sel] <- Tcl * l1 + (t[!sel] - Tcl) * l2 + out } data(bird.families) ### fit both models: yule.time(bird.families, birth.logis) yule.time(bird.families, birth.logis, BIRTH.logis) # same but faster \dontrun{yule.time(bird.families, birth.step)} # fails -yule.time(bird.families, birth.step, BIRTH.step) +yule.time(bird.families, birth.step, BIRTH.step, + opti = "nlminb", start = c(.01, .01, 100)) } \keyword{models}