Finite-time optimality of Bayesian predictors