The answer to the Gibbs sampler exercise can be found at
GibbsSampler.py GibbsSampler.ipynb cl2pred_ans.py