Description Usage Arguments Value Examples
View source: R/brownian_motion_package.r
This function simulates the evolution of a group of traits evolving as independent Brownian motions with inverse gamma distributed rates.
1 | norminvgamma.shift.sim.group(phy, alpha, beta, rates, n)
|
phy |
an ape format phylogeny on which to simulate |
alpha |
the shape parameter of the inverse gamma distribution |
beta |
the scale parameter of the inverse gamma distribution |
rates |
a vector of rates, with each entry corresponding to an edge of phy. Rates should be in the same order as edges in phy$edge |
n |
the number of traits to simulate |
A matrix with each row corresponding to a species and each column corresponding to a trait
1 2 | data(yeast)
norminvgamma.shift.sim.group(yeast.tree,2,2,rep(1,6),10)
|
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.05021558 1.4492325 -1.09652782 -0.7354853 -0.58335976 0.7478360
[2,] -0.02231017 0.2153531 -0.80431259 -1.0167414 -0.31418227 -0.4453817
[3,] 0.31984181 0.3451120 -0.12848866 -0.5973194 -0.09166654 0.7309275
[4,] 0.39900223 -1.2767967 0.05285756 0.3702167 0.53303156 0.1184445
[,7] [,8] [,9] [,10]
[1,] -0.58704666 0.08132572 1.1580710 0.4787094
[2,] -0.55010718 0.24720722 1.3503197 0.5359408
[3,] -0.29747797 1.40861157 1.1151916 0.5322887
[4,] 0.07676258 0.34817535 -0.4179076 -0.5565299
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.