Connections between sequential Bayesian inference and evolutionary dynamics