Learn R Programming

PIGShift (version 1.0.1)

norminvgamma.shift.like.norm: Calculate the likelihood of normalized comparative data as Brownian motions with inverse gamma distributed rates

Description

This function calculates the likelihood of the observed trait data assuming that each trait evolves according to an independent Brownian motion with inverse gamma distributed rates. The data are normalized relative to the trait values in a specified species.

Usage

norminvgamma.shift.like.norm(phy, dat, alpha, beta, rates, norm = 1)

Arguments

phy
an ape format phylogeny on which to simulate
dat
a matrix of comparative data, in which rows correspond to species and columns correspond to traits
alpha
the shape parameter of the inverse gamma distribution
beta
the scale parameter of the inverse gamma distribution
rates
a vector of rates for each branch of the phylogeny. The order of elements in rates shoud correspond to the order of phy$branches
norm
the species by which all the data is normalized

Value

A vector, with the likelihood of each gene the observed data

Examples

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

Run the code above in your browser using DataLab