4

I am trying to understand and implement the blocked Gibbs sampler described on page 552 in Bayesian Data Analysis by Gelman et al. in the context of using a Dirichlet process as a prior in a mixture model. The three steps are as follows:

  1. Update $S_i \in \{1, \dots, N\}$ (cluster allocations) by multinomial sampling.
  2. Update the stick-breaking weight $V_c$, $c = 1, \dots, N - 1$, from a suitable beta.
  3. Update $\theta_c^*$, $c = 1, \dots, N$ (cluster parameters), exactly as in the finite mixture model, with the parameters for unoccupied clusters with $n_c = 0$ sampled from the prior $P_0$.

The first two steps are more or less clear. The third one, however, is not so much, and I would appreciate if someone could explain the process. How exactly are the parameters updated?

For more context, if needed, I assume a Gaussian distribution for the data with an unknown mean and an unknown precision (hence, $\theta_i^* = (\mu_i, \tau_i)$) and use a Gaussian–gamma distribution as a conjugate prior (which is $P_0$).

Ivan
  • 458
  • 1
  • 4
  • 17
  • Does [this](https://www.kamperh.com/notes/kamper_bayesgmm15.pdf) article help? There is a section about collapsed Gibbs sampling which is another term for blocked Gibbs sampling. You can also check Yee Whye Teh's implementation of DP [here](http://www.stats.ox.ac.uk/~teh/software.html). – kedarps Sep 03 '20 at 20:07
  • Thank you. I am specifically interested in the one described in the book on page 552. – Ivan Sep 06 '20 at 09:11

1 Answers1

0

I have figured it out and written a blog post explaining the whole procedure, including an implementation in R. For those interested, please find it here:

https://blog.ivanukhov.com/2021/01/25/dirichlet-process.html

Ivan
  • 458
  • 1
  • 4
  • 17