Sampling from the posterior distribution