# NOT RUN {
# Simulate a random phylogeny
set.seed(25)
tree <- ape::rtree(10)
# Calculate the log likelihood under a multi-states model with 2 states
# and full extant & extinct sampling
likelihood_MSBD(tree, shifts = matrix(c(2,1.8,2), nrow = 1),
gamma = 0.05, lambdas = c(10, 6), mus = c(1, 0.5), sigma = 1)
# Infer the most likely multi-states birth-death model with full extant & extinct sampling
# }
# NOT RUN {
ML_MSBD(tree, initial_values = c(0.1, 10, 1), sigma = 1, time_mode = "mid")
# }
# NOT RUN {
# Infer the most likely multi-states birth-death model with exponential decay
# and full extant & extinct sampling
# }
# NOT RUN {
ML_MSBD(tree, initial_values = c(0.1, 10, 0.5, 1), sigma = 1,
stepsize = 0.1, time_mode = "mid")
# }
Run the code above in your browser using DataLab