nnls.tree
estimates the branch length using non-negative least
squares given a tree and a distance matrix. designTree
and
designSplits
compute design matrices for the estimation of edge
length of (phylogenetic) trees using linear models. For larger trees a
sparse design matrix can save a lot of memory.
computes a contrast matrix if the method is "rooted".
designTree(tree, method = "unrooted", sparse = FALSE, tip.dates = NULL,
...)nnls.tree(dm, tree, method = c("unrooted", "ultrametric", "tipdated"),
rooted = NULL, trace = 1, weight = NULL, balanced = FALSE,
tip.dates = NULL)
nnls.phylo(x, dm, method = "unrooted", trace = 0, ...)
nnls.splits(x, dm, trace = 0)
nnls.networx(x, dm)
designSplits(x, splits = "all", ...)
nnls.tree
return a tree, i.e. an object of class
phylo
. designTree
and designSplits
a matrix, possibly
sparse.
an object of class phylo
compute an "unrooted", "ultrametric" or "tipdated" tree.
return a sparse design matrix.
a vector of sampling times associated to the tips of tree.
further arguments, passed to other methods.
a distance matrix.
compute a "ultrametric" or "unrooted" tree (better use method).
defines how much information is printed during optimization.
vector of weights to be used in the fitting process. Weighted least squares is used with weights w, i.e., sum(w * e^2) is minimized.
use weights as in balanced fastME
number of taxa.
one of "all", "star".
Klaus Schliep klaus.schliep@gmail.com
fastme
, rtt
,
distanceHadamard
,
splitsNetwork
, upgma
example(NJ)
dm <- as.matrix(dm)
y <- dm[lower.tri(dm)]
X <- designTree(tree)
lm(y~X-1)
# avoids negative edge weights
tree2 <- nnls.tree(dm, tree)
Run the code above in your browser using DataLab