Pages

Wednesday, May 13, 2015

Comparing two objects of class "densityMap"

A phytools user contacted me recently about comparing character
reconstructions obtained using stochastic character mapping by
the use of offset trees as in
here.
Although this, of course, can be done - I also have another
suggestion. That is, to compare the correlation of two different
densityMap style trees. A densityMap
tree has the posterior density from stochastic mapping of a binary
trait mapped finely on the edges and nodes of a phylogeny. For
more information about this plotting method, just check out
my blog.

The way we go about computing the correlation is by traversing the edges
of the tree and computing the correlation as 1 if the probabilities
of our character state are both 0 or both 1 on the two trees; -1 if
the probability is 0 in one tree and 1 in the other; and somewhere in
between for intermediate probabilities, depending on how high or low, and
how similar, they are.

That's all there is to it. We see that regions of high certainty show up
with high or low correlation - depending on the similarity between maps.
Regions of low certainty will always show up with near zero correlation,
which is precisely what we want.

No comments:

Post a Comment

About this blog

This web-log chronicles the development of new tools for phylogenetic analyses in the phytools R package. Unless you a reading a very recent page of the blog, I recommend that you install the latest CRAN version of phytools (or latest beta release) before attempting to replicate any of the analyses of this site. That is because the linked functions may be archived, and very likely have been replaced by newer versions.