# a global sampling fraction of 0.98 was used in generating the whales
# dataset.
data(whales, events.whales, mcmc.whales)
x <- BAMMlikelihood(whales, events.whales, gen = 'last', sf = 0.98)
# Does the likelihood generated by BAMM match the R implementation?
identical(round(x, 3), mcmc.whales[nrow(mcmc.whales), 'logLik'])
# an example with a constant-rate birth-death process:
pars <- c(0.5, 0.45)
names(pars) <- c("lambda", "mu")
BAMMlikelihood(whales, pars, sf = 0.98)
Run the code above in your browser using DataLab