library(ape)
lambda <- function(t) exp(0.3*t) - 0.5*t
mu <- function(t) exp(0.3*t) - 0.2*t - 0.8
model <- create.model(lambda, mu, times = seq(0, 3, by = 0.005))
set.seed(123)
phy <- rcoal(25)
crabs.loglikelihood(phy, model)
Run the code above in your browser using DataLab