Re: [R-sig-phylo] Rescaling a cophenetic matrix based on the Early Burst Model?

2017-12-15 Thread Klaus Schliep
Dear Max, there is a function called coph in phangorn. The function is hidden in the name space, so you have to use phangorn:::coph. It returns a dist object instead of a matrix and computing time is roughly O(n^2) instead of O(n^3). > library(phangorn)> tree <- rtree(1) > system.time(cm1 <- co

Re: [R-sig-phylo] Rescaling a cophenetic matrix based on the Early Burst Model?

2017-12-15 Thread Cecile Ane
Not in phylolm, because it’s faster to avoid manipulating this large matrix, if possible (and it is indeed possible for many purposes). If you can rephrase your calculations to use branching times (distance from a node to its descendant tips) or using the nodes’ distance to the root, then you co

Re: [R-sig-phylo] Rescaling a cophenetic matrix based on the Early Burst Model?

2017-12-15 Thread Max Farrell
Hi Cecile, Thanks for the input - it looks like this function does perform the tree rescaling, and in about 1/4 of the time, so this could help speed up the code! However, the function doesn't seem to return a covariance matrix. Is there a way to get the cophenetic matrix with the out put of this

Re: [R-sig-phylo] Rescaling a cophenetic matrix based on the Early Burst Model?

2017-12-15 Thread Cecile Ane
In the package phylolm, the function "transf.branch.lengths” might do what you need. It has an option model=“EB” for early burst. Cécile > On Dec 15, 2017, at 3:27 PM, Max Farrell wrote: > > I have been using the rescale function from geiger for a link prediction > model I recently helped devel

[R-sig-phylo] Rescaling a cophenetic matrix based on the Early Burst Model?

2017-12-15 Thread Max Farrell
I have been using the rescale function from geiger for a link prediction model I recently helped develop (https://arxiv.org/abs/1707.08354). I'm now running this model on a much larger dataset and part of the code is computing cophenetic(rescale(phy)) with 'EB' rescaling many many times. We're fin