Learn R Programming

PIGShift (version 1.0.1)

OU.invgamma.like.norm: Calculate the likelihood of normalized comparative data as OUs 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 Ornstein Ulenbeck processes with inverse gamma distributed rates. The data are normalized relative to the trait values in a specified species.

Usage

OU.invgamma.like.norm(phy, dat, alpha, beta, theta, 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
theta
the constraint parameter of the Ornstein-Uhlenbeck process
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 = OU.invgamma.sim.group(yeast.tree,2,2,2,10)
OU.invgamma.like.norm(yeast.tree,sim.dat,2,2,2)

Run the code above in your browser using DataLab