Hi Sebastian,
the phangorn package contains a function to construct design matrices
from a tree (class phylo from ape).
library(phangorn)
X = designTree(tree, method = "unrooted")
dm = as.matrix(dm)[tree$tip, tree$tip]
y = dm[lower.tri(dm)]
lm(y~X-1) # a normal Least Squares fit
There are sever
Dear all,
I would like to optimise branch length of a known tree topology based on
a distance matrix (non genetic data), and prohibiting negative branch
lengths.
Is there a way to do this in R ?
Any help or hints external to R are also appreciated (I just know there
is way through this in PAUP,, b