You are here

Two Epoch Model

Two Epoch Model

 

BEAST Documentation->Tutorials->Two Epoch Model

To set up a two-epoch model you need to add a twoEpoch XML element into the XML file (after the treeModel is a good place):

	<twoEpoch id="demo1" units="days">
		<modernEpoch>
			<exponentialGrowth units="days">
				<populationSize>
					<parameter id="demo1.popSize" value="100.0" lower="0.0"/>
				</populationSize>
				<growthRate>
					<parameter id="demo1.growthRate" value="0.001"/>
				</growthRate>
			</exponentialGrowth>
		</modernEpoch>
		<ancientEpoch>
			<exponentialGrowth units="days">
				<populationSize>
					<parameter id="demo1.popSize2" value="100.0" lower="0.0"/>
				</populationSize>
				<growthRate>
					<parameter id="demo1.growthRate2" value="0.001"/>
				</growthRate>
			</exponentialGrowth>
		</ancientEpoch>
		<transitionTime>
			<parameter id="demo1.time" value="250.0" upper="290.0" lower="237.0"/>
		</transitionTime>
	</twoEpoch>

Note that the starting values of the parameters should be set to something reasonable for the data being analysed. The upper and lower bounds of the transition time should also be set appropriately.

This new demographic model needs to be refered to in the coalescentLikelihood element:

<coalescentLikelihood id="coalescent1">
	<model>
		<twoEpoch idref="demo1"/>
	</model>
	<populationTree> 
		<treeModel idref="treeModel"/>
	</populationTree>
</coalescentLikelihood>

Finally, the parameters of the new twoEpoch model should be added to the operators element and the log elements. In the above example there are five new parameters. If your BEAST file uses a different demographic model to generate the starting tree (in conjunction with a coalescentTree XML element) then you should make sure that the parameters of that demographic model used to generate the tree are not included in the operators element or the log elements.


Return to Tutorials