Bayesian algorithms