m = 3
anc = c(0, 8, 16)
sig2 = c(1, 1, 2)
tree = rtree(50)
trait = rTrait(n = 1, phy = tree, model = "BM",
parameters=list(ancestral.state = anc[1], sigma2 = sig2[1]))
for (i in 2:m) {
trait = cbind(trait,rTrait(n = 1, phy = tree, model = "BM",
parameters=list(ancestral.state = anc[i], sigma2 = sig2[i])))
}
res = mace(trait, tree)
print(res)
Run the code above in your browser using DataLab