Add Bayesian analysis code