Various code snippets as I struggle to learn Bayesian methods