X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=man%2Fyule.time.Rd;h=f67642b1db52f6e0d51f3c46d7d64ee8b1c7256e;hb=e85d89da7650e50517035d973798733d413af2aa;hp=a5c268960a6477fbd8f5dad31b8bf53652dce6ba;hpb=48b6b6fe4e38ae122c339784213732935e9b5343;p=ape.git diff --git a/man/yule.time.Rd b/man/yule.time.Rd index a5c2689..f67642b 100644 --- a/man/yule.time.Rd +++ b/man/yule.time.Rd @@ -38,7 +38,7 @@ yule.time(phy, birth, BIRTH = NULL, root.time = 0, opti = "nlm", start = 0.01) It is recommended to use \code{BIRTH} if possible, and required if speciation probability is constant on some time interval. If this primitive cannot be provided, a numerical integration is done with - \code{\link[base]{integrate}}. + \code{\link[stats]{integrate}}. The standard-errors of the parameters are computed with the Hessian of the log-likelihood function. @@ -60,17 +60,21 @@ birth.step <- function(l1, l2, Tcl) { # 2 rates with one break-point ans } ### ... and their primitives: -BIRTH.logis <- function(a, b) log(exp(-a*t) + exp(b))/a + t +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 -yule.time(bird.families, birth.step) # fails -yule.time(bird.families, birth.step, BIRTH.step) +\dontrun{yule.time(bird.families, birth.step)} # fails +yule.time(bird.families, birth.step, BIRTH.step, + opti = "nlminb", start = c(.01, .01, 100)) } \keyword{models}