phyl.vcv: Compute evolutionary VCV matrix for a tree & dataset

View source: R/utilities.R

phyl.vcvR Documentation

Compute evolutionary VCV matrix for a tree & dataset

Description

Internal function for phyl.pca.

Usage

phyl.vcv(X, C, lambda)

Arguments

lambda

value for \lambda transformation.

X

data matrix.

C

matrix containing the height above the root of each pair of species in the tree. Typically this will have been produced by calling vcv.phylo.

Details

Primarily designed as an internal function for phyl.pca; phyl.vcv can be used to compute the phylogenetic trait variance-covariance matrix given a phylogenetic VCV, \lambda, and a data matrix.

This function should not be confused with vcv.phylo in the ape package (although one of the objects returned is the output of vcv.phylo).

Note that prior to phytools 2.1-0 the matrix X was not sorted to match the rows of C since that was assumed to have been done in the function calling phyl.vcv internally; however, I recently discovered that this had caused the function to be used incorrectly resulting in a paper correction. This is now fixed such that X is checked for row names and (if present) C is sorted to match the rows of X. Hopefully this does not cause any problems for other functions using phyl.vcv!

Value

A list containing three elements, as follows: C, the matrix vcv.phylo transformed by lambda; R, the among trait variance-covariance matrix for the data in X; and alpha, a vector of ancestral states at the root node of the tree.

Author(s)

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.


liamrevell/phytools documentation built on March 4, 2024, 3:27 a.m.