likTraitPhylo: Log-likelihood estimation for traits and phylogenies

Description Usage Arguments Details Value Author(s) References Examples

Description

This function calculates the log-likelihood and Brownian (co)variance for a trait(s) and a phylogeny using phylogenetically independent contrasts Note that as.rateMatrix calls the CAIC function vcv.array multiple times and this can be slow for large phylogenies (though faster than using the "ape" equivalent vcv.phylo).

Usage

1
likTraitPhylo(y, phy, covPIC = TRUE, brCov = NULL)

Arguments

y

A matrix of trait data. Rownames must be included and match the taxon names in the phylogeny. Can accept single traits (calculates variance) or multiple traits (calculates variance-covariance matrix).

phy

An object of class "phylo" (see ape).

covPIC

Logical - allow for covariance between multivariate traits (TRUE), or assume not covariance (FALSE). Only applicable to multivariate traits

brCov

If NULL (the default), Brownian covariance is analytically estimated. If a user-supplied numerical value is suppied the likelihood is calculate given this value

Details

The phylo object must be rooted and fully dichotomous

Value

brownianVariance Brownian variance (or covariance for multiple traits) given the data and phylogeny

logLikelihood The log-likelihood of the model and data

Author(s)

Gavin Thomas, Rob Freckleton

References

Felsenstein J. 1973. Maximum-likelihood estimation of evolutionary trees from continuous characters. Am. J. Hum. Genet. 25, 471-492.

Felsenstein J. 1985. Phylogenies and the comparative method. American Naturalist 125, 1-15.

Freckleton RP & Jetz W. 2009. Space versus phylogeny: disentangling phylogenetic and spatial signals in comparative data. Proc. Roy. Soc. B 276, 21-30.

Examples

1
2
3
4
5
6
7
data(anolis.tree)
data(anolis.data)
## calculate Brownian variance log-likelihood of female SVL
female.svl <- matrix(anolis.data[,"Female_SVL"], 
dimnames=list(rownames(anolis.data)))
input.data <- sortTraitData(phy=anolis.tree, y=female.svl, log.trait=TRUE)
likTraitPhylo(phy = input.data$phy, y=input.data$trait)

PuttickMacroevolution/motmot documentation built on June 5, 2020, 7 p.m.