Sample code for the Model-Based Machine Learning book.