Learn R Programming

phylolm (version 2.0)

three.point.compute: Computations with a (generalized) three-point structured tree

Description

Computes $P'V^{-1}Q$ and the log(det V) of a (generalized) three-point structured matrix.

Usage

three.point.compute(phy, P, Q = NULL, diagMatrix = NULL, 
            check.pruningwise = TRUE, check.names = TRUE)

Arguments

phy
a rooted phylogenetic tree of type phylo with branch lengths, to represent the 3-point structured matrix $V_0$.
P,Q
two matrices.
diagMatrix
a vector containing the diagonal elements of the diagonal matrix D if V has a generalized 3-point structure.
check.pruningwise
the tree is assumed to be in pruningwise order if check.pruningwise = FALSE.
check.names
the row names of P, Q, and the names of diagMatrix are assumed to be the same as the labels of the tips in the tree if check.names = FALSE.

Value

  • vec11$1'V^{-1}1$.
  • P1$P'V^{-1}1$.
  • PP$P'V^{-1}P$.
  • Q1$Q'V^{-1}1$.
  • QQ$Q'V^{-1}Q$.
  • PQ$P'V^{-1}Q$.
  • logdlog(det V).

encoding

latin1

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

transf.branch.lengths.

Examples

Run this code
tre1 = rtree(500)
tre2 = transf.branch.lengths(phy=tre1, model="OUrandomRoot",
                             parameters = list(alpha = 0.5))
x1 = rTrait(tre1)
x2 = rTrait(tre1)
y = rTrait(tre1)
one = rep(1,50)
P = cbind(one,y)
Q = cbind(x1,x2)
three.point.compute(tre2$tree,P,Q,tre2$diagMatrix)

Run the code above in your browser using DataLab