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 than simulating
the stochastic differential equation step by step along each branch, and
achieves the same result.

To obtain simulated trait values at the internal nodes, you would again draw
from the multivariate normal distribution, but you would want a covariance
matrix which was n_nodes by n_nodes, not just n_tips by n_tips.  This
covariance matrix is relatively straightforward to compute.  For instance,
in the case of Brownian motion you would first calculate the Brownian rate
parameter sigma.  The covariance matrix is just sigma^2 times the matrix of
divergence times.  The matrix of divergence times has entry i,j equal to the
length of time from the root until those two nodes diverged (age of their
common ancestor measured from the root).  (So if they shared no evolutionary
history, they have no covariance, and if i=j, the the time is equal to the
time since the root, sigma^2 *t, the expected variance).

Using this matrix you would just draw from the multivariate normal
distribution with this as the covariance matrix.  Don't know if code for
this exists already (anyone?) but we could write something up to do this if
you like.  Sounds useful.  Hope that made sense,

Carl



On Wed, Aug 4, 2010 at 6:59 AM, Sebastien Lavergne <
sebastien.laver...@ujf-grenoble.fr> wrote:

> 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 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 help
>> Seb
>>
>>
>>
> --
>  -------------------------------------------------------------------------
>  Sébastien Lavergne
>  Laboratoire d'Ecologie Alpine, UMR-CNRS 5553
>  Université Joseph Fourier
>  BP 53, 38041 Grenoble Cedex 9, France
>  tel +33 (0)4 76 63 54 50
>  http://www-leca.ujf-grenoble.fr/membres/lavergne.htm
>
> _______________________________________________
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>



-- 
Carl Boettiger
Population Biology, UC Davis
http://two.ucdavis.edu/~cboettig

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

Reply via email to