Code to perform Bayes inference on data