set.seed(1)
test = FALSE
if(test){
obj= sim_ClaDS( lambda_0=0.1,
mu_0=0.5,
sigma_lamb=0.7,
alpha_lamb=0.90,
condition="taxa",
taxa_stop = 20,
prune_extinct = TRUE)
tree = obj$tree
speciation_rates = obj$lamb[obj$rates]
extinction_rates = obj$mu[obj$rates]
plot_ClaDS_phylo(tree,speciation_rates)
sampler = fit_ClaDS0(tree=tree,
name="ClaDS0_example.Rdata",
nCPU=1,
pamhLocalName = "local",
iteration=500000,
thin=2000,
update=1000, adaptation=5)
# extract the Maximum A Posteriori for each of the parameters
MAPS = getMAPS_ClaDS0(tree, sampler, thin = 10)
# plot the simulated (on the left) and inferred speciation rates (on the right)
# on the same color scale
plot_ClaDS_phylo(tree, speciation_rates, MAPS[-(1:3)])
}
Run the code above in your browser using DataLab