# Simulated dataset
set.seed(14)
# Generating a random tree
tree<-pbtree(n=50, scale=10)
# Simulate the traits
sigma<-matrix(c(0.1,0.05,0.05,0.1),2)
theta<-c(0,0)
beta<- -0.34 # 5 phylogenetic half-life ( log(2)/ (10/5) )
data<-mvSIM(tree, param=list(sigma=sigma, beta=beta, ntraits=2, theta=theta,
names_traits=c("head.size","mouth.size")), model="EB", nsim=1)
## Fitting the models
mvEB(tree, data)
mvEB(tree, data, method="pic")
mvEB(tree, data, method="pic", param=list(low=log(10^-5)/10)) # avoid internal estimation
# ACDC
# Note that the AC model is not differentiable from an OU model on ultrametric trees.
beta<- 0.34
data<-mvSIM(tree, param=list(sigma=sigma, beta=beta, ntraits=2, theta=theta,
names_traits=c("head.size","mouth.size")), model="EB", nsim=1)
fit<-mvEB(tree, data, method="pic", param=list(up=2, low=-2))
logLik(fit)
AIC(fit)
summary(fit)
Run the code above in your browser using DataLab