Adding a few helpers from chapter 8.
Adding Bayesian estimation.