Summarizing the posterior
As we have already seen, the result of a Bayesian analysis is a posterior distribution. This contains all the information about our parameters, according to the data and the model. One way to visually summarize the posterior is to use the plot_posterior
function that comes with PyMC3. This function accepts a PyMC3 trace or a NumPy array as a main argument. By default, plot_posterior
shows a histogram for the credible parameters together with the mean of the distribution and the 95% HPD as a thick black line at the bottom of the plot. Different interval values can be set for the HPD with the argument alpha_level
. We are going to refer to this type of plot as Kruschke's plot, since John K. Kruschke introduced this type ...
Get Bayesian Analysis with Python now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.