= Solution
Conditioned on the parameters, the <data augmentation> labels are independent. By <Bayes' theorem>, the <conditional probability> of component $i$ for observation $j$ is
$$
\boxed{P(z_j=i\mid\boldsymbol\mu,\mathbf v,\boldsymbol\omega,\mathbf x)=r_{ji}=\frac{\omega_i\varphi(x_j;\mu_i,v_i)}{\sum_{h=1}^k\omega_h\varphi(x_j;\mu_h,v_h)}.}
$$
This is the <mixture responsibility>. Draw an independent <uniform random variable> and select $i$ using the cumulative sums of $(r_{j1},\ldots,r_{jk})$. Refresh every label before recomputing the component sufficient statistics for the next <Gibbs sampler> sweep. Numerically, form the log scores $\log\omega_i-\tfrac12\log v_i-(x_j-\mu_i)^2/(2v_i)$, subtract their maximum and exponentiate before normalization.
Back to article page