= Solution
Hold all parameters except $\mu_i$ fixed and propose $\mu_i'=\mu_i+\eta$ with $\eta\sim N(0,s_{\mu i}^2)$. This <Random-walk Metropolis algorithm> has a symmetric <proposal distribution>. Define
$$
D_j'=D_j+\omega_i\{\varphi(x_j;\mu_i',v_i)-\varphi(x_j;\mu_i,v_i)\}.
$$
Cancellation of unchanged likelihood and prior factors gives the <Metropolis–Hastings acceptance probability>
$$
\boxed{a_i=\min\left\{1,\ \prod_{j=1}^n\frac{D_j'}{D_j}\exp\left[-\frac{(\mu_i')^2-\mu_i^2}{2\tau^2}\right]\right\}.}
$$
Draw an independent uniform and accept if it is at most $a_i$; otherwise retain the old value. Update each component in turn, recomputing the needed mixture contributions. On a logarithmic scale, compare $\log U$ with $\min(0,\sum_j\log(D_j'/D_j)-[(\mu_i')^2-\mu_i^2]/(2\tau^2))$ to avoid numerical underflow.
Back to article page