Hi everybody,
I have a question regarding the sim.char function in geiger.
Does anybody foresee an easy way to retrieve the simulated ancestral
states ?
(i.e. the values of each trait for all internal nodes of the tree)
Does this sound doable ? Any hint about how to do it ?
Thanks for your
I forgot to mention that I am willing to do this with continuous traits.
Thanks to those who already answered (about discrete characters
unfortunately).
Seb
Le 04/08/2010 15:03, Sebastien Lavergne a écrit :
Hi everybody,
I have a question regarding the sim.char function in geiger.
Does
Hi Alejandro.
Your code won't work because model.matrix in sim.char() is the
variance-covariance matrix for the traits, not the species.
What you can do instead is the following:
cp-corMartins(2.5,tree,fixed=T)
C-corMatrix(Initialize(cp,data))
rownames(C)-tree$tip.label # naming
Hi Sebastien,
I believe the simulation simply draws random numbers from the appropriate
multivariate normal distribution determined by the model's covariance matrix
for the tip values. This means that a complete trajectory of trait values
in never actually generated. This is much more efficient
Luke wrote:
The simulations in Geiger do draw from a mvn distribution but - in an
unnecessary step - draw random numbers for every branch and use matrix
multiplication to get the tip values. This is kind of dumb and needlessly
slow but does give you the right answer. Carl is correct that
Hi all.
Here is some code that I think will do what Dr. Felsenstein has
suggested for a single character. It returns a vector containing the
simulated states at all internal or terminal nodes, numbered according
to the numbers used in tree$edge. Happy to hear if this works. See below:
#
Hello all,
I have been using ace() to reconstruct ancestral states for a number
of continuous morphological traits. I need confidence intervals for my
analysis. However, for some sets of traits, I get the following error:
Warning message:
In sqrt(diag(solve(out$hessian))) : NaNs produced
The
Thank you all for these nice and very very helpful answers... it seems
that I have some work to do for a little while now.
I'll give a try to all the hints and pieces of code you sent me, and may
get back to you off-list for feedbacks or more precise requests.
Thanks again
Seb
Le 04/08/2010
Hi Dave and everyone,
From the responses I got to my email a few months ago, it seems to be
related to having a lot of polytomies or zero-length branches. adding a
small number to the branch length doesn't help if there are many of them
because the matrix is still very near singular and the