Solution (source code)

= Solution

Write $v_i=\sigma_i^2$ for each component <variance> and $\tau^2$ for the fixed prior <variance> denoted $\sigma^2$ in the source; these must not be confused. Let $\varphi(x;\mu,v)$ be the <normal distribution> <probability density function> and $D_j=\sum_{i=1}^k\omega_i\varphi(x_j;\mu_i,v_i)$. Independent observations and independent parameter priors give the <posterior distribution>
$$
\boxed{\pi(\boldsymbol\mu,\mathbf v,\boldsymbol\omega\mid\mathbf x)\propto\left[\prod_{j=1}^nD_j\right]\prod_{i=1}^k\left\{\exp\left(-\frac{\mu_i^2}{2\tau^2}\right)v_i^{-\alpha-1}\exp\left(-\frac\beta{v_i}\right)\omega_i^{\epsilon_i-1}\right\}.}
$$
Its support has $v_i>0$, $\omega_i>0$ and $\sum_i\omega_i=1$, with $\alpha,\beta,\tau^2,\epsilon_i>0$. The component means have independent fixed-variance <priors> with a <normal distribution>, not means with variances proportional to $v_i$. The factor $e^{-\beta/v_i}$ follows from the stated <inverse-gamma distribution>. The later printed augmented expression instead has $e^{-\beta v_i}$ and an undefined prior mean; those are inconsistent with this specification. The intended model uses $e^{-\beta/v_i}$ and prior mean zero throughout.