Lesson 9 of 13 · 11 min
Bayesian Inference in Brief
Maximum likelihood hands you one optimal tree, whereas Bayesian inference estimates an entire posterior distribution over trees and their parameters. The posterior is the probability of a tree and model given the alignment, and it captures the uncertainty that a single point estimate hides. This lesson shows how that posterior is sampled and how to judge whether the sample can be trusted.
Posterior, Prior, Likelihood
Bayes' theorem states that the posterior is proportional to the likelihood times the prior. The likelihood is the same phylogenetic likelihood used in maximum likelihood, computed with Felsenstein's pruning algorithm under a substitution model such as GTR+I+G. The prior encodes beliefs held before seeing the data, including priors on the topology, branch lengths, substitution parameters, and, for dated analyses, the clock rate and node ages.
Because tree space is astronomically large, the posterior cannot be computed in closed form, so MrBayes and BEAST2 use Markov chain Monte Carlo (MCMC) to draw trees in proportion to their posterior probability. MrBayes runs Metropolis-coupled MCMC (MC3), in which several heated chains help the cold chain escape local optima. After thinning, the retained trees and parameters form your posterior sample.
Running MrBayes
begin mrbayes;
set autoclose=yes nowarn=yes;
lset nst=6 rates=invgamma;
prset brlenspr=unconstrained:gammadir(1.0,0.100,1.0,1.0);
mcmc ngen=2000000 samplefreq=1000 nchains=4 nruns=2 diagnfreq=5000;
sump burnin=500;
sumt burnin=500;
end; 1000000 -- [-7190.55] (-7201.83) (-7218.44) (-7205.10) * ... -- 0:07:12
Average standard deviation of split frequencies: 0.006129
2000000 -- (-7188.27) [-7186.34] (-7199.02) (-7192.88) * ... -- 0:00:00
Average standard deviation of split frequencies: 0.004257
Analysis completed in 14 mins 3 seconds
Likelihood of best state for "cold" chain of run 1 was -7186.34
Reading The Results
The sumt command summarizes the sampled trees into a majority-rule consensus in which each clade is annotated with its posterior probability. That value is simply the fraction of post-burn-in trees that contain the clade, so it reads directly as the probability that the clade is correct given the data, model, and priors. Posterior probabilities run from 0 to 1 and are generally higher than bootstrap proportions for the same alignment, so the two support measures must not be compared on the same scale.
Check convergence before trusting any of this. MrBayes reports the average standard deviation of split frequencies (ASDSF) between its independent runs, which should fall below 0.01, and sump prints a potential scale reduction factor (PSRF) that should sit near 1.0. For BEAST2, open the .log file in Tracer and confirm the effective sample size (ESS) exceeds roughly 200 for every parameter after burn-in is removed.
Warning: never report a Bayesian tree from a single short chain. Always discard the burn-in samples, run at least two independent analyses, and confirm ASDSF, PSRF, and ESS before interpreting posterior probabilities. Overly narrow or biologically unrealistic priors can silently inflate support, so state your priors explicitly.
Maximum likelihood with IQ-TREE or RAxML is fast and, with rapid or ultrafast bootstrap approximations, scales to thousands of taxa, making it the practical default for large concatenated or single-locus trees. Bayesian inference is preferred when you want direct probability statements about clades, want to integrate over model and parameter uncertainty, or need relaxed-clock divergence-time estimation with fossil calibrations in BEAST2. The trade-off is cost and prior sensitivity, since Bayesian runs are slower and demand explicit priors and convergence checks that maximum likelihood sidesteps.