norminvgamma.shift.sim.group: Simulate phylogenetic comparative data as Brownian motions...

Description Usage Arguments Value Examples

View source: R/brownian_motion_package.r

Description

This function simulates the evolution of a group of traits evolving as independent Brownian motions with inverse gamma distributed rates.

Usage

1
norminvgamma.shift.sim.group(phy, alpha, beta, rates, n)

Arguments

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

Value

A matrix with each row corresponding to a species and each column corresponding to a trait

Examples

1
2

Example output

            [,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

PIGShift documentation built on May 2, 2019, 9:02 a.m.