Calculate density dependent likelihood of a phylogenetic tree