BEAST 2 Help Me Choose

BEAST 2 Help Me Choose MCMC chain length

MCMC chain length

Length of the MCMC chain i.e. number of samples taken in main loop. The number of samples required differs from data sets to data set and model to model. This means that the chain length needs to be determined experimentally: run an initial chain with a chain length of say 10 million – this seems to cover most cases, but you can check the trace file part way through the run to see how the chain is behaving.

After (or during) the run, open the trace log in Tracer to see whether the MCMC is already through burn in: all traces should look like hairy caterpillars and there should be no trend lines.

If the traces do not look like this, then the chain length needs to be increased. Depending on how far away the traces look from their ideal, you may increase a little (perhaps double the chain length) or increase a lot (add a zero).

Note that when changing the chain length, you might want to change the log frequency as well.


If it turns out that ESSs never become large enough, and increasing the chain length does not help, you could consider using Coupled MCMC (Müller & Bouckaert, 2020) instead. Coupled MCMC usually mixes better, especially for poorly mixing MCMC analyses, at the cost of running extra threads.


Müller NF, Bouckaert RR. Adaptive Metropolis-coupled MCMC for BEAST 2. PeerJ. 2020 Sep 16;8:e9473. doi:10.7717/peerj.9473.

Bayesian evolutionary analysis by sampling trees

Disclaimer: The above is the opinion of the author RB. If you do not agree, or spot a mistake, contact the author, or discuss this in the issues area or raise a new issue. A link will be added from this page to make sure others can find it.

Served through Jekyll, customised theme based on the twentyfourteen wordpress theme.