Fitting a Bayesian model by sampling from a posterior distribution with a Markov chain Monte Carlo method