Hi Rafa.

You can get it from ace in the ape package, conditioned on a specific model (e.g., "ER","SYM","ARD" or an arbitrary model).

For instance:

fit<-ace(x,tree,type="discrete",model="ARD")
m<-nrow(fit$index.matrix)
Q<-matrix(fit$rates[fit$index.matrix],m,m)
colnames(Q)<-rownames(Q)<-colnames(fit$lik.anc)
diag(Q)<--rowSums(Q,na.rm=TRUE)

- Liam

Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 9/18/2013 1:08 PM, Rafael Rubio de Casas wrote:
Dear all,
This is probably something simple to answer.
I am trying to obtain the transition rate Q matrix for discrete trait
over a set of trees, and I cannot find a simple way (as in "directly
output by a function") of doing it. Apparently fitDiscrete doesn't
provide q automatically as part of the output anymore. Does anyone have
any guidance?
Thanks in advance,
Rafa



_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to