data(Balaenopteridae)
tot_time<-max(node.age(Balaenopteridae)$ages)
# Fit the pure birth model (no extinction) with exponential variation of the speciation rate
# with time
f.lamb <-function(t,y){y[1] * exp(y[2] * t)}
f.mu<-function(t,y){0}
lamb_par<-c(0.08, 0.01)
mu_par<-c()
test = FALSE
if(test){
result <- fit_bd(Balaenopteridae,tot_time,f.lamb,f.mu,lamb_par,mu_par,f=1,
expo.lamb = TRUE, fix.mu=TRUE)
# Compute the matrix of probabilities
prob <- prob_dtt(result, tot_time, 1:tot_time, N0=9, type="crown")
# Check that the sums of probabilities are equal to 1
colSums(prob)
}
Run the code above in your browser using DataLab