[R-sig-phylo] retrieving simulated ancestral states from sim.char{geiger}

2010-08-04 Thread Sebastien Lavergne
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

Re: [R-sig-phylo] retrieving simulated ancestral states from sim.char{geiger}

2010-08-04 Thread Sebastien Lavergne
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

Re: [R-sig-phylo] retrieving simulated ancestral states from sim.char{geiger}

2010-08-04 Thread Carl Boettiger
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

Re: [R-sig-phylo] retrieving simulated ancestral states from sim.char{geiger}

2010-08-04 Thread Joe Felsenstein
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

Re: [R-sig-phylo] retrieving simulated ancestral states from sim.char{geiger}

2010-08-04 Thread Liam J. Revell
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: #

Re: [R-sig-phylo] retrieving simulated ancestral states from sim.char{geiger}

2010-08-04 Thread Sebastien Lavergne
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