It will sequentially sample hidden variables z t d,m and z o d,m from the distribution over these variables given the current values of all other hidden and observed variables.
in order to perform Collapsed Gibbs Sampling, conditional probability , w, c) is calculated by marginalizing out random variables Φ b , Φ t , Φ o , θ t and θ o .