# Single tree ---------------------------------------------------------------
set.seed(123)
atree <- raphylo(10)
# Fitting the model with MLE
ans <- aphylo_mle(atree ~ psi + mu_d + mu_s + Pi)
# Prediction on leaves
predict(ans)
# Prediction on all nodes (including root and interior)
predict(ans, ids = 1:Nnode(ans, internal.only = FALSE))
# Multiple trees (multiAphylo) ----------------------------------------------
atree <- c(raphylo(10), raphylo(5))
# Fitting the model with MLE
ans <- aphylo_mle(atree ~ psi + mu_d + mu_s + Pi)
# Prediction on leaves
predict(ans)
# Predicting only interior nodes
predict(ans, ids = list(11:19, 6:9))
Run the code above in your browser using DataLab