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.
}
\value{
- An object of class "yule" (see \code{\link{yule}}).
+ An object of class \code{"yule"} (see \code{\link{yule}}).
}
-\author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
+\author{Emmanuel Paradis}
\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...
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}