Bayesian function learning using MCMC methods