Codes used in my blog "Blend it like a Bayesian!" (http://blenditbayes.blogspot.co.uk/)