Learn R Programming

phylolm (version 2.6.5)

mace: Multi-task learning for ancestral state estimation.

Description

Estimate the ancestral states of multiple traits simultaneously using a regularized maximum likelihood objective.

Usage

mace(trait, phy, lambda = NULL)

Value

a numeric vector of estimated ancestral states.

Arguments

trait

a matrix of trait values. Each row is one species and each column is a trait.

phy

a phylogenetic tree of type phylo with branch lengths.

lambda

regularizer parameter.

Author

Lam Si Tung Ho

Details

Traits are assumed to evolve according to the Brownian motion model.

References

Ho, Lam Si Tung, Vu Dinh, and Cuong V. Nguyen. "Multi-task learning improves ancestral state reconstruction." Theoretical Population Biology 126 (2019): 33-39.

Examples

Run this code
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