Course notes and code from Stat 447B at UBC 2014.