Fixing multi-partition analyses

From BEAST Software

Jump to: navigation, search

Prior to version 1.4.2, BEAST did not correctly implement the operators for the relative rates of data partitions of different sizes.

Description of the problem

If the partitions were of significantly different size (number of sites) then the operator that proposes changes to the relative rates of each partition assumes equal weighting. If (for example) the smaller partition has a higher rate then these sites will be given more weight than the sites in the larger partition and the overall rate will be over estimate. The branch lengths will be proportionally underestimated so a tree with a particular set of node heights (in units of time) will have the same likelihood.

Note that use of the "2 partitions: codon positions (1 + 2), 3" option in BEAUti is affected by this bug as the first partition will contain twice as many sites as the second and will tend to have a slower rate.

Consequences

Estimates of overall rate will be out by a factor relating to the the relative size and rate of each partition. Estimates of time will be correct (with one proviso, see below) as will demographic reconstructions and most other parameters. This will be the case assuming the tree has been internally calibrated, either by assigning dates to tips or by putting priors on tMRCAs of taxa. If however, the tree has been calibrated by fixing the overall rate of evolution or by putting a strong prior on the rate then the dates and times will be wrong. The exception to this last point will be if the rate or the prior on the rate has been estimated under the same conditions (i.e., has been similarly wrongly estimated due to the same bug) - in these cases the dates may be correct. However, it is advisable if all such analyses are re-run using the latest version of BEAST and using the XML correction described below.

Solution

The simplest solution is to obtain BEAST v1.4.2 and re-create the BEAST XML using v1.4.2 of BEAUti. This will generate XML that correctly weights the operator on relative rates.

To edit the XML of an existing BEAST file for use in BEAST v1.4.2 you will need to do the following. Find the <operators> section and specifically the following lines:

	<operators id="operators">
		.
		.
		.
		<centeredScale scaleFactor="0.75" weight="1">
			<parameter idref="allMus"/>
		</centeredScale>
		<deltaExchange delta="0.75" weight="1">
			<parameter idref="allMus"/>
		</deltaExchange>

Change this to the following:

	<operators id="operators">
		.
		.
		.
		<deltaExchange delta="0.75" parameterWeights="x y" weight="1">
			<parameter idref="allMus"/>
		</deltaExchange>

Note that the <centeredScale> operator has been deleted entirely. The <deltaExchange> operator has had parameterWeights="x y" added, where x should be the number of sites in the first partition, and y should be the number of sites in the second partition. These can be simplified to relative integer values, thus if the first partition contains twice as many sites as the second then the following would work: parameterWeights="2 1". For more partitions, simply add more weights (e.g., parameterWeights="312 412 220 199").

Personal tools