Learn R Programming

phylolm (version 2.0)

transf.branch.lengths: Creates a tree with branch lengths to represent the 3-point structure of a covariance matrix

Description

Creates a phylogenetic tree with branch lengths and a diagonal matrix to represent a (generalized) 3-point structured covariance matrix from a trait evolution model on a known tree.

Usage

transf.branch.lengths(phy, model = c("BM", "OUrandomRoot",
       "OUfixedRoot", "lambda", "kappa", "delta", "EB", "trend"),
       parameters = NULL, check.pruningwise = TRUE)

Arguments

phy
a phylogenetic tree of type phylo with branch lengths.
model
a phylogenetic model. Default is "BM", for Brownian motion. Alternatives are "OU", "lambda", "kappa", "delta", "EB" and "trend".
parameters
List of parameters for the model (see Note).
check.pruningwise
the tree is assumed to be in pruningwise order if check.pruningwise = FALSE.

Value

  • treea rooted tree with a root edge and transformed branch lengths.
  • diagMatrixa vector containing the diagonal elements of the diagonal matrix D if the covariance matrix has a generalized 3-point structure.

encoding

latin1

Details

Possible phylogenetic models are the Brownian motion model (BM), the Ornstein-Uhlenbeck model (OU), Pagel's lambda model (lambda), Pagel's kappa model (kappa), Pagel's delta model (delta), the Early Burst model (EB), and the Brownian motion model with a trend (trend).

References

Ho, L. S. T. and An�, C. A linear-time algorithm for Gaussian and non-Gaussian trait evolution models. Systematic Biology in review.

See Also

three.point.compute.

Examples

Run this code
set.seed(123456)
tre1 = rcoal(10)
tre2 = transf.branch.lengths(phy=tre1, model="OUrandomRoot",
                             parameters = list(alpha=1))
par(mfrow = c(2,1))
plot(tre1)
plot(tre2$tree,root.edge=TRUE)

Run the code above in your browser using DataLab