beast-dev / beast-mcmc

Bayesian Evolutionary Analysis Sampling Trees
http://beast.community
GNU Lesser General Public License v2.1
191 stars 72 forks source link

Calculation of MRCA heights in a starting tree appears to be wrong #1095

Closed davidcerny closed 4 months ago

davidcerny commented 4 years ago

On macOS 10.15.6 using BEAST v1.10.4 #bc6cbd9, the XML file linked below (generated using the corresponding version of BEAUti) runs when the prior placed on Calibration14 (line 32534) is normal, or when it is exponential with an offset of up to 18.0. However, it produces a negative infinity in the BooleanLikelihood component of the posterior when the offset is at least 18.0625. This would suggest that the height of the corresponding node in the starting tree is in [18.0,18.0625], so that the tree as a whole is assigned a nonzero prior density under the lower offset but not the higher one.

However, the actual height of the MRCA of the five taxa (lines 754--758) comprising the taxon set of Calibration14 in the starting tree (line 31082) is 34.3569. I verified it using phytools::nodeheight() in R and FigTree. A quick check with phytools shows that there are no nodes with a height between 18.0 and 18.0625 in the starting tree at all. There seems to be something wrong with the way the newick string of the starting tree is being processed.

http://drive.google.com/file/d/1ORqF15zADcWz-IRaBksURdFN_O-Gppv2

rambaut commented 4 months ago

The <clade>...</clade> elements should have a height attribute to set the height of the MRCA of that clade. Have added a check for this.