= Solution
Recompute the root conditional <likelihoods> at the fitted rate, then multiply by the uniform root prior and normalize. The factors $1/4$ cancel between numerator and denominator:
$$
p(a\mid\text{leaf data},\widehat\mu)
=\frac{L_{\mathrm{root}}(a)}{\sum_bL_{\mathrm{root}}(b)}.
$$
``
prob = initialise_prob(leaves)
felsenstein(prob, mu_max, len(leaves), left, right, left_time, right_time)
root_posterior = prob[-1] / prob[-1].sum()
print(dict(zip("ACGT", root_posterior)))
``
At the refined optimum, the <posterior distribution> is
$$
\boxed{(p_A,p_C,p_G,p_T)\simeq(0.115499,\ 0.152301,\ 0.616701,\ 0.115499).}
$$
Thus G is the most probable ancestral base, but it is not inferred with certainty. This conditions on the fitted rate and does not additionally average over uncertainty in that rate.
Back to article page