Learn R Programming

PIGShift (version 1.0.1)

norminvgamma.shift.sim.group: Simulate phylogenetic comparative data as Brownian motions with inverse gamma distributed rates

Description

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

Usage

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

Run this code
data(yeast)
norminvgamma.shift.sim.group(yeast.tree,2,2,rep(1,6),10)

Run the code above in your browser using DataLab