
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.designTree(tree, method = "unrooted", sparse=FALSE, ...)
designSplits(x, splits = "all", ...)
nnls.tree(dm, tree, rooted=FALSE, trace=1)
nnls.phylo(x, dm, rooted=FALSE, trace=0)
nnls.splits(x, dm, trace = 0)
nnls.networx(x, dm)
phylo
nnls.tree
return a tree, i.e. an object of class phylo
.
designTree
and designSplits
a matrix, possibly sparse.
fastme
, 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