# Why use MCMC sampling when using conjugate priors?

I've been getting to grips with some Bayesian modelling, but one thing is confusing the heck out of me when I look at tutorials and worked-through problems online. I'm looking at a problem with a Dirichlet prior with alpha length 3, and observed data with a multinomial distribution. So we end up with a Dirichlet posterior. All the examples I look at online use MCMC sampling methods to form the posterior, but it is my understanding that you don't need to sample with conjugate distributions, since the posterior can be solved analytically.

This is an example of a tutorial that does this in pymc3

If I'm incorrect, and you do need to sample using conjugate priors, what is happening during each sampling step? Is it sampling one value from the Dirichlet distribution or three? Is it updating the Dirichlet prior with each step?

Thanks for any help.

• In this pedagogical example, the posterior distribution is a Dirichlet distribution and hence does not require MCMC. It is however a setting where you can illustrate MCMC with a comparison with the truth. There are however complex enough conjugate priors for which you need simulation, as for eg the Beta distribution.. Apr 2 '20 at 3:53