5.10 Exercises
This exercise is about regularization priors. In the code that generates the
x_c, y_cdata (see https://github.com/aloctavodia/BAP3), changeorder=2to another value, such asorder=5. Then, fitmodel_qand plot the resulting curve. Repeat this, but now using a prior for β withsd=100instead ofsd=1and plot the resulting curve. How do the curves differ? Try this out withsd=np.array([10, 0.1, 0.1, 0.1, 0.1]), too.Repeat the previous exercise but increase the amount of data to 500 data points.
Fit a cubic model (order 3), compute WAIC and LOO, plot the results, and compare them with the linear and quadratic models.
Use
pm.sample_posterior_predictive()to rerun the PPC example, but this time, plot the values ofyinstead of the values of the mean.Read and run the posterior predictive example from PyMC’s documentation at https://www.pymc.io/projects/docs/en/stable/learn/core_notebooks/posterior_predictive.html. Pay special attention to the use of...