matsen/pplacer — Issue #189: pentropy-- a phylogenetic entropy measure
Author: matsen
Created: 2011-12-14 12:10:50+00:00
State: open
Labels: top

This one is thanks to @cmccoy, who found a [paper](http://www.people.fas.harvard.edu/~ballen/NewPhylogenetic.pdf) describing a generalization of Shannon entropy to the phylogenetic context.

It's very simple.

For any snippet e (recall that a snippet is a section of edge without any placements), let p(e) be the unitized amount of mass on the non-root side of e. Let l(e) be the length of the snippet. From there, the phylogenetic entropy is

- \sum_e l(e) p(e) log p(e)

Note that p(e) log p(e) should be defined to be zero when p(e) is zero, although the log term will give infinity.